geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hari Krishna Korrapati" <harikrishna.korrap...@gmail.com>
Subject Re: Error while getting InitialContext
Date Fri, 16 Feb 2007 10:29:13 GMT
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 <david_jencks@yahoo.com> 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

Mime
View raw message