HelloHome home = (HelloHome) PortableRemoteObject.narrow(ref, HelloHome.class);
Hello hello = home.create();

Handle handle = hello.getHandle();                      
Hello hello2 = (Hello) PortableRemoteObject.narrow(handle.getEJBObject(), 
Hello.class);

It throws 

java.rmi.ServerException: Could not get EJBObject; nested exception is: 
        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 
org.jboss.proxy.ejb.handle.StatelessHandleImpl.getEJBObject(StatelessHandleImpl.java:83)
        at tutorial.client.HelloClient.main(HelloClient.java:42)
Caused by: 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:645)
        at 
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
        at 
javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at 
org.jboss.proxy.ejb.handle.StatelessHandleImpl.getEJBObject(StatelessHandleImpl.java:76)
        ... 1 more


However, does the Handle already containing the lookup and JNDI information? 
why i still get this Exception? how can i fix it?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3893720#3893720

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3893720


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to