This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java:comp/env issue in JBOSS

 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic