APAR status
Closed as program error.
Error description
While starting an application, runtime generating the java.lang.ClassCastException, if the JAXBContext implementation was packaged insight the application. We did further investigation with EJB Container team, and it appears that this may be an issue in which the thread context class loader is incorrect when the JAXB context is created within WebSphere Application Server, causing JAXP implementations to be loaded from an incorrect class loader and resulting in this ClassCastException. The JPA component currently sets the application class loader too broadly while performing application startup processing. This needs to be narrowed to only the code that creates the entity manager factory so that the JPA component will use the built in JAXB runtime while reading persistence.xml rather than incorrectly using the JAXB runtime from the customer application. [10/27/10 14:05:41:773 CDT] 0000000a ContainerImpl E WSVR0501E: Error creating component com.ibm.ws.runtime.component.ApplicationMgrImpl@354e354e com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.exception.RuntimeError: java.lang.RuntimeException: java.lang.ExceptionInInitializerError at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication s(ApplicationMgrImpl.java:826) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(Applicatio nMgrImpl.java:567) at com.ibm.ws.runtime.component.ContainerImpl.startComponents(Conta inerImpl.java:977) at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.j ava:673) at com.ibm.ws.runtime.component.ApplicationServerImpl.start(Applica tionServerImpl.java:191) at com.ibm.ws.runtime.component.ContainerImpl.startComponents(Conta inerImpl.java:977) at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.j ava:673) at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:52 6) at com.ibm.ws.runtime.WsServerImpl.bootServerContainer(WsServerImpl .java:192) at com.ibm.ws.runtime.WsServerImpl.start(WsServerImpl.java:140) at com.ibm.ws.runtime.WsServerImpl.main(WsServerImpl.java:461) at com.ibm.ws.runtime.WsServer.main(WsServer.java:59) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessor Impl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethod AccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at com.ibm.wsspi.bootstrap.WSLauncher.launchMain(WSLauncher.java:18 3) at com.ibm.wsspi.bootstrap.WSLauncher.main(WSLauncher.java:90) at com.ibm.wsspi.bootstrap.WSLauncher.run(WSLauncher.java:72) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(Platfo rmActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.run Application(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.sta rt(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStart er.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStart er.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessor Impl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethod AccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLaunche r.java:336) at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:91 ) Caused by: com.ibm.ws.exception.RuntimeError: java.lang.RuntimeException: java.lang.ExceptionInInitializerError at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication (ApplicationMgrImpl.java:991) at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.r un(ApplicationMgrImpl.java:2166) at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializ er.run(WsComponentImpl.java:342) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473) Caused by: java.lang.RuntimeException: java.lang.ExceptionInInitializerError at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(Deplo yedApplicationImpl.java:882) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication (ApplicationMgrImpl.java:952) ... 3 more Caused by: java.lang.ExceptionInInitializerError at java.lang.J9VMInternals.initialize(J9VMInternals.java:216) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextIm pl.java:219) at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory. java:76) at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory. java:55) at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory. java:124) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessor Impl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethod AccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:132) at javax.xml.bind.ContextFinder.find(ContextFinder.java:299) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337) at com.ibm.ws.jpa.management.JPAScopeInfo.<init>(JPAScopeInfo.java: 96) at com.ibm.ws.jpa.management.JPAApplInfo.processModulePUs(JPAApplIn fo.java:165) at com.ibm.ws.jpa.management.JPAComponentImpl.startingDeployedModul e(JPAComponentImpl.java:780) at com.ibm.ws.jpa.management.JPAComponentImpl.stateChanged(JPACompo nentImpl.java:646) at com.ibm.ws.runtime.component.ApplicationMgrImpl.stateChanged(App licationMgrImpl.java:1258) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeploye dObjectEvent(DeployedApplicationImpl.java:1148) at com.ibm.ws.runtime.component.DeployedModuleImpl.setState(Deploye dModuleImpl.java:214) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedMo duleImpl.java:584) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(Deplo yedApplicationImpl.java:832) ... 4 more Caused by: java.lang.ClassCastException: org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl incompatible with javax.xml.datatype.DatatypeFactory at javax.xml.datatype.DatatypeFactory.newInstance(Unknown Source) at com.sun.xml.bind.DatatypeConverterImpl.<clinit>(DatatypeConverte rImpl.java:740) at java.lang.J9VMInternals.initializeImpl(Native Method) at java.lang.J9VMInternals.initialize(J9VMInternals.java:194) ... 25 more
Local fix
Problem summary
**************************************************************** * USERS AFFECTED: IBM WebSphere Application Server V6.1 and * * V7.0 users of Java Persistence API (JPA) * * and JAXB overriding. * **************************************************************** * PROBLEM DESCRIPTION: ClassNotFoundException is thrown when * * a JPA application uses "parent * * last" class loader delegation and * * includes JAXB. * **************************************************************** * RECOMMENDATION: * **************************************************************** The JPA runtime changes the context class loader during its processing for module start, which includes parsing persistence.xml files using JAXB. The JAXB API uses the context class loader to load an implementation, which finds the JAXB implementation in the application because of "parent last" class loader delegation. The resulting implementation is not compatible, and ClassCastException is thrown.
Problem conclusion
Updated the JPA runtime to only change the context class loader while creating the container entity manager factory. The fix for this APAR is currently targeted for inclusion in fix packs 6.1.0.37 and 7.0.0.17. Please refer to the Recommended Updates page for delivery information: http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
Temporary fix
Comments
APAR Information
APAR number
PM28990
Reported component name
JPA OSGI FEATUR
Reported component ID
5724J0857
Reported release
700
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2010-12-15
Closed date
2010-12-15
Last modified date
2010-12-15
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
JPA OSGI FEATUR
Fixed component ID
5724J0857
Applicable component levels
R700 PSY
UP
[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]
Document Information
Modified date:
29 September 2020