geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacek Laskowski" <ja...@laskowski.net.pl>
Subject Re: Geronimo & JUnit problems
Date Thu, 12 Jul 2007 12:14:57 GMT
On 7/12/07, Francisco Borges <francisco@x-hive.com> wrote:

> Glad you sent this link ;-)

You're welcome.

> I'll submit the issue there. (and I know of at least another couple of
> other bugs :-/)

Go Francisco go! The more the better. It's not that you report issues
and they'll get fixed in the coming version, but some surely will ;-)

> Geronimo1.2 will *fail* if:
>
> 1. From an application (outside Geronimo) trying to connect to a EJB in
> the server;
> 2. I try to get the InitialContext without explicitly passing the System
> properties:
>
> jndiCntx = new InitialContext();
>
> [java] javax.naming.AuthenticationException: Cannot read the response from
> the server (OEJP/2.0) : null; nested exception is:
>      [java]     java.io.EOFException
>      [java]     at
> org.apache.openejb.client.JNDIContext.authenticate(JNDIContext.java:178)
>      [java]     at
> org.apache.openejb.client.JNDIContext.getInitialContext(JNDIContext.java:163)
>      [java]     at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
>      [java]     at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
>      [java]     at
> javax.naming.InitialContext.init(InitialContext.java:223)
>      [java]     at
> javax.naming.InitialContext.<init>(InitialContext.java:175)
>
> If I use:
>
>  InitialContext jndiCntx = new InitialContext(System.getProperties());
>
> The code behaves as expected. I don't know for sure if this is Geronimo's
> fault or OpenEjb but it certainly happens, and is perfectly reproducible.

I can't reproduce it in Geronimo 2. I'm running the sample with

-Djava.naming.factory.initial=org.apache.openejb.client.RemoteInitialContextFactory
 -Djava.naming.provider.url=127.0.0.1:4201

and the following snippet

        System.out.println("JNDI command line properties: ");
        System.out.println("\t" + Context.INITIAL_CONTEXT_FACTORY + "="
                + System.getProperty(Context.INITIAL_CONTEXT_FACTORY));
        System.out.println("\t" + Context.PROVIDER_URL + "=" +
System.getProperty(Context.PROVIDER_URL));
        Context initialCtx = new InitialContext();
        Object mejbObj =
initialCtx.lookup("MEJBGBean/MEJB/javax.management.j2ee.Management");
        ManagementHome mejbHome = (ManagementHome) mejbObj;
        Management mejb = mejbHome.create();
        System.out.println("...checking status of MEJBGBean - MBean
count=" + mejb.getMBeanCount());

works fine.

JNDI command line properties:
	java.naming.factory.initial=org.apache.openejb.client.RemoteInitialContextFactory
	java.naming.provider.url=127.0.0.1:4201
...checking status of MEJBGBean - MBean count=608

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Mime
View raw message