put this in your servlet code:

System.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingC
ontextFactory");
System.setProperty("java.naming.provider.url","localhost:1099");
InitialContext ctx = new InitialContext();
Object objref = initial.lookup("ejb/User");


hope it helps

Andr�


> -----Urspr�ngliche Nachricht-----
> Von: Linda Berry [mailto:[EMAIL PROTECTED]]
> Gesendet am: Mittwoch, 15. November 2000 11:49
> An: JBOSS list (E-mail)
> Betreff: [jBoss-User] NoInitialContextException
> 
> Can someone please help me.
> 
> I am now using jboss-2.0-FINAL with embedded tomcat-3.2-b7 
> and jdk1.3 on
> windows NT 4. (installed from the jboss_tomcat.zip)
> 
> I have auto deployed my app.ear file from the jboss deploy 
> directory. I have
> a servlet that is using ejb's. I get the following exception:
> 
> /*************************************************************
> **************
> **************************************************************
> **************
> *****************/
> [EmbeddedTomcat] Exception in getting user info:
> 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
> [EmbeddedTomcat] userdata is null
> [EmbeddedTomcat] Ctx(  ): Exception in: R(  + 
> /servlet/SystemEntry + null)
> java.lang.NullPointerException
>         at
> net.citec.cms.servlet.login.SystemEntry.isCitecIp(SystemEntry.
> java:378)
>         at
> net.citec.cms.servlet.login.SystemEntry.doGet(SystemEntry.java:74)
>         at
> net.citec.cms.servlet.login.SystemEntry.doPost(SystemEntry.java:287)
>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper
> .java:404)
>         at org.apache.tomcat.core.Handler.service(Handler.java:286)
>         at
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
>         at
> org.apache.tomcat.core.ContextManager.internalService(ContextM
> anager.java:79
> 9)
>         at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:745)
>         at
> org.apache.tomcat.service.http.HttpConnectionHandler.processCo
> nnection(HttpC
> onnectionHandler.java:210)
>         at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoin
> t.java:407)
>         at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPo
> ol.java:498)
>         at java.lang.Thread.run(Unknown Source)
> [Bean Cache] Resized cache for bean ejb/Client: old size = 
> 1000, new size =
> 50
> /*************************************************************
> **************
> **************************************************************
> **************
> *****************/
> 
> The servlet code looks as follows:
> 
>          Context initial = new InitialContext();
>          Object objref = initial.lookup("ejb/User");
> 
> I have tried the following:
> 1. Putting jndi.properties in my jdk1.3\lib directory
> 2. Putting jndi.properties in my jdk1.3\jre\lib directory
> 3. Putting the jndi.properties in my classpath
> 4. Putting the individual entries in jndi.properties in my classpath
> 
> NOTHING WORKS!
> 
> Can someone please tell me what I'm doing wrong?
> 
> Linda Berry
> 
> 
> 
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Problems?:           [EMAIL PROTECTED]
> 


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to