• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

cannot instantiate class: WsnInitialContextFactory in WAS5.1

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am getting following error... and i have wasted so much time in resolving jars version.

Here is the error:

javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websph
ere.naming.WsnInitialContextFactory . Root exception is java.lang.ClassNot
FoundException: com.ibm.websphere.naming.WsnInitialContextFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:374)
at java.lang.ClassLoader.loadClass(ClassLoader.java:562)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:438)
at java.lang.ClassLoader.loadClass(ClassLoader.java:494)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:256)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.jav
a:59)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
61)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:256
)
at javax.naming.InitialContext.init(InitialContext.java:232)
at javax.naming.InitialContext.<init>(InitialContext.java:208)
at versata.vfc.XDAEJBConnector_WS.getInitialContext(XDAEJBConnector_WS.j
ava:96)
at versata.vfc.XDAEJBConnector_WS.getEJBHome(XDAEJBConnector_WS.java:140
)
at versata.vfc.XDAEJBConnector_WS.connectInternal(XDAEJBConnector_WS.jav
a:282)
at versata.vfc.XDAEJBConnector_EJB.connectJNDI(XDAEJBConnector_EJB.java:
129)
at versata.vfc.XDAEJBConnector.connect(XDAEJBConnector.java:70)
at versata.common.VSSession.connect(VSSession.java:652)
at com.ibm.rdc.fmw.cassette.gaa.server.GAABusinessClient.init(GAABusines
sClient.java:70)
at com.ibm.rdc.fmw.cassette.gaa.server.CoverageHandler.getBusinessClient
(CoverageHandler.java:260)
at com.ibm.rdc.fmw.cassette.gaa.server.CoverageHandler.executeTask(Cover
ageHandler.java:128)
at com.ibm.rdc.fmw.util.threads.PullThreadPool$WorkerThread.run(PullThre
adPool.java:213)
at java.lang.Thread.run(Thread.java:568)


please help urgently.... thanks in advance.

mina.
 
Mina Syal
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any idea...
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like classpath issue...can you print the error which is at the bottom? Says like 'Caused by'. I use Versata too so i shall try to help you out.
 
Mina Syal
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sridhar,

Thanks for your reply... but i didn't get you what are you looking for

Following is the print stack of error thorwn:
javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory . Root exception is java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:374)
at java.lang.ClassLoader.loadClass(ClassLoader.java:562)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:438)
at java.lang.ClassLoader.loadClass(ClassLoader.java:494)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:256)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.jav
a:59)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
61)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:256
)
at javax.naming.InitialContext.init(InitialContext.java:232)
at javax.naming.InitialContext.<init>(InitialContext.java:208)
at versata.vfc.XDAEJBConnector_WS.getInitialContext(XDAEJBConnector_WS.j
ava:96)
at versata.vfc.XDAEJBConnector_WS.getEJBHome(XDAEJBConnector_WS.java:140
)
at versata.vfc.XDAEJBConnector_WS.connectInternal(XDAEJBConnector_WS.jav
a:282)
at versata.vfc.XDAEJBConnector_EJB.connectJNDI(XDAEJBConnector_EJB.java:
129)
at versata.vfc.XDAEJBConnector.connect(XDAEJBConnector.java:70)
at versata.common.VSSession.connect(VSSession.java:652)
at com.ibm.rdc.fmw.cassette.gaa.server.GAABusinessClient.init(GAABusines
sClient.java:70)
at com.ibm.rdc.fmw.cassette.gaa.server.CoverageHandler.getBusinessClient
(CoverageHandler.java:260)
at com.ibm.rdc.fmw.cassette.gaa.server.CoverageHandler.executeTask(Cover
ageHandler.java:128)
at com.ibm.rdc.fmw.util.threads.PullThreadPool$WorkerThread.run(PullThre
adPool.java:213)
at java.lang.Thread.run(Thread.java:568)

I am getting this error at aVSSession.connect(); which is an object of VSSession. following are the lines of code:
String aVLSName = appMData.getVlsName();
String aPackageName = appMData.getVlsPackage();
String anApplicationName = appMData.getVlsApplication();
String aUserId = appMData.getVlsUserId();
String aPassword = appMData.getVlsPassword();

AppEnvironment anAppEnvironment = new AppEnvironment(aPackageName, anApplicationName, null, true, false );
private versata.security.SecurityObject secObj;
secObj = new versata.security.SecurityObject(aUserId, aPassword, aPackageName + "." + anApplicationName);

aVSSession = new VSSession(aVLSName,secObj, anAppEnvironment);

VSApplicationContext.setPackageName(aPackageName);
VSApplicationContext.setAppName(anApplicationName);
VSApplicationContext.setSession(aVSSession);
try {
aVSSession.connect();
System.out.println("************************** VSSESSION CONNECTED *************");
} catch (Throwable ex) {
ex.printStackTrace();
}


hope this will answer your question...
looking for your reply again...

thanks
 
sridhar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mina, for me its more like classpath issue. Check your classpath and see you have the required jars. Follow the below as a basic investigation.
1. See you have Versata/Lib/jaxb/namespace.jar and that is in classpath.
2. Check you have websphere.jar, naming and naming client jars(forgot the exact names). Here are few jars need to be in classpath.
\WebSphere\AppServer\lib\j2ee.jar
\WebSphere\AppServer\properties
\WebSphere\AppServer\lib\websphere.jar;
\WebSphere\AppServer\lib\naming.jar;
\WebSphere\AppServer\lib\namingclient.jar;
\WebSphere\AppServer\java\jre\lib\server.jar
3. Make sure you are using IBM JDK to compile the class.

Hopefully this will help you else shall Investigate more.
[ October 07, 2005: Message edited by: sridhar ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic