• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Add items to database using Servlet

 
Brooke Maddox
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay so I changed it to


When I hit submit on my form I now get a blank screen.
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic