• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Naming Service unavailable

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i have instaled IBM websphere Single server Edition 4.0 .
When i try to run the folowing client
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("before context");
ctx = new InitialContext(env);
// Get a naming context

System.out.println("Got context11");

// Get a reference to the Interest Bean
Object ref = ctx.lookup("gs/hello");
on runing the above client i get the following error
javax.naming.ServiceUnavailableException: NULL returned when resolving initial reference=NameService
javax.naming.ServiceUnavailableException: NULL returned when resolving initial reference=NameService
at com.ibm.ws.naming.util.WsnInitCtxFactory.getCosRootContext(WsnInitCtxFactory.java:451)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:336)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContext(WsnInitCtxFactory.java:199)
at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:79)
at com.ibm.ejs.ns.jndi.CNInitialContextFactory.getInitialContext(CNInitialContextFactory.java:68)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.init(InitialContext.java:222)
at javax.naming.InitialContext.<init>(InitialContext.java:198)
at session.SessionClient.main(SessionClient.java:58)
Process Exit...
How do i go with this.
ORB is running at localhost:900
Thanx
anil
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi anil,
I've tried getting an initial context, without setting the parameter 'PROVIDER_URL' and it works. Although I have no clue as to why that would screw things up, I think it's worth a try. Let us know if it works. Thanks.
-Asuthosh
 
anil dhiman
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi aSHUTOSH,
When i comment the Provider_url and run the client progrram i get the folowing exception.
javax.naming.ServiceUnavailableException: Caught exception when resolving initial reference=NameService [Root exception is java.lang.ClassCastException: com.sun.corba.se.internal.io.FVDCodeBaseImpl]
javax.naming.ServiceUnavailableException: Caught exception when resolving initial reference=NameService. Root exception is java.lang.ClassCastException: com.sun.corba.se.internal.io.FVDCodeBaseImpl
at com.ibm.rmi.corba.ClientDelegate.getServantIOR(ClientDelegate.java:815)
at com.ibm.rmi.corba.ClientDelegate.getServiceContexts(ClientDelegate.java:349)
at com.ibm.CORBA.iiop.GIOPImpl.createRequest(GIOPImpl.java:146)
at com.ibm.CORBA.iiop.GIOPImpl.createRequest(GIOPImpl.java:116)
at com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1038)
at com.ibm.CORBA.iiop.InitialNamingClient.resolve(InitialNamingClient.java:372)
at com.ibm.CORBA.iiop.InitialNamingClient.cachedInitialReferences(InitialNamingClient.java:591)
at com.ibm.CORBA.iiop.InitialNamingClient.resolve_initial_references(InitialNamingClient.java:355)
at com.ibm.CORBA.iiop.ORB.resolve_initial_references(ORB.java:1751)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getCosRootContext(WsnInitCtxFactory.java:410)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:336)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContext(WsnInitCtxFactory.java:199)
at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:79)
at com.ibm.ejs.ns.jndi.CNInitialContextFactory.getInitialContext(CNInitialContextFactory.java:68)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.init(InitialContext.java:222)
at javax.naming.InitialContext.<init>(InitialContext.java:198)
at session.SessionClient.main(SessionClient.java:58)
Process Exit...
Thiss exception is thrown when i try to get the initial context
Thanx
Anil
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Anil.
WebSphere 4.0 ASE is shipped along with IBM's JDK.Pay attention to what JDK you are using when launching the client.Sun's JDK won't work.With exact the same configurations you already have in your code, try to launch the client but set the path to the to use IBM's <java>.Do not forget though to run <setupCmdLine.bat> from within WebSphere root directory.
Hope it helps,
Cheers,
Razvan
 
anil dhiman
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Thanx i had tried with with ibms jdk and it works fine .
Thanx fo rur response
Anil
 
Razvan Matei
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As a supplementary clue I would say that RMI/IIOP implementations from different vendors are not so compatible and conformant to the standards as they should or as they are claimed to be :-)).

Razvan
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic