File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get application ear file name using Java code for JNDI lookup

 
Chandrasekaran Pethan
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have migrated an EAR application from Jboss 3 to JBoss 7. For JNDI lookups I am using the following syntax in JBoss AS 7.1 (as referred in https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI)

ejb:<app-name>/<module-name>/<distinct-name>/<bean-name>!<fully-qualified-classname-of-the-remote-interface>
where ->
app-name : This is the name of the .ear (without the .ear suffix)
module-name : This is the name of the .jar (without the .jar suffix)
distinct-name : This is a JBoss AS7 specific name which can be optionally assigned to the deployments that are deployed on the server
bean-name : This is the name of the bean for which you are doing the lookup
fully-qualified-classname-of-the-remote-interface : This is the fully qualified class name of the interface for which you are doing the lookup.

As of now I am hardcoding the app-name,module-name etc while doing JNDI lookup but I need to get in at runtime in case if I wish to override the ear name(deployment file placed at JBoss/deployment folder) using Command Line Interface

How to use javax.naming.InitialContext or ServeltContext or javax.naming.Context, I tried placing some property file and using these context files but I couldn't retrieve the application ear file name

Please advice.

Thanks in Advance.

 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be better to ask this in the JBoss forum, moving...
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The remote client application needs to know the exact JNDI name. Of course, the application can use some kind of properties to be passed into the application to know the app name, module name etc... but that's up to the application and even in that case, the person who is triggering the application will have to know the app name, module name etc.. to be fed to the JNDI name.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic