users@glassfish.java.net

Re: Webstart EJB JNDI lookup fails

From: Gustavo Henrique Orair <gustavo.orair_at_gmail.com>
Date: Wed, 21 Dec 2011 19:15:27 -0200

I don't know if I understand well your problem.

Java Web Start is used to launch appclients and you didn't mention that you
have an appclient.

Your problem looks like related to an issue I had in past when trying to
use appclients.

Java Web Start (client WebStart app???) can't "harvest your application" to
find which is the Main Class to be executed, so if you don't specify the
Main-Class in the appclient manifest file, Java Web Start launches will
fail because users have no (good) way of specifying the main class.

See the question I posted here:
http://www.java.net/forum/topic/glassfish/glassfish/problems-using-java-web-start-application-client-libraries-not-found
http://java.net/jira/browse/GLASSFISH-17549

See more info in:
http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html

BR,
---------------------------------------------------------------------------------------------------------------------
                               Gustavo Henrique Orair
 Mestre em Ciência da Computação - MSc in Computer Science
                                    Universidade Federal de Minas Gerais
               Celular/Cell phone: 55-31-85157887
------------------------------------------------------------------------------------------------------------------


2011/12/21 <forums_at_java.net>

> 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<http://forums.java.net/node/876342>
>
>
>