Hello

For JNDI look to from client you need to use
org.apache.openejb.client.RemoteInitialContextFactory the class file is
available in
<geronimo_home>\repository\org\apache\openejb\openejb-core\3.0-incubating-SNAPSHOT\openejb-
core-3.0-incubating-SNAPSHO
T.jar

About env.put("java.naming.provider.url", "http://localhost:8080";);, it is
not right. For the local machine you need to use "127.0.0.0:4201" and from
remote machine "MachineIP:4201" (eg: 9.1.1.1:4201) (yu can get MachineIP
using ipconfig)

The port 4201(default) is a port where
org.apache.geronimo.openejb.EjbDaemonGBean is exposed.
When you start geronimo server you will get the port you are using :

Listening on Ports:
 1099 0.0.0.0 RMI Naming
 1527 0.0.0.0 Derby Connector
 4201 0.0.0.0 org.apache.geronimo.openejb.EjbDaemonGBean
 4242 0.0.0.0 Remote Login Listener
 8009 0.0.0.0 Tomcat Connector AJP
 8080 0.0.0.0 Tomcat Connector HTTP
 8443 0.0.0.0 Tomcat Connector HTTPS
 9999 0.0.0.0 JMX Remoting Connector
61613 0.0.0.0 ActiveMQ Transport Connector
61616 0.0.0.0 ActiveMQ Transport Connector

Thanks
Rakesh

On 2/16/07, Hari Krishna Korrapati <[EMAIL PROTECTED]> wrote:

Hi,
   You are correct that its a non-j2ee (Java Stand alone) application with
ejb's.

I have the code like

    public static InitialContext getInitialContext() throws
NamingException {
        Hashtable env = new Hashtable();
        env.put("java.naming.factory.initial", "
org.apache.geronimo.interop.client.InitialContextFactory");
        env.put("java.naming.provider.url", "http://localhost:8080";);
        return new InitialContext(env);
    }

The code is throwing error at the return statement. What i observed is,
According to the above code Hashtable env should contain
2 key-value pairs. But it is overwriting the first one. It is containing
the "java.naming.provider.url" key value pair only, at the return
statement. I just want to know why it is happening like that.

Here "http://localhost:8080"; port contains the geronimo server, where ejb
is deployed. Is that correct which we need give...

I have used InitialContextFactory instead of RemoteInitialContextFactory, which
one to use. If we need to use the RemoteInitialContextFactory, can you tell
where i can get that required jar from.



Thanks and Regards,
Hari Krishna.



On 2/16/07, David Jencks <[EMAIL PROTECTED]> wrote:
>
> What code is doing the lookup and what is it trying to find?
>
> It looks like this is a non-j2ee client application, in which case
> the only thing it can get from geronimo is ejb's.  In this case you
> probably want to use the openejb jndi implementation specified in
> jndi.properties or in code
>
>          props.put("java.naming.factory.initial",
> "org.apache.openejb.client.RemoteInitialContextFactory");
>          props.put("java.naming.provider.url ", "127.0.0.1:4201");
>          props.put("java.naming.security.principal", "testuser");
>          props.put("java.naming.security.credentials ", "testpassword");
>
> I don't think the principal or credentials are needed, and you should
> adjust the url as appropriate.
>
> Hope this helps
> david jencks
>
>
>
>
> On Feb 15, 2007, at 11:41 PM, Hari Krishna Korrapati wrote:
>
> > Hi,
> >       We are working on Geronimo1.1.1
> >      We are facing some problem while getting the InitialContext,
> > the log for the same is given below...
> >
> > org.apache.geronimo.interop.SystemException :
> > java.lang.NullPointerException
> >     at org.apache.geronimo.interop.rmi.iiop.client.UrlInfo.init
> > (UrlInfo.java:138)
> >     at
> > org.apache.geronimo.interop.rmi.iiop.client.UrlInfo.getInstance
> > (UrlInfo.java:43)
> >     at
> > org.apache.geronimo.interop.rmi.iiop.client.ClientNamingContext.init
> > (ClientNamingContext.java:307)
> >     at
> > org.apache.geronimo.interop.rmi.iiop.client.ClientNamingContext.getIns
> > tance(ClientNamingContext.java:57)
> >     at
> > org.apache.geronimo.interop.client.InitialContextFactory.getInitialCon
> > text(InitialContextFactory.java:29)
> >     at javax.naming.spi.NamingManager.getInitialContext (Unknown
> > Source)
> >     at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
> >     at javax.naming.InitialContext.init(Unknown Source)
> >     at javax.naming.InitialContext.<init>(Unknown Source)
> >     at packagename.Sample.getInitialContext(RunEDSService.java:391)
> >     at packagename.Sample.init(RunEDSService.java:382)
> >     at packagename.Sample.main(RunEDSService.java:201)
> > Caused by: java.lang.NullPointerException
> >     at
> > com.trend.iwss.jscan.appscan.runtime.PolicyRuntime.getB64StrProp
> > (PolicyRuntime.java:188)
> >     at com.trend.iwss.jscan.appscan.runtime.PolicyRuntime.<init>
> > (PolicyRuntime.java:91)
> >     at
> > com.trend.iwss.jscan.appscan.runtime.NetworkPolicyRuntime.<init>
> > (NetworkPolicyRuntime.java:85)
> >     at com.trend.iwss.jscan.appscan.runtime.NetworkPolicyRuntime
> > $Factory.make(NetworkPolicyRuntime.java:439)
> >     at
> > com.trend.iwss.jscan.appscan.runtime.PolicyRuntime.accessInstance
> > (PolicyRuntime.java:225)
> >     at com.trend.iwss.jscan.appscan.runtime.PolicyRuntime.preFilter
> > (PolicyRuntime.java:127)
> >     at
> > com.trend.iwss.jscan.appscan.runtime.NetworkPolicyRuntime.preFilter
> > (NetworkPolicyRuntime.java:108)
> >     at org.apache.geronimo.interop.rmi.iiop.client.UrlInfo.init
> > (UrlInfo.java:98)
> >     ... 11 more
> >
> >
> > Can anybody guess where the error could have been occured.
> >
> >
> > Thanks and Regards,
> > Hari
>
>


--
Regards,
Hari

Reply via email to