You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Augustus Gingell <a....@lede.co.uk> on 2007/10/02 19:35:13 UTC

Getting started question OpenEJB 3.0 beta 1

This may be obvious but I have been pulling my hair out.

Have unpacked beta1 and have started the server.
Have built a simple 'hello' style ejb and deployed it.
Have build a client app which tries to instance the bean.

When trying to connect to the server using InitialContext:
    Properties p = new Properties();
    p.put("java.naming.factory.initial", "org.openejb.client.RemoteInitialContextFactory");
    p.put("java.naming.provider.url", "127.0.0.1:4201");
    p.put("java.naming.security.principal", user);
    p.put("java.naming.security.credentials", password);

It throws a: 
	javax.naming.AuthenticationException: Error while communicating with server: ; nested exception is:
        java.rmi.RemoteException: Cannot open object input stream to server: ; nested exception is:
        java.net.SocketException: Connection reset 
etc. at the getInitialContext line.

In the openejb/logs/openejb.log file I get:

2007-10-02 16:43:52,674 - ERROR - "null ��/0.0" FAIL "Unexpected error - For input string: "t""
java.lang.NumberFormatException: For input string: "t"
        at java.lang.NumberFormatException.forInputString(Unknown Source)
        at java.lang.Integer.parseInt(Unknown Source)
        at java.lang.Integer.parseInt(Unknown Source)
        at org.apache.openejb.client.ProtocolMetaData.init(ProtocolMetaData.java:56)
        at org.apache.openejb.client.ProtocolMetaData.readExternal(ProtocolMetaData.java:92)
        at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:103)
        at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:84)
        at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:60)
        at org.apache.openejb.server.ServiceLogger.service(ServiceLogger.java:73)
        at org.apache.openejb.server.ServiceAccessController.service(ServiceAccessController.java:55)
        at org.apache.openejb.server.ServiceDaemon$1.run(ServiceDaemon.java:117)
        at java.lang.Thread.run(Unknown Source)

I am at a loss, I can telnet to 4202 and list the beans etc. 
It does not matter whether I deploy my bean or not, it is the connection to the port which is causing the issue, 
I have no Idea where the string "t" comes from.

Sorry if this is obvious.

Gus

-- 
Augustus Gingell BEng ACGI

Re: Getting started question OpenEJB 3.0 beta 1

Posted by David Blevins <da...@visi.com>.
On Oct 2, 2007, at 1:14 PM, Augustus Gingell wrote:

> David,
>
> Thank you for the amazingly prompt and accurate response, it was a  
> classpath issue (when isn't it!).
> I am now using  
> org.apache.openejb.client.RemoteInitialContextFactory, which
> did produce the ClassNotFoundException as you suggested.
>
> I am now looking forward to some fun with EJB3.
>
> I will try to write up an example or 2, which result from our  
> current project, if I get them working :) and
> the code is OK to release etc.

Glad we could help.  Out of curiosity which version of the openejb- 
client jar were you using? (curious on how long you've been an  
OpenEJB user :)

We'd love all the examples we can get, even if we have something  
similar.  Ideally we'd have a trove of examples people could pick  
through.

Definitely let us know if you have any other issues.  Also keep in  
mind we love feedback in general -- if you got something to work, but  
it was a little tricky, let us know!

-David


Re: Getting started question OpenEJB 3.0 beta 1

Posted by Augustus Gingell <a....@lede.co.uk>.
On Tuesday 02 October 2007 19:58, David Blevins wrote:
> Hi Augustus,
> 
> On Oct 2, 2007, at 10:35 AM, Augustus Gingell wrote:
> 
> > This may be obvious but I have been pulling my hair out.
> >
> > Have unpacked beta1 and have started the server.
> > Have built a simple 'hello' style ejb and deployed it.
> > Have build a client app which tries to instance the bean.
> >
> > When trying to connect to the server using InitialContext:
> >     Properties p = new Properties();
> >     p.put("java.naming.factory.initial",  
> > "org.openejb.client.RemoteInitialContextFactory");
> >     p.put("java.naming.provider.url", "127.0.0.1:4201");
> >     p.put("java.naming.security.principal", user);
> >     p.put("java.naming.security.credentials", password);
> >
> > It throws a:
> > 	javax.naming.AuthenticationException: Error while communicating  
> > with server: ; nested exception is:
> >         java.rmi.RemoteException: Cannot open object input stream  
> > to server: ; nested exception is:
> >         java.net.SocketException: Connection reset
> > etc. at the getInitialContext line.
> >
> > In the openejb/logs/openejb.log file I get:
> >
> > 2007-10-02 16:43:52,674 - ERROR - "null ��/0.0" FAIL "Unexpected  
> > error - For input string: "t""
> 
> Based on the "null 0.0/0.0" string, which should be the protocol  
> version, it looks like you've got an old openejb-client jar in your  
> path.
> 
> A couple things to try:
> 
>    - Use org.apache.openejb.client.RemoteInitialContextFactory as the  
> factory.  We still support usage of  
> org.openejb.client.RemoteInitialContextFactory and it is just a  
> sublcass of the apache packaged version, but it should fail with  
> ClassNotFoundException if you only have the old client in your path.
> 
>    - In your client try printing out "java.class.path" and post it.   
> Maybe with some code like:
>         System.out.println(System.getProperty("java.class.path"));
> 
> Let us know what you find.
> 
> -David
> 
> 
> 
David,

Thank you for the amazingly prompt and accurate response, it was a classpath issue (when isn't it!).
I am now using org.apache.openejb.client.RemoteInitialContextFactory, which 
did produce the ClassNotFoundException as you suggested.

I am now looking forward to some fun with EJB3.

I will try to write up an example or 2, which result from our current project, if I get them working :) and 
the code is OK to release etc.

Gus

-- 
Augustus Gingell BEng ACGI

Re: Getting started question OpenEJB 3.0 beta 1

Posted by David Blevins <da...@visi.com>.
Hi Augustus,

On Oct 2, 2007, at 10:35 AM, Augustus Gingell wrote:

> This may be obvious but I have been pulling my hair out.
>
> Have unpacked beta1 and have started the server.
> Have built a simple 'hello' style ejb and deployed it.
> Have build a client app which tries to instance the bean.
>
> When trying to connect to the server using InitialContext:
>     Properties p = new Properties();
>     p.put("java.naming.factory.initial",  
> "org.openejb.client.RemoteInitialContextFactory");
>     p.put("java.naming.provider.url", "127.0.0.1:4201");
>     p.put("java.naming.security.principal", user);
>     p.put("java.naming.security.credentials", password);
>
> It throws a:
> 	javax.naming.AuthenticationException: Error while communicating  
> with server: ; nested exception is:
>         java.rmi.RemoteException: Cannot open object input stream  
> to server: ; nested exception is:
>         java.net.SocketException: Connection reset
> etc. at the getInitialContext line.
>
> In the openejb/logs/openejb.log file I get:
>
> 2007-10-02 16:43:52,674 - ERROR - "null ��/0.0" FAIL "Unexpected  
> error - For input string: "t""

Based on the "null 0.0/0.0" string, which should be the protocol  
version, it looks like you've got an old openejb-client jar in your  
path.

A couple things to try:

   - Use org.apache.openejb.client.RemoteInitialContextFactory as the  
factory.  We still support usage of  
org.openejb.client.RemoteInitialContextFactory and it is just a  
sublcass of the apache packaged version, but it should fail with  
ClassNotFoundException if you only have the old client in your path.

   - In your client try printing out "java.class.path" and post it.   
Maybe with some code like:
        System.out.println(System.getProperty("java.class.path"));

Let us know what you find.

-David