-
1. Re: class in rt.jar is not loaded by JBoss 7
ohmygod Jul 6, 2012 2:22 AM (in response to ohmygod)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?
-
2. Re: class in rt.jar is not loaded by JBoss 7
mac2009 Jul 10, 2012 7:43 AM (in response to ohmygod)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...
-
3. Re: class in rt.jar is not loaded by JBoss 7
sfcoy Jul 10, 2012 8:34 AM (in response to mac2009)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.
-
4. Re: class in rt.jar is not loaded by JBoss 7
mac2009 Jul 10, 2012 10:15 AM (in response to sfcoy)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"...?
-
5. Re: class in rt.jar is not loaded by JBoss 7
sfcoy Jul 10, 2012 10:30 AM (in response to mac2009)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...
-
6. Re: class in rt.jar is not loaded by JBoss 7
ohmygod Jul 10, 2012 10:31 AM (in response to sfcoy)Hi Stevephen,
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
https://community.jboss.org/thread/202324
It is also about class loading problem. If you have any idea on it, it will be much appreciated.
-
7. Re: class in rt.jar is not loaded by JBoss 7
mac2009 Jul 10, 2012 4:06 PM (in response to sfcoy)Hi Stephen,
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
Cheers
Carsten
-
8. Re: class in rt.jar is not loaded by JBoss 7
andyrooheavens Jan 5, 2014 9:51 PM (in response to mac2009)For our EAR project we have the following for our jboss-deployment-structure.xml:
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<dependencies>
<system>
<paths>
<path name="com/sun/org/apache/xml/internal/serialize"/>
<path name="sun/beans/editors"/>
</paths>
</system>
</dependencies>
</deployment>
<sub-deployment name="xyz.war"/>
</jboss-deployment-structure>
This allows you to deploy the app without making changes to the (possibly shared with other teams) module.xml file.