I am using JBoss 7.1.1.Final and found a class from rt.jar cannot be loaded in runtime. From my experience, classes from rt.jar in jre should be able to be loaded anytime.
Could somebody advise why this problem happens and how to resolve it?
Caused by: java.lang.ClassNotFoundException: sun.beans.editors.StringEditor from [Module "deployment.demo.ear.demo.jar:main" from Service Module L oader] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) [rt.jar:1.6.0_07]
What version of castor-xml are you using?
There's some interesting comments at http://www.castor.org/1.2/release-notes.html down just below the notes for Release 1.1-M3 regarding changes for Java 5, xerces and serialization.
Maybe you can spot some hints there. It certainly answers your last question I think. xml-apis.jar is evil and should never be deployed in an application BTW.
Speaking of evil, Mikes thread has now been hijacked...
Your opinion sounds reasonable. However, I have made it work by adding the classpath in the module xml. BTW, could you please take a look at my another question here
It is also about class loading problem. If you have any idea on it, it will be much appreciated.
we are using castor-xml 1.3.2.
I checked the notes for Release 1.1-M3. Castor uses xerces shipped with jdk/jre. Anyway, not the issue...
In general, whats the best way to do it ?
a) adding path element to module.xml (as Mike and have done so far)
b) adding jar (xerces for example) to ear/lib
c) matter of taste
For our EAR project we have the following for our jboss-deployment-structure.xml:
This allows you to deploy the app without making changes to the (possibly shared with other teams) module.xml file.