I added <path name="sun/beans/editors"/> to modules\sun\jdk\main\module.xml and it works. Could anybody explain to me why JBoss 7 needs all class packages to be configured in module xml?
Mike, I agree with you. "From my experience, classes from rt.jar in jre should be able to be loaded anytime."
I have the same issue with com/sun/org/apache/xml/internal/serialize/XMLSerializer
Thats really a strange behaviour...
I believe this is a consequence of JBoss 7 trying to remain JVM agnostic. These classes may not exist in non SunOracle implementations, or even some future Oracle release.
Ok, thats a valid point.
So, whas best practice?
In my case the ClassNotFound is caused by castor-xml. Should I add the xerces.jar as well?
Not sure, but I think that I have read something like "better remove xerces.jar (or xml-apis.jar) for example from lib dir"...?
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.