users@glassfish.java.net

Webstart EJB JNDI lookup fails

From: <forums_at_java.net>
Date: Wed, 21 Dec 2011 13:45:45 -0600 (CST)

Hi,

I have Webstart client running on GlassFish 3.1 and try to connect it to the
remote EJB interface. My whole application is packaged into one EAR where I
have a EJB module for service and WAR module for client. If I run my client
using Eclipse it works just fine but when I try to use it from launched
Webstart app it fails allways to the following exception:

javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an
application resource file:  java.naming.factory.initial
    at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
    at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
    at
javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:344)
    at javax.naming.InitialContext.lookup(InitialContext.java:411)
    at fi.mps.webstart.webstart.MyApp.main(MyApp.java:33)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.sun.javaws.Launcher.executeApplication(Unknown Source)
    at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
    at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
    at com.sun.javaws.Launcher.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:722)

Here is my client Main:

    public static void main(String[] args) throws NamingException {
        Properties props = new Properties();
        props.put("org.omg.CORBA.ORBInitialHost", "localhost");
        props.put("org.omg.CORBA.ORBInitialPort", "3700");
        RemoteService service = (RemoteService) new
InitialContext(props).lookup("remoteService");
       

Do I need to add something to the WAR package or what can be the problem?

Thanks!

- Mike


--
[Message sent by forum member 'sopanenmp']
View Post: http://forums.java.net/node/876342