Jdom 1.0 && (Jboss 4.01 || Jboss 4.0) incompatibility
Sat, 26 Feb 2005 10:16 PM GMT

I have this situation where I receieve the following error:

java.lang.VerifyError: (class: com/xyzcorp/project/Application, method: toXML signature: ()Lorg/jdom
/Element;) Incompatible argument to function

This comes from a standard java bean that I have called Application. In this application I have a toXML method that returns a org.jdom.Element element.

The version I am working with is JBoss 4.0.1 with JDK1.5.0. The OS with this problem is an unknown distro of linux. The JDOM version I am working with is 1.0.

This problem occurs in a standalone war file. In other words, this war is not encapsulated in an ear file. The jdom.jar file is located in the WEB-INF/lib directory of the war file.

I had attempted the following things:
  • Removed the info.xml from the jdom.jar
  • Installed a jdom.jar in the /lib directory

What I found out is that if you have a war that uses specific jars like jdom.jar, that perhaps other ears use, then you need to deploy that war file first. After you deploy all the wars, then deploy all the ear files. Though I have not researched it better, I think there there is a different class loading mechanism for ears than for wars. Somehow the utility jar file for wars are shared.

2 comments for Jdom 1.0 && (Jboss 4.01 || Jboss 4.0) incompatibility
Anonymous
Sun, 27 Feb 2005 05:20 AM GMT

I had the same problem. I had to upgrade to Java 1.5
Dan Hinojosa
Sun, 27 Feb 2005 07:44 AM GMT

I was using java 1.5 anyways. Matt Raible has some stuff on separate classloaders I am going to try.