Originally posted by vu lee:
You'll need to collect more data to detect what the issue is, where it occurs, and under what condition it occurs. The two previous posts suggested to put a try-cach block and disable friendly message.
1. put a try -- catch(Throwable t) around the block where you invoke the save method.
try{
...
...
savedOK = _UWDataSource.savePolicyHolderMotor(phMotor);
...
...
}catch(Throwable t){
//collect data.
}
2. You could collect more data by writing a test program using HttpConnection to invoke the servlet and print client side error msg.
3. Write a POJO test to detect whether savePolicyHolderMotor() alone does not cause any issues. In this test, just repeatedly calls savePolicyHolderMotor() a few times.
Once you have collected all the data, post them so people could eyeball to see what happened.
Originally posted by William Brogden:
from a browser sounds like one of those accursed "friendly" error messages that is concealing the real cause. In MS Internet Exploder you can turn off "friendly" error messages from the internet options dialog.
Bill
Originally posted by Rahul Bhattacharjee:
To my best of knowledge server designs are failsafe.Due to some exception in the servlet you might get a 503 error , but its very unlikely that the complete server would crash.
If you are confident about the statement that is causing the problem , then I would suggest you to keep the statement within a try and catch (Throwable t) and then do a t.printStackTrace() , so that you will have an idea about what is happening , when it crashes.
Originally posted by Paul Clapham:
A web application with servlets and JSPs? Then if at all possible, configure a connection pool in your application server (Tomcat, Weblogic, whatever it is). They all support that as far as I know. Then just use JNDI to get a connection from the pool. You shouldn't be writing that sort of logic yourself unless there's a good reason that you can't use the server's connection pool.
Originally posted by Bear Bibeault:
As a general design principle, you should never create a singleton class unless you can write a 7-page dissertation justifying its existence.
Originally posted by Jesper Young:
How are you running the jar? By using java -jar myjarfile.jar?
When you run a JAR file like that, the CLASSPATH environment variable or the "-classpath" (or "-cp") parameters are not used. The classpath comes from the manifest file in the JAR instead. So it doesn't work to set the CLASSPATH environment variable to "C:\whatever" if you run your JAR with the "-jar" option.
Originally posted by Chengwei Lee:
Try putting the properties file into your JAR.