Exception thrown when doing a lookup (WAS 5.0)
4 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, May 27, 2003 05:23 AM

Here is my client code: try { System.out.println("Begin%%%%%%%%%%%%%%%%%%"); Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory"); env.put(Context.PROVIDER_URL, "iiop://satish:900"); env.put(Context.SECURITY_PRINCIPAL, "admin"); env.put(Context.SECURITY_CREDENTIALS, "admin"); Context ctx = new InitialContext(env); System.out.println("before lookup"); Object obj = ctx.lookup("TestSBEJB"); System.out.println("obj is : " + obj); System.out.println("obj class is : " + obj.getClass().getName())   More>>
Here is my client code:
			
try
{
System.out.println("Begin%%%%%%%%%%%%%%%%%%");

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "iiop://satish:900");
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "admin");
Context ctx = new InitialContext(env);
System.out.println("before lookup");
Object obj = ctx.lookup("TestSBEJB");
System.out.println("obj is : " + obj);
System.out.println("obj class is : " + obj.getClass().getName());


}catch(Exception e)
{
e.printStackTrace();
}


Here is the Exception:


Begin%%%%%%%%%%%%%%%%%%

before lookup

javax.naming.NamingException: Failed to initialize the ORB. Root exception is java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:313)

at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:363)

at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:102)

at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:408)

at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:131)

at javax.naming.InitialContext.lookup(InitialContext.java:347)

at helloClient.Test(helloClient.java:31)

at helloClient.main(helloClient.java:13)

Caused by: java.lang.NoClassDefFoundError: com/ibm/CORBA/iiop/GlobalORBExistsException
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:385)
... 12 more



I would really appreciate if someone could tell me where am doing wrong.. No errors were reported at the time of deployment through admin console.

Thanks.......    <<Less

Re: Exception thrown when doing a lookup (WAS 5.0)

Posted By:   Sathiya_Narayanan  
Posted On:   Wednesday, June 18, 2003 02:00 PM

the default port number is 2809
so u have to use "iiop://hostname:2809/"
I saw ur question only today..I hope by this time u fixed this problem.

Re: Exception thrown when doing a lookup (WAS 5.0)

Posted By:   shekhar_shukla  
Posted On:   Tuesday, June 10, 2003 10:23 PM

I had the same problem. When I checked the 'java -version' it showed that it was pointing to and installation of Java with JDeveloper developed by Oracle. Then I explicitly used the JVM that I got with Websphere and it worked for me.

Re: Exception thrown when doing a lookup (WAS 5.0)

Posted By:   bhagya_devulapalli  
Posted On:   Monday, June 9, 2003 03:02 PM

I am having problems connecting to the oracle database.

I have defined this in a property file.

gcs.jndi.initialContextFactory=com.ibm.websphere.naming.WsnInitialContextFactory
#CHANGE NEEDED for providerUrl and should have the value of your machines ip address
gcs.jndi.providerUrl=iiop://localhost:900
gcs.jndi.sessionProviderUrl=iiop://localhost:900
gcs.datasource.oraclePool=jdbc/GcsOracleDataSource




I have defined the datasource name as jdbc/GcsOracleDataSource through the Portal Server admin console.


But I am getting this exception:


javax.naming.NameNotFoundException: jdbc/GcsOracleDataSource
at com.ibm.ejs.ns.jndi.CNContextImpl.doLookup(CNContextImpl.java:1445)
at com.ibm.ejs.ns.jndi.CNContextImpl.lookup(CNContextImpl.java:1129)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:128)
at javax.naming.InitialContext.lookup(InitialContext.java:359)



Please help me.

Re: Exception thrown when doing a lookup (WAS 5.0)

Posted By:   Nick_Maiorano  
Posted On:   Tuesday, May 27, 2003 06:55 PM

Satish,



If I take the stack trace at face value, it seems as if there is a jar file missing on your classpath in the startup script of websphere.



Try to locate the class com/ibm/CORBA/iiop/GlobalORBExistsException in one of the jar files supplied with websphere. Once you locate it, see if the jar file is on the classpath and add it if necessary.

About | Sitemap | Contact