Bugs item #665037, was opened at 2003-01-09 14:32
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=665037&group_id=22866

Category: JBossServer
>Group: v3.0 Rabbit Hole
Status: Open
Resolution: None
Priority: 5
Submitted By: Shone Sadler (ssadler)
Assigned to: Nobody/Anonymous (nobody)
Summary: HomeHandle causing NoInitialContextException in JBOSS3.0.4

Initial Comment:
When running our remote clients we get a 
NoInitialContextException.  The exception is caused by 
a call to HomeHandle.getEJBHome().  After Looking 
through the source code for JBOSS, it seems that 
JBOSS 3.0.4's 
com.jboss.proxy.ejb.handle.HomeHandleImpl does not 
serialize the JNDI context information like is should (and 
used to in JBOSS2.4.  Instead it always creates a new 
InitialContext in the getEJBHome method.  The following 
example illustrates the problem.

import 
com.qlinktech.pof3.omapi.POFObjectManagerRemoteHo
me;


import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import javax.ejb.HomeHandle;
import java.util.Properties;

public class Example {
   public static void main(String[] args) throws Exception 
{
     Properties _prop = new Properties();
      _prop.setProperty
("java.naming.factory.initial","org.jnp.interfaces.NamingC
ontextFactory");
      _prop.setProperty
("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.
interfaces");
      _prop.setProperty
("java.naming.provider.url","localhost");
      _prop.setProperty
("java.naming.provider.port","1099");

      InitialContext _ic = new InitialContext(_prop);
      POFObjectManagerRemoteHome _om_home = 
(POFObjectManagerRemoteHome)
PortableRemoteObject.narrow(_ic.lookup
("qlink/POFObjectManager"),POFObjectManagerRemote
Home.class);

      HomeHandle _hhandle = _om_home.getHomeHandle
();
      //Here is where the NoInitialContextException is 
thrown
      _om_home = (POFObjectManagerRemoteHome)
javax.rmi.PortableRemoteObject.narrow
(_hhandle.getEJBHome
(),POFObjectManagerRemoteHome.class);
   }
}


Thanks,

Shone Sadler
Senior Software Developer
Q-Link Technologies



OS: Win2000
JDK:1.3.1_06

Server Trace:

C:\development>java Example
Exception in thread "main" java.rmi.ServerException: 
Could not get EJBHome; nes
ed exception is:
        javax.naming.NoInitialContextException: Need to 
specify class name in e
vironment or system property, or as an applet 
parameter, or in an application r
source file:  java.naming.factory.initial
javax.naming.NoInitialContextException: Need to specify 
class name in environme
t or system property, or as an applet parameter, or in an 
application resource
ile:  java.naming.factory.initial
        at 
javax.naming.spi.NamingManager.getInitialContext
(NamingManager.java:
38)
        at javax.naming.InitialContext.getDefaultInitCtx
(InitialContext.java:24
)
        at 
javax.naming.InitialContext.getURLOrDefaultInitCtx
(InitialContext.ja
a:278)
        at javax.naming.InitialContext.lookup
(InitialContext.java:345)
        at 
org.jboss.proxy.ejb.handle.HomeHandleImpl.getEJBHom
e(HomeHandleImpl.
ava:72)
        at Example.main(Example.java:29)




----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=665037&group_id=22866


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to