IBM Support

PI54230: ClassNotFoundException when using generic RA in Liberty

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • A Generic RA needs to be used to wrap a simple JMS client
    (the
    JMS provider does not supply an RA) so that it can be
    activated
    in Liberty 8.5.5.6.  However, an issue has
    been identified in Liberty's third-party JMS RA support,
    which
    means the specified in the element is not
    available when the MDB is activated.
    
    For example, (wrapping the MQ JMS client as though it had no
    RA) a configuration like this...
    
    <resourceAdapter id="GenericRA"
    location="${shared.resource.dir}
    /genericra.rar" autoStart="true">
    
    
    <fileset dir="${shared.resource.dir}/mqlib"
    includes="*.jar"/>
    
    
    <properties.GenericRA
    RMPolicy="OnePerPhysicalConnection"
    ProviderIntegrationMode="jndi"
    SupportsXA="true"
    LogLevel="ALL"
    
    JndiProperties="java.naming.factory.url.pkgs=com.ibm.mq.jms.
    nami
    ng,
    java.naming.factory.initial=com.sun.jndi.fscontext.RefFSCont
    extF
    actory,
    java.naming.provider.url=file:${shared.resource.dir}/jndicon
    text
    "
    />
    
    
    
    <properties.GenericRA
    DestinationJndiName="InboundJMSDestination"
    DestinationType="javax.jms.Queue"
    
    ConnectionFactoryJndiName="InboundJMSConnectionFactory" />
    
    
    ...results in an ClassNotFoundException when the activation
    specification is applied...
    
    Exception = java.lang.ClassNotFoundException
    Source =
    com.ibm.ws.jndi.internal.WASInitialContextFactoryBuilder
    probeid = 57
    Stack Dump = java.lang.ClassNotFoundException:
    com.sun.jndi.fscontext.
    RefFSContextFactory
    at
    com.ibm.ws.classloading.internal.UnifiedClassLoader.findClas
    s
    (UnifiedClassLoader.java:118)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at
    com.ibm.ws.classloading.internal.UnifiedClassLoader.loadClas
    s0
    (UnifiedClassLoader.java:106)
    at
    com.ibm.ws.classloading.internal.UnifiedClassLoader$Delegati
    on.
    loadClass(UnifiedClassLoader.java:77)
    at
    com.ibm.ws.classloading.internal.UnifiedClassLoader.loadClas
    s
    (UnifiedClassLoader.java:101)
    at
    com.ibm.ws.classloading.internal.ThreadContextClassLoader.lo
    adCl
    ass
    (ThreadContextClassLoader.java:110)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at com.ibm.ws.jndi.internal.WASInitialContextFactoryBuilder.
    createInitialContextFactory(WASInitialContextFactoryBuilder.
    java
    :55)
    at
    org.apache.aries.jndi.ContextHelper.getInitialContextUsingBu
    ilde
    r
    (ContextHelper.java:233)
    at org.apache.aries.jndi.ContextHelper.getContextProvider
    (ContextHelper.java:208)
    at
    org.apache.aries.jndi.ContextHelper.getInitialContext(Contex
    tHel
    per.
    java:141)
    at org.apache.aries.jndi.OSGiInitialContextFactoryBuilder.
    getInitialContext(OSGiInitialContextFactoryBuilder.java:51)
    at
    javax.naming.spi.NamingManager.getInitialContext(NamingManag
    er.j
    ava:
    684)
    at
    javax.naming.InitialContext.getDefaultInitCtx(InitialContext
    .jav
    a:
    313)
    at javax.naming.InitialContext.init(InitialContext.java:244)
    at javax.naming.InitialContext.(InitialContext.java:216)
    at
    com.sun.genericra.util.ObjectBuilderFactory$JndiObjectBuilde
    r.
    createObject(ObjectBuilderFactory.java:95)
    at
    com.sun.genericra.util.ObjectBuilder.build(ObjectBuilder.jav
    a:10
    0)
    at com.sun.genericra.inbound.AbstractConsumer.
    initializeAdministeredObjects(AbstractConsumer.java:95)
    .....
    
    &#160;
    

Local fix

  • This issue can be worked around by adding an additional
    <classloader> element to the <application> containing the MDB
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server Liberty Profile using third party    *
    *                  JMS resource adapters                       *
    ****************************************************************
    * PROBLEM DESCRIPTION: Message driven bean is not receiving    *
    *                      messages or connection factory is       *
    *                      unable to create connections.           *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    The server.xml is configured for to use the "Generic JMS
    provider" resource adapter with MQ libraries.
    
    ClassNotFound Exceptions are seen even though the MQ libraries
    are configured on the classloader for the resource adapter.
    
    For problems with MDB receiving messages the console.log
    contains:
      [WARNING ] CNTR4015W: The message endpoint for the [name of
    bean here] message-driven bean cannot be activated because the
    [activation spec for the MDB] activation specification is not
    available. The message endpoint will not receive messages until
    the activation specification becomes available.
    
    FFDC will contain:
    Stack Dump = java.lang.ClassNotFoundException:
    com.sun.jndi.fscontext.RefFSContextFactory
    	at java.lang.Class.forNameImpl(Native Method)
    	at java.lang.Class.forName(Class.java:219)
    	at
    com.ibm.ws.jndi.internal.WASInitialContextFactoryBuilder.createI
    nitialContextFactory(WASInitialContextFactoryBuilder.java:55)
    	at
    org.apache.aries.jndi.ContextHelper.getInitialContextUsingBuilde
    r(ContextHelper.java:233)
    	at
    org.apache.aries.jndi.ContextHelper.getContextProvider(ContextHe
    lper.java:208)
    	at
    org.apache.aries.jndi.ContextHelper.getInitialContext(ContextHel
    per.java:141)
    	at
    org.apache.aries.jndi.OSGiInitialContextFactoryBuilder.getInitia
    lContext(OSGiInitialContextFactoryBuilder.java:51)
    	at
    javax.naming.spi.NamingManager.getInitialContext(NamingManager.j
    ava:695)
    	at
    javax.naming.InitialContext.getDefaultInitCtx(InitialContext.jav
    a:318)
    	at javax.naming.InitialContext.init(InitialContext.java:253)
    	at javax.naming.InitialContext.<init>(InitialContext.java:227)
    	at
    com.sun.genericra.util.ObjectBuilderFactory$JndiObjectBuilder.cr
    eateObject(ObjectBuilderFactory.java:95)
    	at
    com.sun.genericra.util.ObjectBuilder.build(ObjectBuilder.java:10
    0)
    	at
    com.sun.genericra.inbound.AbstractConsumer.initializeAdministere
    dObjects(AbstractConsumer.java:95)
    	at
    com.sun.genericra.inbound.AbstractConsumer.<init>(AbstractConsum
    er.java:63)
    	at
    com.sun.genericra.inbound.async.EndpointConsumer.<init>(Endpoint
    Consumer.java:57)
    	at
    com.sun.genericra.inbound.EndpointConsumerFactory.createEndpoint
    Consumer(EndpointConsumerFactory.java:45)
    	at
    com.sun.genericra.GenericJMSRA.endpointActivation(GenericJMSRA.j
    ava:215)
    	at
    com.ibm.ws.jca.service.EndpointActivationService.activateEndpoin
    t(EndpointActivationService.java:508)
           ...
    
    For problems with connections the application will receive
    javax.jms.JMSException: Unable to find the InitialContextFactory
    com.sun.jndi.fscontext.RefFSContextFactory.
    	at
    com.sun.genericra.util.ExceptionUtils.newJMSException(ExceptionU
    tils.java:67)
    	at
    com.sun.genericra.outbound.ConnectionFactory.createConnection(Co
    nnectionFactory.java:80)
    FFDC will contain:
    Stack Dump = javax.resource.ResourceException: Unable to find
    the InitialContextFactory
    com.sun.jndi.fscontext.RefFSContextFactory.
    	at
    com.sun.genericra.util.ExceptionUtils.newResourceException(Excep
    tionUtils.java:73)
    	at
    com.sun.genericra.outbound.AbstractManagedConnectionFactory.crea
    teManagedConnection(AbstractManagedConnectionFactory.java:128)
    	at
    com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper(Fr
    eePool.java:1744)
    	at
    com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java
    :1488)
    	at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2992)
    	at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2333)
    	at
    com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionMa
    nager.java:1122)
    	at
    com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionM
    anager.java:689)
    	at
    com.sun.genericra.outbound.ConnectionFactory.createConnection(Co
    nnectionFactory.java:75)
           ...
    

Problem conclusion

  • The code has been updated to resolve the ClassNotFoundException
    that may occur for some resource adapters when a library is
    configured on its classloader.
    
    The fix for this APAR is currently targeted for inclusion in fix
    pack 8.5.5.9.  Please refer to the Recommended Updates page for
    delivery information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

  • The problem may be worked around by adding the MQ libraries to
    the classloader for the application.
    

Comments

APAR Information

  • APAR number

    PI54230

  • Reported component name

    WAS LIBERTY COR

  • Reported component ID

    5725L2900

  • Reported release

    855

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2015-12-15

  • Closed date

    2016-02-23

  • Last modified date

    2016-02-23

  • 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

    WAS LIBERTY COR

  • Fixed component ID

    5725L2900

Applicable component levels

  • R855 PSY

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Product":{"code":"SSD28V","label":"WebSphere Application Server Liberty Core"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"855","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
16 October 2021