EJB external lookup question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

EJB external lookup question

Zakharov, Vasily M
Hi, all,

I'm having a problem with OpenEJB in Geronimo, and it looks like the
Geronimo guys can't answer.

How should I configure JNDI for an application (running on a JVM other
than Geronimo), for its InitialContext to be able to locate EJBs
deployed in Geronimo by their <ejb-name> names?

For now I use the following:

-Djava.naming.factory.initial=org.openejb.client.RemoteInitialContextFac
tory
-Djava.naming.provider.url=geronimo.host:4201

and when I call "new InitialContext()", at that line I get the following
exception:

javax.naming.AuthenticationException: Cannot read the response from the
server (OEJP/2.0) : null;
        nested exception is: java.io.EOFException
        at
org.openejb.client.JNDIContext.authenticate(JNDIContext.java:196)
        at
org.openejb.client.JNDIContext.getInitialContext(JNDIContext.java:181)
        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 <my application>

Could anybody please tell me what I may be doing wrong?

This question is important for SPECjAppServer2004 enabling on Geronimo.

Thank you very much!

Vasily Zakharov
Intel Middleware Products Division
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: EJB external lookup question

David Jencks
The RemoteTestServer class in itests manages to connect :-)  using

     public void init(Properties props) {
         properties = props;

         props.put("test.server.class",  
"org.openejb.test.RemoteTestServer");
         props.put("java.naming.factory.initial",  
"org.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'm not quite sure where the testuser and testpassword comes from,  
but I'm pretty sure you need these properties as well.

thanks
david jencks

On May 10, 2006, at 1:39 PM, Zakharov, Vasily M wrote:

> Hi, all,
>
> I'm having a problem with OpenEJB in Geronimo, and it looks like the
> Geronimo guys can't answer.
>
> How should I configure JNDI for an application (running on a JVM other
> than Geronimo), for its InitialContext to be able to locate EJBs
> deployed in Geronimo by their <ejb-name> names?
>
> For now I use the following:
>
> -
> Djava.naming.factory.initial=org.openejb.client.RemoteInitialContextFa
> c
> tory
> -Djava.naming.provider.url=geronimo.host:4201
>
> and when I call "new InitialContext()", at that line I get the  
> following
> exception:
>
> javax.naming.AuthenticationException: Cannot read the response from  
> the
> server (OEJP/2.0) : null;
> nested exception is: java.io.EOFException
> at
> org.openejb.client.JNDIContext.authenticate(JNDIContext.java:196)
> at
> org.openejb.client.JNDIContext.getInitialContext(JNDIContext.java:181)
> 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 <my application>
>
> Could anybody please tell me what I may be doing wrong?
>
> This question is important for SPECjAppServer2004 enabling on  
> Geronimo.
>
> Thank you very much!
>
> Vasily Zakharov
> Intel Middleware Products Division

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: EJB external lookup question

Jacek Laskowski
On 5/11/06, David Jencks <[hidden email]> wrote:

>          props.put("java.naming.security.principal", "testuser");
>          props.put("java.naming.security.credentials", "testpassword");
...
> I'm not quite sure where the testuser and testpassword comes from,
> but I'm pretty sure you need these properties as well.

These values are unimportant, but the properties themselves are not.
Although their values don't have any value (an oxymoron?) to OpenEJB,
they must be specified or you'll get the CredentialsIncorrectException
or so.

I'll be glad if you could test it out with some random credentials to
verify it. Would you?

> david jencks

Jacek

--
Jacek Laskowski
http://www.laskowski.net.pl
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: EJB external lookup question

Zakharov, Vasily M
In reply to this post by Zakharov, Vasily M
David, Jacek,

Thank you very much for this information, it was very helpful.

I investigated this issue a bit, here're the results.

In fact, the only property that must be specified is
java.naming.security.principal, and it can have arbitrary value, it can
even be empty - it works anyway.

If this property is absent, the following exception occurs:

javax.naming.AuthenticationException: Cannot read the response from the
server (OEJP/2.0) : null;
        nested exception is: java.io.EOFException
        at
org.openejb.client.JNDIContext.authenticate(JNDIContext.java:196)
        at
org.openejb.client.JNDIContext.getInitialContext(JNDIContext.java:181)
        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 <your application>

Important is this property should be specified through the
InitialContext environment or through the jndi.properties file in the
classpath, it can't be set through the -D command line option.

java.naming.security.credentials property can be omitted.

That's it.

Vasily Zakharov
Intel Middleware Products Division


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jacek
Laskowski
Sent: Thursday, May 11, 2006 10:06 AM
To: [hidden email]
Subject: Re: [openejb-dev] EJB external lookup question

On 5/11/06, David Jencks <[hidden email]> wrote:

>          props.put("java.naming.security.principal", "testuser");
>          props.put("java.naming.security.credentials",
"testpassword");
...
> I'm not quite sure where the testuser and testpassword comes from,
> but I'm pretty sure you need these properties as well.

These values are unimportant, but the properties themselves are not.
Although their values don't have any value (an oxymoron?) to OpenEJB,
they must be specified or you'll get the CredentialsIncorrectException
or so.

I'll be glad if you could test it out with some random credentials to
verify it. Would you?

> david jencks

Jacek

--
Jacek Laskowski
http://www.laskowski.net.pl
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: EJB external lookup question

dblevins
Administrator

On May 11, 2006, at 11:12 AM, Zakharov, Vasily M wrote:

> David, Jacek,
>
> Thank you very much for this information, it was very helpful.
>
> I investigated this issue a bit, here're the results.
>
> In fact, the only property that must be specified is
> java.naming.security.principal, and it can have arbitrary value, it  
> can
> even be empty - it works anyway.
>
> If this property is absent, the following exception occurs:

I've found it and fixed it.  It will be available in next week's  
unstable build:
http://opensource.atlassian.com/confluence/oss/display/GERONIMO/Latest 
+Unstable

Also, a new openejb-core jar should be available in a couple hours.

Otherwise you can checkout from source and skip the wait.

Let us know how it goes.

-David

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: EJB external lookup question

Zakharov, Vasily M
In reply to this post by Zakharov, Vasily M
David,

Thank you very much!

Do you mean that from now on the java.naming.security.principal is not
mandatory and can be absent at all?

And this change will make it to Geronimo 1.1?

Vasily

-----Original Message-----
From: David Blevins [mailto:[hidden email]]
Sent: Friday, May 12, 2006 6:07 AM
To: [hidden email]
Subject: Re: [openejb-dev] EJB external lookup question

On May 11, 2006, at 11:12 AM, Zakharov, Vasily M wrote:

> David, Jacek,
>
> Thank you very much for this information, it was very helpful.
>
> I investigated this issue a bit, here're the results.
>
> In fact, the only property that must be specified is
> java.naming.security.principal, and it can have arbitrary value, it  
> can
> even be empty - it works anyway.
>
> If this property is absent, the following exception occurs:

I've found it and fixed it.  It will be available in next week's  
unstable build:
http://opensource.atlassian.com/confluence/oss/display/GERONIMO/Latest 
+Unstable

Also, a new openejb-core jar should be available in a couple hours.

Otherwise you can checkout from source and skip the wait.

Let us know how it goes.

-David
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: EJB external lookup question

dblevins
Administrator

On May 12, 2006, at 3:58 AM, Zakharov, Vasily M wrote:

> David,
>
> Thank you very much!
>
> Do you mean that from now on the java.naming.security.principal is not
> mandatory and can be absent at all?

Right.  You won't be required to supply even an empty string ("") and  
we will be able to handle it when you do.  Previously we removed the  
requirement to have the security settings present, but obviously  
never tested it that way.  It was blowing up inside the server.

> And this change will make it to Geronimo 1.1?

Correct!

Thanks,
David


> Vasily
>
> -----Original Message-----
> From: David Blevins [mailto:[hidden email]]
> Sent: Friday, May 12, 2006 6:07 AM
> To: [hidden email]
> Subject: Re: [openejb-dev] EJB external lookup question
>
> On May 11, 2006, at 11:12 AM, Zakharov, Vasily M wrote:
>
>> David, Jacek,
>>
>> Thank you very much for this information, it was very helpful.
>>
>> I investigated this issue a bit, here're the results.
>>
>> In fact, the only property that must be specified is
>> java.naming.security.principal, and it can have arbitrary value, it
>> can
>> even be empty - it works anyway.
>>
>> If this property is absent, the following exception occurs:
>
> I've found it and fixed it.  It will be available in next week's
> unstable build:
> http://opensource.atlassian.com/confluence/oss/display/GERONIMO/Latest
> +Unstable
>
> Also, a new openejb-core jar should be available in a couple hours.
>
> Otherwise you can checkout from source and skip the wait.
>
> Let us know how it goes.
>
> -David
>

Loading...