Avancha Mallikarjun

Greenhorn
+ Follow
since Sep 28, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Avancha Mallikarjun

import="java.util.*"
import="java.sql.*"
import="javax.sql.*"
import="javax.naming.*"

Hashtable parms = new Hashtable();
parms.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
Context ctx = new InitialContext(parms);
ds = (DataSource)ctx.lookup(source);
conn = ds.getConnection(user, password);
HI above one is the part of my code and if i run this program as a stand also i am getting error as follows
/* */
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/rmi/iiop/ORB
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(W
snInitialContextFactory.java:72)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at DADXmlExtenderDBHandler.<init>(DADXmlExtenderDBHandler.java:25)
at GenXml.main(GenXml.java:8)

/* */
i have included all jar files for WsnInitialContextFactory in che class path..
regards
Malli
23 years ago
Rahul
PLease let me know How Did you able to solve you probelm B'Z i am also facing the same problem.Is it he ClassPath probelm only means that we need to put Websphere JDk in the classpath. if so which lib jar files please let me know
thanks
Malli

Originally posted by satish kumar g:
hai Rahul,
After setting the classpath to jndi.jar in jdk folder my client program got compiled.
Now i am getting a run time exception at InitialContext ctx=new InitialContext(var)it is giving the run time error while creating the InitialContext
My Client Program is like this
import java.io.*;
import java.util.*;
import javax.naming.*;
import sat.*;
public class MyHelloClient{
public static void main(String[] args){
try{
InitialContext ctx = null;
Properties env = System.getProperties();
env.put(Context.PROVIDER_URL, "iiop://localhost:900");
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
System.out.println("upto here");
ctx = new InitialContext(env);
System.out.println("upto here1");
Object homeObject = ctx.lookup("MyHello");
System.out.println("upto here2");
MyHelloHome incHome=(MyHelloHome)PortableRemoteObject.narrow(homeObject,MyHelloHome.class);
MyHello incHello=incHome.create();
String s=incHello.sayHello();
System.out.println(s);
}catch ( Exception e )
{
System.out.println(e);
}
}
}
it is printing "upto here" at the console but "upto here1" is not coming it means that the error is while creating the InitialContext.or Is there anything wrong in my client program.
This is the Error I got
upto here
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/rmi/iiop/ORB
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Compiled Code)
at java.security.SecureClassLoader.defineClass(Compiled Code)
at java.net.URLClassLoader.defineClass(Compiled Code)
at java.net.URLClassLoader.access$1(Compiled Code)
at java.net.URLClassLoader$1.run(Compiled Code)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Compiled Code)
at java.lang.ClassLoader.loadClass(Compiled Code)
at sun.misc.Launcher$AppClassLoader.loadClass(Compiled Code)
at java.lang.ClassLoader.loadClass(Compiled Code)
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>(Compiled Code)
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(CNInitialContextF
actory.java:355)
at com.ibm.ejs.ns.jndi.CNInitialContextFactory.getInitialContext(CNIniti
alContextFactory.java:196)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
71)
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 MyHelloClient.main(MyHelloClient.java:18)
So what i need to do then.
kindly help me as i strucked at this point.
satish


23 years ago
HI
I am facing some Problems with Xml Extender which is used for Composing and decomposing of Xml documents through predefined stored procedures of Db2 Data base.. I was able to generate the XMl documents of Db2 using Xml Extender by using Xml Collection and using dxxGenXml() built in stored procedure.But this stored Procedure is Generating one XMl file for every row the Sql query returns and puts in a Temporary Table(which is passed to the Stored Procedure) of db2 which can be of XmlVarchar or Clob etc.
But is there any way where in i can get a single XMl File for all records of the SQl query
Hi
I am using Db2 7.2 with Websphere 4.0 and i have put the db2java.zip in classpath of both Environment varibles and Was admin console also ..And eve i have unzipped the Dbajava.zip Dircetory and had put the same in CLASSPATH and tested ..
When i write a simple JSP program for accessing the Db2 database i was getting the following error..
ClassNotFoundException: JSPG0058E: Unable to load class COM.ibm.db2.jdbc.app.DB2Driver
Can any body faced the same problem
23 years ago