| Author |
Add items to database using Servlet
|
Brooke Maddox
Ranch Hand
Joined: Nov 23, 2012
Posts: 42
|
|
I have a form to add some items on a JSP page whose action is to a servlet which should take the parameters and add them to a database. When I run the code I get an Error: null.
Any help would be greatly appreciated.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
This form of logging doesn't give you much information to work with. You have a better form elsewhere in the code you posted, use that here as well:
This will give you a stack trace which tells you exactly which line of code threw the exception, and what the exception is.
|
 |
Brooke Maddox
Ranch Hand
Joined: Nov 23, 2012
Posts: 42
|
|
Okay so I changed it to
When I hit submit on my form I now get a blank screen.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
Then the next step is to look in your server logs to find if there are any stack traces for you to look at.
|
 |
Brooke Maddox
Ranch Hand
Joined: Nov 23, 2012
Posts: 42
|
|
I have built the application with both Tomcat and Glassfish and I have two different problems with each.
When I run the application using GlassFish I get this Error: Could not connect to admin listener for GlassFish server 3.1.2. Verify that NetBeans can make outbound connections to localhost 4848.
When using TomCat I can get the application to run (with nothing added to my database) but I get this error in the log:
SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
java.lang.RuntimeException: java.lang.OutOfMemoryError: PermGen space
java.lang.OutOfMemoryError: PermGen space
|
 |
Martin Vajsar
Bartender
Joined: Aug 22, 2010
Posts: 2328
|
|
The error says you've run out of your Permanent Generation space. There are compiles classes (among other things) stored in this area, so one possibility is that your application is really big, or that your Glassfish configuration sets the PermGen size way too low. Both of these can be fixed by specifying higher MaxPermSize option. Less pleasant possibilities include memory leaks in Permanent Generation, but unfortunately I'm not an expert in this area.
I'll move your thread to the Glassfish forum, which is probably better suited for the question now. Meanwhile, you might perhaps find some answers by google: Glassfish MaxPermSize, java.lang.OutOfMemoryError: PermGen space or permanent generation memory leak.
|
 |
 |
|
|
subject: Add items to database using Servlet
|
|
|