This week's book giveaways are in the AI and JavaScript forums.
We're giving away four copies each of GANs in Action and WebAssembly in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

jndi lookup exception

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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);
...
 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
No more fooling around. Read this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!