Marc O'Ceallaigh

Greenhorn
+ Follow
since Feb 15, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Marc O'Ceallaigh

Was that right? If so, then the conn variable is null. And you can see that it is set just two lines earlier, to the value returned by getConnection(). So that value must be null also. How can getConnection() return null? Shouldn't this lineset it to a non-null value? Well, not if it throws an exception. So that's what's happening. That line of code throws an exception -- which you just print to a log file and ignore -- and then you run into trouble later when you ignore the possibility that there was no connection.[/qb]<hr></blockquote>

That sounds correct. But how can this code work on one machine and not another?? Thanks anyway thats been very helpful.
[ February 23, 2006: Message edited by: Marc O'Ceallaigh ]

Originally posted by Sri Ram:
Hey if any Exceptions are thrown please post it.Its easy to find the exceptions. Also Check if the connections to the database are properly established.

[ February 15, 2006: Message edited by: Sri Ram ]



exception

javax.servlet.ServletException
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.lang.NullPointerException
struts.UserDBUtil.insertCustomer(UserDBUtil.java:60)
struts.RegisterCustomerAction.execute(RegisterCustomerAction.java:77)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

this is the exception that is thrown. Any help with this would be great thanks

----------------------------------------------------------------------------
Above is my action class the exception occurs in this class on the line where the insertClient method is called.
Could you possibly tell me where to check the relevant configurations to this situation please??? Thanks

[edited to add code tags]
[ February 16, 2006: Message edited by: Jeanne Boyarsky ]
Hello All,
I am currently doing a Java struts project in college. THe project uses microsoft access. Everything works fine on the machine i use in college but when i try to run my project on my laptop it will not work. The main problem occurs when i try to register a customer to my access database. Why i do this i get a javax.servlet.ServletException whos root cause is a java.lang.NullPointerException on the prepared statement in my method for adding a customer to my database. I have tested this methos using literals and it adds these to the database without any problems but when i try and add from the JSP the above problem occurs. Any help on this would be great as i have tried all i can think of.Thanks in advance