That's a pity but exception is stile the same when using Properties.
> Kenneth Saks wrote:
>>> I've done what you had written. So now in my resin.conf is:
>>
>>
>> I haven't seen this particular error before. It's possible it has to
>> do with the way the InitialContext is created via the jndi-link
>> machinery.
>> I would try just explicitly creating the InitialContext in your code
>> instead of using jndi-link. Use the InitialContext( Hashtable )
>> constructor and set the same properties as defined by our
>> jndi.properties.
> One additional thing. When using the InitialContext you create, just
> go ahead and directly access the global JNDI name of the target
> remote EJB rather than trying to go through java:comp/env.
> Properties p = new Properties();
>
> // ... set contents of jndi.properties into p
> InitialContext ic = new InitialContext(p);
> Converter converter = (Converter)
> ic.lookup(Converter.class.getName());
>>
>> --ken
>>
>>
>>> <jndi-link>
>>>
>>> <jndi-name>java:comp/env/ejb</jndi-name>
>>>
>>>
>>> <factory>com.sun.enterprise.naming.SerialInitContextFactory</factory>
>>>
>>> <init-param org.omg.CORBA.ORBInitialHost="localhost"/>
>>>
>>> <init-param org.omg.CORBA.ORBInitialPort="3700"/>
>>>
>>> <init-param
>>> java.naming.factory.url.pkgs="com.sun.enterprise.naming"/>
>>>
>>> <init-param
>>> java.naming.factory.state="com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl"/>
>>>
>>>
>>> </jndi-link>
>>>
>>> But I get the same exception when making:
>>>
>>> Context ic = (Context)new
>>> InitialContext().lookup("java:comp/env/ejb");
>>>
>>> Object object =
>>> ic.lookup(Converter.class.getName());
>>>
>>>
>>> Exception is:
>>>
>>>
>>> java.lang.NullPointerException
>>>
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>
>>>
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>
>>>
>>> at java.lang.reflect.Method.invoke(Method.java:585)
>>>
>>> at
>>> com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:305)
>>>
>>> at
>>> com.sun.ejb.containers.RemoteBusinessObjectFactory.getObjectInstance(RemoteBusinessObjectFactory.java:61)
>>>
>>>
>>> at
>>> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
>>>
>>> at
>>> com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:314)
>>>
>>> at _jsp._test__jsp._jspService(test.jsp:30)
>>>
>>> at com.caucho.jsp.JavaPage.service(JavaPage.java:60)
>>>
>>> at com.caucho.jsp.Page.pageservice(Page.java:570)
>>>
>>> at
>>> com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:175)
>>>
>>>
>>> at
>>> com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:178)
>>>
>>>
>>> at
>>> com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
>>>
>>>
>>> at
>>> com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:268)
>>>
>>> at
>>> com.caucho.server.port.TcpConnection.run(TcpConnection.java:389)
>>>
>>> at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:507)
>>>
>>> at com.caucho.util.ThreadPool.run(ThreadPool.java:433)
>>>
>>> at java.lang.Thread.run(Thread.java:595)
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ejb-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: ejb-help_at_glassfish.dev.java.net
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ejb-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: ejb-help_at_glassfish.dev.java.net
--
С уважением,
AKostylev mailto:akostylev_at_ipian.kazan.ru