geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jazon <reme...@gmail.com>
Subject Re: JNDI lookup fails after Geronimo restarted
Date Fri, 30 Jan 2009 21:56:35 GMT
I tried with both 2.1.3 and 2.2-SNAPSHOT, They both have this issue.
the stacktrace is like:

java.lang.RuntimeException: Invalid response from server: -1
    at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:292)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at edu.uiuc.fs.ejb.testRemote.testEjb(testRemote.java:26)
    at edu.uiuc.fs.ejb.testRemote.main(testRemote.java:35)



On Fri, Jan 30, 2009 at 3:29 PM, David Blevins <david.blevins@visi.com>wrote:

> Hi Jazon,
>
> What version of Geronimo are you using and can you post the stacktrace?
>
> -David
>
>
> On Jan 30, 2009, at 7:11 AM, Jazon wrote:
>
>  Hello,
>> I have the following test program, which runs fine to lookup a remote
>> stateless session bean.
>> But the problem is when my program is running, I restart Geronimo, the
>> JNDI lookup will always fail even after Geronimo is fully restarted.
>> I am not sure it is a problem of Geronimo or Openejb.
>> Anyone knows how to solve this or work around it?
>> Thanks
>>
>> public class testRemote {
>>
>>    public static void testEjb()throws Exception{
>>        Properties p = new Properties();
>>        p.setProperty("java.naming.factory.initial",
>> "org.apache.openejb.client.RemoteInitialContextFactory");
>>        p.setProperty("java.naming.provider.url", "ejbd://localhost:4201");
>>        p.setProperty("java.naming.security.principal", "system");
>>        p.setProperty("java.naming.security.credentials", "manager");
>>        p.setProperty("openejb.authentication.realmName",
>> "geronimo-admin");
>>        InitialContext context = new InitialContext(p);
>>
>>        MyService service = (MyService)
>> context.lookup("MyServiceImplRemote");
>>        Object o = service.getAllCustomers();
>>        System.out.println(o);
>>    }
>>
>>    public static void main(String[] args) throws Exception{
>>        while (true){
>>            try{
>>                testEjb();
>>
>>            }catch(Exception e){
>>                e.printStackTrace();
>>            }
>>            Thread.sleep(5000);
>>        }
>>    }
>>
>
>

Mime
View raw message