DBPC problem in Tomcat 5

Wouter Technology

I am making changes to the linkdropper module. It is making use of a JNDI datasource now. I encountered some problems when setting up DBCP in Tomcat 5.0.19. I had added the JNDI datasource to $CATALINA_HOME/conf/Catalina/www.wouter.net/ROOT.xml. I got this error:
Cannot create JDBC driver of class ” for connect URL ‘null’.
The JNDI datasource was setup correct and I didn’t have a clue what was wrong, so I started searching the web.
In This mailing list post I’ve read that the files under $CATALINA_HOME/conf/Catalina/localhost need to have the same name as the webapp. Someone else in the same thread advised defining the context in server.xml. So, I tried that and it worked!

Now on my home pc the context is defined in $CATALINA_HOME/conf/Catalina/localhost/wn.xml and it works fine. Here the filename and context are the same.
So, apparently the JNDI datasource doesn’t work when the context.xml file doesn’t have the
same name as the context.
Did anyone experience this too? Or could the problem be caused by another factor?