[jboss-jira] [JBoss JIRA] Reopened: (JBAS-8417) Issue with loading JAXB library in JBOSS 4.3.0 with JDK6
Jason Greene (JIRA)
jira-events at lists.jboss.org
Thu Apr 21 14:27:23 EDT 2011
[ https://issues.jboss.org/browse/JBAS-8417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jason Greene reopened JBAS-8417:
--------------------------------
Due to feedback from the community, I have split the AS7 and AS6 projects and reopened all unscheduled AS6 issues that are a year or less old. This will make it easier community members to find and work on them.
Future releases beyond 6.1 can be done provided a community member steps up to coordinate them.
> Issue with loading JAXB library in JBOSS 4.3.0 with JDK6
> --------------------------------------------------------
>
> Key: JBAS-8417
> URL: https://issues.jboss.org/browse/JBAS-8417
> Project: Legacy JBoss Application Server 6
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: ClassLoading
> Affects Versions: JBossAS-4.2.1.GA
> Environment: I am currently running JBoss 4.3.0 CP06 which I understand is essentially 4.2.1.
> Reporter: Pek Lee Seow
> Assignee: Scott Stark
> Priority: Critical
> Fix For: No Release
>
>
> I am having ClassCastException when instantiating JAXBContext within my web application.
> javax.xml.bind.JAXBException: ClassCastException: attempting to cast jar:file:/C:/Documentum/jboss4.3.0/server/DctmServer_MethodServer/deploy/dfs.ear/APP-INF/lib/jaxb-api.jar!/javax/xml/bind/JAXBContext.class to jar:file:/C:/Documentum/jboss4.3.0/jdk/jre/lib/rt.jar!/javax/xml/bind/JAXBContext.class. Please make sure that you are specifying the proper ClassLoader.
> javax.xml.bind.ContextFinder.handleClassCastException(ContextFinder.java:96)
> javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:205)
> javax.xml.bind.ContextFinder.find(ContextFinder.java:363)
> javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
> javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
> HelloWorldServlet.marshallCode(HelloWorldServlet.java:62)
> HelloWorldServlet.doGet(HelloWorldServlet.java:43)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
> Here is the line of code where the problem occurs:
> JAXBContext dataContext = JAXBContext.newInstance(MySimpleSouceData.class);
> Basically my web application (WAR) is deployed as part of an .EAR file with jaxb-api.jar and jaxb-impl.jar included in the .ear's APP-INF/lib. The web application does not have any of the JAXB libraries included in the .war file.
> The jboss-app.xml has been set to as follows:
> <?xml version="1.0" encoding="UTF-8"?>
> <jboss-app>
> <loader-repository>
> com.emc.documentum.fs:loader=emc-dfs.ear
> <loader-repository-config>
> java2ParentDelegation=false
> </loader-repository-config>
> </loader-repository>
> <library-directory>
> APP-INF/lib
> </library-directory>
> </jboss-app>
> I do not understand why the JAXBContext class instance from rt.jar (loaded by bootstrap/system classloader) is reference here when the configuration explicitly state to use the web application instance first (i.e. java2ParentDelegation=false).
> When I remove the jboss-app.xml file, the ClassCastException goes away. It seems the JAXBContext class is loaded by:
> org.jboss.mx.loading.UnifiedClassLoader3 at 2a2cc{ url=file:/C:/Documentum/jboss4.3.0/server/DctmServer_MethodServer/deploy/jbossws.sar/ ,addedOrder=12}
> Is this a JBoss classloading bug?
> What actually happens when jboss-app.xml is not provided? What is the default behaviour? And how is it that ClassCastException does not happen here??
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list