Hi guys,

I am having problems with JNDI access during Tomcat startup. During tomcat
startup my app looks in JNDI for dataSource (sitting in context.xml) -
however I always receive a 'comp no bound' exception. The same app works
fine in Tomcat 6.x.

I ran some tests and found that the resource is available fine after startup
but during startup it looks like JNDI has not completely initialised yet. I
am guessing something has changed in terms of the order in which JNDI is
made available from Tomcat 6.x to Tomcat 7.

Looking through prev posts I have tried looking at the DataSourceRealm as to
how it gets the 'Server' context' -
http://svn.apache.org/viewvc/tomcat/tc7.0.x/tags/TOMCAT_7_0_0_RC1/java/org/apache/catalina/realm/DataSourceRealm.java?view=markup.
 

try {
389                 Context context = null;
390                 if (localDataSource) {
391                     context = ContextBindings.getClassLoader();
392                     context = (Context) context.lookup("comp/env");
393                 } else {
394                     context =
395                        
((StandardServer)getServer()).getGlobalNamingContext();
396                 }

But the ServerFactory has been deleted and getServer call looks like it
would be difficult to use outside of this class.

Anybody have any ideas?
-- 
View this message in context: 
http://old.nabble.com/-Tomcat-7-RC1--JNDI-Startup-Issue-tp28279732p28279732.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to