aspose file tools
The moose likes Websphere and the fly likes jndi lookup exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "jndi lookup exception" Watch "jndi lookup exception" New topic
Author

jndi lookup exception

nicole loh
Greenhorn

Joined: Feb 10, 2004
Posts: 4
Hi,
there is an exception thrown when I try to run a standalone application look up the jndi in websphere. I really have no clue what the cause is, is there anyone can provide some advice? thanks !!
The exception is as below:
Exception in thread "main" java.lang.NoClassDefFoundError: org/omg/CosNaming/Nam
ingContextExtOperations
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:10
6)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:243)
at java.net.URLClassLoader.access$100(URLClassLoader.java:51)
at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(W
snInitialContextFactory.java:104)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
60)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:241
)
at javax.naming.InitialContext.init(InitialContext.java:217)
nicole loh
Greenhorn

Joined: Feb 10, 2004
Posts: 4
Sorry....the exception I posted is wrong..... this is the actual exception I got:
javax.naming.ConfigurationException: Malformed provider URL: corbaloc:iiop:loc
host
at com.ibm.ws.naming.util.WsnInitCtxFactory.parseBootstrapURL(WsnInitC
Factory.java:1422)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(
nInitCtxFactory.java:368)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:102)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:
8)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:131)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
Tony Chen
Ranch Hand

Joined: Jan 29, 2001
Posts: 286
Originally posted by nicole loh:
Sorry....the exception I posted is wrong..... this is the actual exception I got:
javax.naming.ConfigurationException: Malformed provider URL: corbaloc:iiop:loc
host
at com.ibm.ws.naming.util.WsnInitCtxFactory.parseBootstrapURL(WsnInitC
Factory.java:1422)
at

check your provider url, make sure it looks like something this:
"corbaloc:iiop:myhost.mycompany.com:2809"

...
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import com.ibm.websphere.naming.PROPS;
...
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "corbaloc:iiop:myhost.mycompany.com:2809");
env.put(PROPS.NAME_SPACE_ROOT, PROPS.NAME_SPACE_ROOT_CELL_PERSISTENT);
Context initialContext = new InitialContext(env);
...


SCJP Java 2 - IBM Certified Enterprise Developer - WebSphere V4.0 & V5.0 - IBM Certified System Administrator - WebSphere Network Deployment V6.0 - Canadian Securities Course (CSC) Certification
Ben Ethridge
Ranch Hand

Joined: Jul 28, 2003
Posts: 108
I have a similar problem, and I think this might do the trick. Do you know what jar those IBM PROPS are in?

I've tried hunting them down, but no luck as yet.

Ben
 
wood burning stoves
 
subject: jndi lookup exception