geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zakharov, Vasily M" <>
Subject RE: How to specify JNDI names?
Date Tue, 09 Oct 2007 17:10:52 GMT

Thanks for your help! Your solution worked.

However, in my case the proper JNDI name for the bean turned out to be
as follows:
and I had to patch the source code of the 3rd party application (good I
had the sources)
to make it working. 

It makes me hope the naming scheme is somehow simplified in G2.0.2. :)

Thanks again!


-----Original Message-----
From: Kevan Miller [] 
Sent: Monday, October 08, 2007 8:53 PM
Subject: Re: How to specify JNDI names?

On Oct 8, 2007, at 10:59 AM, Zakharov, Vasily M wrote:

> Hi, all,
> I have an application (SPECjAppServer2004) containing session EJBs  
> that
> need to be accessed from outside. When I run the client, it reports:
> javax.naming.NameNotFoundException: /OrderAuditSes does not exist  
> in the
> system.  Check that the app was successfully deployed.
>         at
> org.apache.openejb.client.JNDIContext.lookup(
>         at javax.naming.InitialContext.lookup(
>         at ...
> What is the expected format of specifying the JNDI names in G2.0.1?  
> What
> may I be doing wrong?
> I've tried different variations, but never succeeded. JNDI Viewer in
> Console shows the necessary EJBs in the tree, without any prefix.
> Thank you!
> The client is launched like this:
> java -cp ...
> - 
> Djava.naming.factory.initial=org.apache.openejb.client.RemoteInitialCo

> n
> textFactory -Djava.naming.provider.url=rmi://localhost:4201 Client
> The Client code is like this:
> new InitialContext().lookup("OrderAuditSes");
> The application deployment plan can be found here:
> app.x
> ml

The best way that I know how to get the JNDI name is from having it  
logged during deployment. JNDI name for an EJB will be logged if you  
turn on INFO logging in 2.0.1. This is configured by default in the  
soon to be 2.0.2. For 2.0.1 edit your file  
and change your log4j.rootLogger and log4j.appender.FILE.Threshold to  
the following:

log4j.rootLogger=INFO, CONSOLE, FILE

You should see log entries of the following form:

11:47:42,435 INFO  [startup] Assembling app: /geronimo-jetty6- 
11:47:42,796 INFO  [startup] Jndi(name=GeneralEJB.jar/My/ejbs.My)
11:47:42,796 INFO  [startup] Created Ejb(deployment-id=GeneralEJB.jar/ 
My, ejb-name=My, container=Default Stateless Container)

The JNDI naming scheme is changing in 2.0.2 (the change is a bit  
unfortunate, but the naming scheme is more straightforward...). By  
default: {EjbName}{AnnotationType}

You can find JNDI naming documentation for 2.0.2 here -- http:// Supposedly this doc  
got moved to a better location, but I don't see it... Perhaps Hernan  
or David B can point us to it...

For 2.0.2 the log will contain entries of the following form:

12:21:04,363 INFO  [startup] Assembling app: /Users/kevan/geronimo/ 
12:21:04,762 INFO  [startup] Jndi(name=MyRemoteHome) --> Ejb 
12:21:04,762 INFO  [startup] Created Ejb(deployment-id=GeneralEJB.jar/ 
My, ejb-name=My, container=Default Stateless Container)
12:21:04,763 INFO  [startup] Deployed Application(path=/Users/kevan/ 

Closed Joint Stock Company Intel A/O
Registered legal address: 125252, Moscow, Russian Federation, 
Chapayevsky Per, 14.

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

View raw message