users@glassfish.java.net

Re: Accessing remote PC

From: <glassfish_at_javadesktop.org>
Date: Sun, 22 Jul 2007 01:07:34 PDT

[code]
InitialContext ctx;
Properties props = new Properties();
                    props.setProperty("java.naming.factory.initial",
                                             "com.sun.enterprise.naming.SerialInitContextFactory");
                    props.setProperty("java.naming.factory.url.pkgs",
                                             "com.sun.enterprise.naming");
                    props.setProperty("java.naming.factory.state",
                                             "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
                        ctx = new InitialContext(props);
[/code]
after initialisation you can lookup your jndi name
ctx.lookup(name);
Normally thats the full qualified java name of the beans inteface:
e.g.: "at.freelenzer.spielplatzinfo.ejb.dao.SpielplatzDAORemote"

otherwise you can use dependency injection and use the annotation @EJB
but than you have to start your app lice:
appclient jarfile.jar
[Message sent by forum member 'chris_lenz' (chris_lenz)]

http://forums.java.net/jive/thread.jspa?messageID=227585