IBM Support

PM27213: WHILE STARTING AN APPLICATION, RUNTIME GENERATING THE PJAVA.LANG.CLASSCASTEXCEPTION.

Fixes are available

6.1.0.37: Java SDK 1.5 SR12 FP3 Cumulative Fix for WebSphere
7.0.0.17: Java SDK 1.6 SR9 FP1 Cumulative Fix for WebSphere Application Server
6.1.0.47: WebSphere Application Server V6.1 Fix Pack 47
7.0.0.27: Java SDK 1.6 SR13 FP2 Cumulative Fix for WebSphere Application Server
6.1.0.39: Java SDK 1.5 SR12 FP4 Cumulative Fix for WebSphere Application Server
6.1.0.41: Java SDK 1.5 SR12 FP5 Cumulative Fix for WebSphere Application Server
6.1.0.43: Java SDK 1.5 SR13 Cumulative Fix for WebSphere Application Server
6.1.0.45: Java SDK 1.5 SR14 Cumulative Fix for WebSphere Application Server
6.1.0.47: Java SDK 1.5 SR16 Cumulative Fix for WebSphere Application Server
7.0.0.19: Java SDK 1.6 SR9 FP2 Cumulative Fix for WebSphere Application Server
7.0.0.21: Java SDK 1.6 SR9 FP2 Cumulative Fix for WebSphere
7.0.0.23: Java SDK 1.6 SR10 FP1 Cumulative Fix for WebSphere
7.0.0.25: Java SDK 1.6 SR11 Cumulative Fix for WebSphere Application Server
7.0.0.27: Java SDK 1.6 SR12 Cumulative Fix for WebSphere Application Server
7.0.0.29: Java SDK 1.6 SR13 FP2 Cumulative Fix for WebSphere Application Server
7.0.0.45: Java SDK 1.6 SR16 FP60 Cumulative Fix for WebSphere Application Server
7.0.0.31: Java SDK 1.6 SR15 Cumulative Fix for WebSphere Application Server
7.0.0.35: Java SDK 1.6 SR16 FP1 Cumulative Fix for WebSphere Application Server
7.0.0.37: Java SDK 1.6 SR16 FP3 Cumulative Fix for WebSphere Application Server
7.0.0.39: Java SDK 1.6 SR16 FP7 Cumulative Fix for WebSphere Application Server
7.0.0.41: Java SDK 1.6 SR16 FP20 Cumulative Fix for WebSphere Application Server
7.0.0.43: Java SDK 1.6 SR16 FP41 Cumulative Fix for WebSphere Application Server

Subscribe

You can track all active APARs for this component.

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

    PM27213

  • Reported component name

    WAS EJB3 FEATUR

  • Reported component ID

    5724J0851

  • Reported release

    61A

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2010-11-22

  • 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:

    PM28990

Fix information

  • Fixed component name

    WEBSPHERE APP S

  • Fixed component ID

    5724J0800

Applicable component levels

  • R61A PSY

       UP

  • R61H PSY

       UP

  • R61I PSY

       UP

  • R61P PSY

       UP

  • R61S PSY

       UP

  • R61W PSY

       UP

  • R61Z PSY

       UP

  • R700 PSY

       UP



Document information

More support for: WebSphere Application Server
General

Software version: 6.1

Reference #: PM27213

Modified date: 15 December 2010