Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

error using a websphere datasource

3 views
Skip to first unread message

Pascal Noppe

unread,
Nov 22, 2000, 3:00:00 AM11/22/00
to
Hi all websphere strugglers,

trying to get a datasource from a stand-alone application with the following
code :

**************************************************START OF
CODE****************************************************
static DataSource getDataSource(String datasource){

driverLog.log(Log.INFO, "Getting data source '" + datasource + "'");
DataSource ds = null;
Context ctx = null;
String providerURL = "iiop:///";
String datasourceJNDI = datasource;

// Obtain an initial context
Hashtable parms = new Hashtable();
parms.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
parms.put(Context.PROVIDER_URL, providerURL);
try {
ctx = new InitialContext(parms);
}
catch (Exception e) {
driverLog.log(Log.ERROR, "Error getting datasource - creating initial
context");
driverLog.log(Log.ERROR, e);
return null;
}

// Look up the datasource
try {
255: ds = (DataSource)ctx.lookup(datasourceJNDI);
}
catch(NamingException e){
driverLog.log(Log.ERROR, "Error getting datasource - creating
datasource");
driverLog.log(Log.ERROR, e);
return null;
}
return ds;
}
**************************************************END OF
CODE****************************************************

I get the following error at the point where the InitialContext object is
being created (line 255 is indicated) :

java.lang.NoClassDefFoundError: com/ibm/rmi/iiop/ORB
at java.lang.ClassLoader.defineClass0(Native Method)
Interactive Session Ended
at java.lang.ClassLoader.defineClass(ClassLoader.java:442)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:101)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$1(URLClassLoader.java:216)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:191)
at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:275)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:199)
at org.omg.CORBA.ORB.create_impl(ORB.java:303)
at org.omg.CORBA.ORB.init(ORB.java:352)
at com.ibm.CORBA.iiop.GlobalORBFactory.init(GlobalORBFactory.java:42)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:196)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:93)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:65)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:47)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:343)
at
com.ibm.ejs.ns.jndi.CNInitialContextFactory.initORB(CNInitialContextFactory.
java:355)
at
com.ibm.ejs.ns.jndi.CNInitialContextFactory.getInitialContext(CNInitialConte
xtFactory.java:196)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:242)
at javax.naming.InitialContext.init(InitialContext.java:218)
at javax.naming.InitialContext.<init>(InitialContext.java:194)
at DriverTest.getDataSource(DriverTest.java:255)
at DriverTest.main(DriverTest.java:81)


I have all jars of the WebSphere server in my classpath, but apparently the
class com/ibm/rmi/iiop/ORB.class can still not be found.
Browsing through the jars, I found a com/ibm/CORBA/iiop/ORB.class
Is this mismatch the cause of my problem ?
How am i supposed to solve this ??
Executing similar code in a servlet running on the WebSphere server
environment, the datasource works perfect.


Please reply.

Thanks a lot,
pascal

0 new messages