IBM Support

Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory [java.lang.ClassNotFoundException]

Troubleshooting


Problem

Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory [java.lang.ClassNotFoundException]

Symptom

When running the agentserver.sh or triggeragent.sh scripts, you get a ClassNotFoundException for com.ibm.websphere.naming.WsnInitialContextFactory

 

Error Message

2009-05-25 16:33:56,041:ERRORDTL:Thread-10_LOUIS_DEFAULT_SCHED_ORDER2: [1243283636040]javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory]
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:669)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:259)
    at javax.naming.InitialContext.init(InitialContext.java:235)
    at javax.naming.InitialContext.<init>(InitialContext.java:209)
    at com.yantra.interop.services.jms.JMSContext.getInitialDirContext(JMSContext.java:321)
    at com.yantra.interop.services.jms.JMSContext.getContextForService(JMSContext.java:417)
    at com.yantra.interop.services.jms.JMSContext.reconnect(JMSContext.java:456)
    at com.yantra.interop.services.jms.JMSContextMediator.reconnectContext(JMSContextMediator.java:146)
    at com.yantra.interop.services.jms.JMSConsumer.reconnectForRetry(JMSConsumer.java:421)
    at com.yantra.interop.services.jms.JMSConsumer.run(JMSConsumer.java:286)
    at java.lang.Thread.run(Thread.java:799)
Caused by: java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory
    at java.lang.Class.forNameImpl(Native Method)
    at java.lang.Class.forName(Class.java:160)
    at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:57)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:666)

Resolving The Problem

Follow the instructions in Document NFX6111 for setting up the agentserver.sh and triggeragent.sh scripts.

In particular, you need to make sure you have included ${WAS_CLIENT_HOME}/plugins in your java.ext.dirs system property.

 

[{"Product":{"code":"SS6PEW","label":"IBM Sterling Order Management"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Historical Number

NFX6114

Product Synonym

[<p><b>]Function Area[</b><p>];agentserver.sh, triggeragent.sh;[<p><b>]Severity[</b><p>];Normal;[<p><b>]Type[</b><p>];NormalFix

Document Information

Modified date:
16 June 2018

UID

swg21558015