GLADIATOR
GLADIATOR

Reputation: 119

Getting java.lang.VerifyError exception while using JDOM

Please help me to find out the way to get out of this, while using JDOM API, I am using

root.addContent(new Element("name").setText("Enlightenment"));

method to add the element in XML but during runtime I am getting the following exception:

java.lang.VerifyError: (class: com/asiaone/web/common/A1BusinessXmlOperation, method: create signature: ()V) Incompat`enter code here`ible argument to function
        at org.apache.jsp._business_5F_iframe_5F_page._jspService(_business_5F_iframe_5F_page.java:281)

After compiling the file with runtime JDOM library I am getting following exception,

java.lang.UnsupportedClassVersionError: com/asiaone/web/common/A1BusinessXmlOperation 
(Unsupported major.minor version 49.0)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:539)

But I check the java version:

java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Server VM (build 1.5.0_04-b05, mixed mode)

i.e. also fine. Why is this error happening now?

`java.lang.LinkageError: LinkageError while defining class: com.asiaone.web.common.A1BusinessXmlOperation Could not be defined due to: com/asiaone/web/common/A1BusinessXmlOperation (Unsupported major.minor version 49.0) This is often caused by having a class defined at multiple locations within the classloader hierarchy. Other potential causes include compiling against an older or newer version of the class that has an incompatible method signature. Dumping the current context classloader hierarchy:

Upvotes: 0

Views: 200

Answers (1)

FThompson
FThompson

Reputation: 28687

VerifyError is the result of invalid bytecode at runtime, and is usually the result of using a library version different than the one compiled with. It is often due to the method signature of one build version being different from another, causing the JVM to attempt to do things it cannot, so it instead throws a VerifyError.

You are most likely getting the VerifyError because the Apache library you compiled with differs from the one you are running your program with with. Recompile your build with the same library version you run with.

Upvotes: 1

Related Questions