geronimo-user mailing list archives

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

Thanks for your help! Your solution worked.

However, in my case the proper JNDI name for the bean turned out to be
as follows:
"orders.jar/OrderAuditSes/org.spec.jappserver.orders.orderauditses.ejb.O
rderAuditSes"
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!

Vasily


-----Original Message-----
From: Kevan Miller [mailto:kevan.miller@gmail.com] 
Sent: Monday, October 08, 2007 8:53 PM
To: user@geronimo.apache.org
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(JNDIContext.java:237)
>         at javax.naming.InitialContext.lookup(InitialContext.java:351)
>         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:
> http://cwiki.apache.org/confluence/download/attachments/64828/sjas- 
> app.x
> ml

Vasily,
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 server.log4j.properties file  
and change your log4j.rootLogger and log4j.appender.FILE.Threshold to  
the following:

log4j.rootLogger=INFO, CONSOLE, FILE
log4j.appender.FILE.Threshold=INFO

You should see log entries of the following form:

11:47:42,435 INFO  [startup] Assembling app: /geronimo-jetty6- 
jee5-2.0.1/var/temp/geronimo-deploymentUtil32038.jar
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:// 
cwiki.apache.org/GMOxDev/client-jndi-names.html 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/ 
server/branches/2.0.2/target/geronimo-jetty6-jee5-2.0.2-SNAPSHOT/var/ 
temp/geronimo-deploymentUtil64534.jar
12:21:04,762 INFO  [startup] Jndi(name=MyRemoteHome) --> Ejb 
(deployment-id=GeneralEJB.jar/My)
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/ 
geronimo/server/branches/2.0.2/target/geronimo-jetty6-jee5-2.0.2- 
SNAPSHOT/var/temp/geronimo-deploymentUtil64534.jar)

--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.

Mime
View raw message