IBM Support

javax.naming.NoInitialContextException : Cannot instantiate class

Troubleshooting


Problem

javax.naming.NoInitialContextException : Cannot instantiate class due to incorrect value specified

Symptom

Customer experienced error in configuring JMS "First delivery attempt failed for message 12463694391400003BA97986F010987EAFD6ED957A85EB7 due to
'javax.naming.NoInitialContextException : Cannot instantiate class:
com.sun.jndi.fscontext.RefSContextFactory', on Destination
'SS_AIM_PG.OUT-JMS_GATEWAY@' (id=3) "

This happened even after customer had copied providerutil.jar & fscontext.jar in the
/router/lib/userexits dir and had restarted the whole WPG.

Customer was re-using the already existing .bindings from WPG 6.0

Cause

Incorrect name specified

Resolving The Problem

One possible cause of this error is incorrect value specified forJMS JNDI Factory Name

Advised customer to configure JMS Destination configuration screen to recheck the value of JMS JNDI Factory Name

For on particular customer scenario, a typo was made so its value was specified as
"com.sun.jndi.fscontext.RefSContextFactory" and once it was changed to

"com.sun.jndi.fscontext.RefFSContextFactory"

the problem was resolved.

[{"Product":{"code":"SSDKJ8","label":"WebSphere Partner Gateway Enterprise Edition"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"6.1;6.1.0.1;6.1.0.2;6.1.0.3;6.1.1;6.1.1.1;6.1.1.2;6.2;6.2.0.1","Edition":"Advanced;All Editions","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
23 June 2018

UID

swg21408217