[JBoss-user] [JNDI/Naming/Network] - Re: java:comp/env bound and unbound at the same time?

2005-11-03 Thread umjames
How were you able to successfully bind to objects on java:comp/env?  I'm 
running JBoss 4.0.0 and I can only bind datasources on java:.  However, the 
code I'm using looks up the datasource using java:comp/env.

When I look at the JNDIView MBean, it appears there's a comp subcontext under 
java:, but if you try binding the datasource to java:comp/datasource or even 
java:comp/env/datasource, the log messages on the console say that the 
datasource is successfully bound to java:comp/datasource or 
java:comp/env/datasource, but when the web-app's code tries looking it up, I 
get a NamingException saying that env is not bound, and when you look at the 
list generated by the JNDIView MBean, you don't see the bound datasource or 
even the env subcontext.

Which files do I need to configure to add a java:comp/env namespace to JBoss's 
JNDI?

I noticed a number of other people are having the same or very similar problems 
and no one replies to their posts.  Why is that?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3905259#3905259

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3905259


---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JNDI/Naming/Network] - Re: java:comp/env bound and unbound at the same time?

2005-11-03 Thread umjames
OK, I have 2 solutions to my problem.

1. Upgrade to JBoss 4.0.3.  Using that version, your servlet code can lookup a 
datasource on java:comp/env and JBoss will give the corresponding datastore 
that you have bound to java:/.  For example, if the code is using 
java:comp/env, and your web.xml's resource-ref element has testDS as its name, 
your jboss-web.xml's resource-ref can map the testDS to whatever jndi name you 
choose under the java: namespace (say java:/realDS).  Just make sure that your 
datasource's *-ds.xml file's jndi-name element is the same as it is in 
jboss-web.xml minus the java:.  So in this case, it would be /realDS.

2. Change the servlet code to lookup java:/ + the datasource name.  So if your 
web.xml's resource-ref element's name is testDS, your code needs to lookup the 
string java:/testDS.  You should then make sure your JBoss setup binds the 
datasource under the root of the java: namespace.  In other words, your 
jboss-web.xml file has a resource-ref element that maps the testDS from your 
web.xml file to the jndi name java: + whatever the jndi-name element in your 
*-ds.xml file is.  For example, if the *-ds.xml file has a jndi-name element 
with the value of /realDS, your jboss-web.xml file should have a resource-ref 
element that maps your web.xml's resource-ref's name to the jndi name of 
java:/realDS.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3905307#3905307

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3905307


---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user