geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevan Miller <kevan.mil...@gmail.com>
Subject Re: How to specify JNDI names?
Date Mon, 08 Oct 2007 16:53:21 GMT

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


Mime
View raw message