Stephen's Statements A little bit of everything from Stephen Duncan Jr, a Programmer/Web Geek working in the defense industry

Tuesday, July 20, 2004

Troubleshooting Stupid Problems

I hate spending a whole day trouble-shooting something, only to find that the problem was something little and dumb.

In this case, I was trying to set up an Oracle connection in Tomcat 5.0 (using the ojdbc14.jar thin Oracle JDBC driver) as a DataSource for access via JNDI. As you can guess from all that, there's plenty of places for things to go wrong. The configuration for all this is stored in an XML file. I tried all sorts of things to fix this. Capitalization of the named parameters, the driver name, the factory name, everything.

What did the problem turn out to be? A $. The password for the account I was using to connect to the database conatined a dollar sign. I got the password changed to something not using a $ sign, and everything suddenly worked.

Now, for any smart people out there: is this an XML issue? Is $ a special character? Does it need escaping? (Already faced that issue with an ampersand that needed escaping). Or is it a Tomcat specific issue? I'm pretty sure it's not an Oracle specific issue, at it seems to break the MySQL driver too, plus the connection worked fine if made straight from Java code.

Labels:

blog comments powered by Disqus