users@glassfish.java.net

Portable JNDI names in EJB3.1 in an enterprise app

From: <forums_at_java.net>
Date: Wed, 1 Jun 2011 20:12:40 -0500 (CDT)

Hello,

 

I am trying to specify an application name for my Java EE 6 .ear project
using the instructions here:
http://glassfish.java.net/javaee5/ejb/EJB_FAQ.html#What_is_the_syntax_for_portable_global_

 

The problem is that the instructions are wrong. It says you can have an
app-name element inside your application.xml file, and that's not part of the
schema, so it fails to deploy if that's present. So, I noticed there was an
application-name in the schema. The problem is, that it doesn't work. The
portable JNDI name for session beans remains as the default, which is the
unqualified name of the application, minus the extension. The module-name
part for the ejb tier does work, but it is the application-name part of the
main ear that doesn't work, so I am getting portable names like the
following:
java:global/com.example.test-ear_ear_1.0.0-SNAPSHOT/test-ejb/TestBean

 

Notice that the second part of the name inside the slashes (test-ejb) is
correct, however the first part is using the entire name of the file,
including the version number.

 

Hopefully someone has an easy solution for specifying the application name
part of the portable JNDI name, using either application.xml or annotations
somewhere. I can delete application.xml if need be, since it's only there to
specify the name which isn't working anyway.

 

Regards,

Ben


--
[Message sent by forum member 'benupsavs']
View Post: http://forums.java.net/node/808442