geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Collins <>
Subject RE: JNDI in Geronimo 2
Date Tue, 10 Mar 2009 16:07:49 GMT
Thank you Wang and Tang.  Here are the things that I have done.

*         Changed the JDK to version 1.5.0_6

*         Updated all of my classes to use this version of Java

*         Changed the provider url to ejbd://localhost:4201

I get the error

java.lang.RuntimeException: Invalid response from server: -1

From: Ying Tang []
Sent: Tuesday, March 10, 2009 3:23 AM
Subject: Re: JNDI in Geronimo 2

Yes,  should be ejbd://localhost:4201. The same as the example in the doc<>.
2009/3/10 Rex Wang <<>>
Tang, I believe Russell use a remote client, but not a application client.

to Russell, try "ejbd://localhost:4201"

2009/3/10 Ying Tang <<>>

Hi Russell,

I suggest you use JDK 1.5 instead of 1.6. It is also recommended that Eclipse and Geronimo
use the same Java environment.

Please let me know if there is still any problem.

Best Regards,

Ying Tang

2009/3/10 Russell Collins <<>>

Thank you Tang.  This should be real strait forward but there has got to be some reason why
this is not working.  Here is the configuration that I have.  This may help in solving this

Eclipse Ganymede

Java 1.6..0_11

Geronimo 2.1.2

Geronimo 2.1.3 (tried it on both)

There are a couple of other things that I tried that gave me different results.

1.    Added a runtime dependency to the Geronimo Runtime.  This gave me a different error.
 It was a java runtime error that said that the response from the server is: -1

2.    Created a client j2ee application to run my app.

Basically, I am following everything in that link that you sent me.  I am just getting these
errors when trying to look up the object.  Any more insight would be greatly appreciated.

From: Ying Tang [<>]
Sent: Monday, March 09, 2009 11:21 PM
Subject: Re: JNDI in Geronimo 2

Hi Error! Filename not specified.Russell,

I tried your example on Geronimo 2.1.4.

1. I renamed the implementation class  as FirstObjectBean.  A bit different from your code:


public class FirstObjectBean implements FirstObjectRemote { import

   public String hello(String name){

                  return "Hello " + name;



2.  In the application client that referece the EJB, I used
import ejb.FirstObjectRemote;
FirstObjectRemote firstObject = (FirstObjectRemote)context.lookup("FirstObjectBeanRemote");
3. Add the EJB project to the build path of the application client project.
4. Add the two projects to the Geronimo server, and run the application client.

The application works well and the "Hello Russel" message shows up.

For more detailed information, please refer to:

Hope this helps.

Best Regards,

Ying Tang  (Sophia)

2009/3/9 Russell Collins <<>>

Hello.  I am new to the list, new to EJB 3.0 and new to Geronimo 2.  I am pretty sure I understand
all of the concepts but I am having an issue with a JNDI lookup in Geronimo.  I have created
a Bean and it looks as follows.



public interface FirstObjectRemote {

      public String hello(String name);




public class FirstObject implements FirstObjectRemote {

   public FirstObject() {



   public String hello(String name){

                  return "Hello " + name;



Everything deploys just fine (at lease I think it does).  I created a test class:

public class TheClass


public static void main(String[] args)


            Properties prop=new Properties();

            prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");

            prop.put(Context.PROVIDER_URL, "ejbd://localhost:1099");


                  Context context = new InitialContext(prop);

                  FirstObjectRemote firstObject = (FirstObjectRemote)context.lookup("FirstObjectRemote");



            catch(Exception ex){





I get an error I when trying to run this.  The error that comes back is:

javax.naming.NamingException: Cannot lookup '/FirstObjectRemote'. [Root exception is java.rmi.RemoteException:
Error while communicating with server: ; nested exception is:

      java.lang.NoClassDefFoundError: javax/transaction/RollbackException]

What am I missing?

View raw message