Home Development Blog JNDI works!
JNDI works! PDF Print E-mail
User Rating: / 0
Tuesday, 19 October 2010 09:15

After an email from mochahost, asking me to try it again, I had another go on my jsp testpage to access the connection pool.   This threw up a couple of NoSuchMethodExceptions, but we know how to deal with them - it turns out that tomcat 5.5.x only supports jstl 1.1 but only tomcat 6.0.x supports jstl1.2.   I have both locally, but I have been testing with 6.0.26 mostly.   Changed the jar files (the eclipse embedded server had also required the 1.1 versions...) and off we go.

The jsp test page worked fine and, copying over the hibernate.cfg.xml for jndi, the main website works fine too and even seems to be a bit faster - though I probably need to do some proper comparison testing to say for sure.   And I probably won't.

One advantage of the jsp test page (apart from its' simplicity) is that the java exceptions are reported directly in the html output of the error message.   I will have to remember this technique when faced with server setup problems in the future.

Now I also need to go in and change my log4j.properties to turn most of the logging back off again.

I have asked mochahost what the problem was, and, should they tell me, then I will update this blog to include it.

Incidentally, this is a good example of how to use external support - until the problem is reduced to an absolute bare minimum of behaviour necessary to reproduce the problem, then third parties will almost always tell you to go and look in your own code for the problem.   Since I usually sit on the other side of this particular relationship, I can appreciate therir position.   Usually my customers have a bit more political clout than I did in this case and the onus of proving/disproving the problem usually falls on me.   The basic technique of reduction until the problem is either obvious or goes away is the same in both cases though.

One other tip;  jar files can be opened with WinRar (or other archive programs) - very useful when you are trying to track down what jar might contain a particular missing class.

And I am going to write two small jsp pages, one to display the last 200 entries of the log database and one to clear the log DB.   I will probably put these in a password protected part of the website to stop just anyone accessing them.

Copyright © 2023 Crypto League. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.