I'm having this issue with a java app run on RFID scanner. I have added the classes. But it seems the method in the class could not be located. Anyone know of something perhaps?
Exception in thread "xShadow-1" java.lang.NoSuchMethodError: ReadEventCallback
at symbol.RFIDBase.RFID_EnableReadTagInventoryCallback()
at symbol.RFIDReader$RFIDActions.readTag()
at symbol.RFIDReader$RFIDActions.readTag()
at com.vmt.plugins.symbol.barcodescanner.services.ScannerImplementation$RfidTriggerListener.actio nPerformed()
at symbol.RFIDReader$RFIDActions.TriggerCallback()
Exception in thread "xShadow-1" java.lang.NoSuchMethodError: ReadEventCallback
It seems you have wrong version of jars in classpath. I would suggest make sure the code you have is compatible with the jar version you have in classpath.
Related
I am trying a encrypt a plain text using org.apache.commons.codec.binary.Base64. When I call the method org.apache.commons.codec.binary.Base64.encodeBase64String(aByteArray), it gives the following exception
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.encodeBase64String([B)Ljava/lang/String;
I am using the jar, org-apache-commons-codec.jar. Please help me as I can't understand What is wrong with this.
First of all encoding is not encryption. You are only changing representation of your string while encoding, it is easily changed back.
Since you are getting this exception this means that you at least have this jar in your classpath. Open this jar with a suitable zip tool like 7-zip and look at your Manifest.mf file. Your jar version should be greater than 1.4 according to Base64javadoc. Download latest version and replace your older version.
I am trying to debug a Java / Maven project with a lot of depencies on various libraries.
When I run it on a Linux server the program starts up fine, but when I try to run it in Eclipse it throws the following exception:
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.camel.model.RouteDefinition.getErrorHandlerBuilder()Lorg/apache/camel/ErrorHandlerFactory;
at org.apache.camel.spring.spi.SpringTransactionPolicy.wrap(SpringTransactionPolicy.java:69)
at org.apache.camel.model.PolicyDefinition.createProcessor(PolicyDefinition.java:133)
at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:437)
at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:183)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:817)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:165)
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:697)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1654)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1441)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1338)
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1316)
Now, I can see that the RouteDefinition class is in the camel-core-2.9.3,jar and I can see that this library is imported. So how come it doesn't see that method?
How do I go about debugging this?
Could I get info from the process running on the Linux server? For example can I get the list of Jars that are imported and the order in which they are imported?
Many thanks!
The error that you're getting is caused by Maven pulling in the wrong version. Try deleting all versions out of your local repo, add it explicitly to your pom, clean out all of your builds, pray to the eclipse gods, etc. If it still gives you the error, check your local repo to see which wrong versions it pulled in, figure out what depends on them, and add explicit ignores for them while keeping the explicit include.
I've seen this type of error over here for exceptions that are thrown by various classes, though I haven't found the right solution for mine just yet.
I'm trying to get AWS Java SDK work locally so I can write a test application that reads data from a Kinesis stream.
Problem is, when I run the init() static method I encounter the following error:
Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.http.impl.conn.DefaultClientConnectionOperator.<init>
(Lorg/apache/http/conn/scheme/SchemeRegistry;Lorg/apache/http/conn/DnsResolver;)V
Now, this is not the first error I've been thrown. I've been thrown four or five exceptions prior to this one, and the solution to all of them was just importing some jar's into the project. e.g.:
apache-httpcomponents-httpclient.jar
com.fasterxml.jackson.databind.jar
commons-codec-1.9.jar / commons-codec-1.9-javadoc.jar / commons-codec-1.9-sources.jar
httpclient-4.2.jar
httpcore-4.0.1.jar
I've seen in other threads around here that it could be the version of the httpcore library, however I imported the latest one.
Any ideas how I can resolve this? I'm thinking about starting over, as my project seems to be a heap of imports I'm not sure I'll actually utilize. Furthermore, I can't debug the binary imports of the AWS SDK (or can't I?).
Cheers.
Problem solved, I gradually added the missing libraries to the project and when the apache httpclient jar should be version 4.0 or later, and without any previous version to contradict.
I imported httpclient-4.2.jar and it worked.
Other than that, I just solved the exception that followed by importing joda-time-2.4.jar and it's all up and running.
I am stuck one point.
I am getting this error from eclipse
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jogl in java.library.path
I tried few links and tried to solve problem, but I am unable to do so.
I changed Jar file location, no output
I also tried to change eclipse.ini, but it also couldn't resolve it.
What should I do?
If any other information or image is required regarding issue, I will provide. ask me in comments.
Thanks
Duaan
In your run configuration in Eclipse, add
-Djava.library.path=<path to JOGL>
under Arguments -> VM Arguments.
When you run outside of Eclipse, you'll need to make sure the native libraries are accessible too. As Hot Licks mentioned, these are the native libraries (e.g. dll files in Windows), not just the Java class files that come with JOGL.
I have a project in eclipse which was working fine untile a few minutes ago. I added a JDBC driver ad tried to run it, now even previous runnable file are giving me
Exception in thread "main" java.lang.NoClassDefFoundError: sample
Does anyone have any idea why it is happening does it have anything to do with the jar?
I have even removed the jar.
Try following, one by one
If you are using libraries, check whether everything is included to the project properly.
Rebuild the project
'worked few minutes ago' means it used to work. Did you add any new code? Then the error is there, check whether those codes call other classes, and whether they are available
Restart IDE
Once I used the following to solve the same issue
http://javarevisited.blogspot.com/2011/06/noclassdeffounderror-exception-in.html
If all above failed, that may be due to crash in JVM. I have experienced that as well.