aspose file tools*
The moose likes JBoss/WildFly and the fly likes java:comp/env issue in JBOSS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "java:comp/env issue in JBOSS" Watch "java:comp/env issue in JBOSS" New topic
Author

java:comp/env issue in JBOSS

Girish Vasmatkar
Ranch Hand

Joined: Apr 24, 2008
Posts: 199
Howdy guys,

This is the problem I am facing because I just tried to migrate to JBOSS. My problem, as I mentioned is related to accessing the data source in my web application deployed in JBOSS.


There are other application servers that allow to access the data source (JNDI) using java:comp/env. But when I try to use JBOSS without making change in the code, I get errors related to name not found and so.

I read somewhere that JBOSS does not use java:comp/env, instead you must access data source using java: namespace. Is this notion correct?


I have one more doubt, is this Global JNDI namespace concept specific to JBOSS? The reason I am asking this is because JBOSS allows only those data sources to be accessed from remote client which are in the global JNDI namespace, and not the ones which are under java: namespace. The other app. servers like Glassfish do allow data sources to be looked up with their name(remotely, from different JVM) and at the same time allow those data sources to be accessed using java:comp/env/<jndi-name> in a web application deployed in the server.



Please help me understand the concept better!!!



Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9327
    
109

Girish Vasmatkar wrote:


There are other application servers that allow to access the data source (JNDI) using java:comp/env. But when I try to use JBOSS without making change in the code, I get errors related to name not found and so.

I read somewhere that JBOSS does not use java:comp/env, instead you must access data source using java: namespace. Is this notion correct?




For the datasource (or any other resource) to be available in the application component's java:comp/env namespace, you have to configure the application. See this for the details.


I have one more doubt, is this Global JNDI namespace concept specific to JBOSS? The reason I am asking this is because JBOSS allows only those data sources to be accessed from remote client which are in the global JNDI namespace, and not the ones which are under java: namespace. The other app. servers like Glassfish do allow data sources to be looked up with their name(remotely, from different JVM)


From what i know, all application servers have namespaces within the JNDI tree. They might term the namespace differently. Not allowing the datasource to be accessed by a remote JVM (by default) is specific to JBoss.


[My Blog] [JavaRanch Journal]
Girish Vasmatkar
Ranch Hand

Joined: Apr 24, 2008
Posts: 199
Thanks for the reply

From ferwhat i know, all application servers have namespaces within the JNDI tree. They might term the namespace differently. Not allowing the datasource to be accessed by a remote JVM (by default) is specific to JBoss.



Here is what I infer from your statemet.Please correct me if I am wrong.

1. That means, whenever we create a jndi source using admin console of an app server, that datasource does get stored under the global JNDI namespace, and it is the Glassfish's functionality that the source is available to a web app running in glassfish under java:comp/env.

2. EE specification has got nothing to specify as far as managing the internal JNDI of an application server is concerned.
Kamal Agrawal
Greenhorn

Joined: May 25, 2007
Posts: 14
Hi All,

I tried to do a lot of permutation and combination so that my JNDI will be initialized with Java:comp/env/XXX but I am not able to apend comp/env in my JNDI.

Is there any configuration in any xml or any guidance to this will be highly appreciated.

I am using JBoss 5.1

Thanks,
Kamal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java:comp/env issue in JBOSS
 
Similar Threads
JNDI lookup java:comp/env/ in WSAD Test Server for P2P JMS
Possible to deploy a partially-expldoed WAR file?
regarding JNDI
Numerous questions on JNDI
MDB @PostConstruct error