• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Add items to database using Servlet

 
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.

 
Sheriff
Posts: 24635
56
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: 24635
56
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

 
Sheriff
Posts: 3752
62
Netbeans IDE Oracle Chrome
  • 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.
 
A day job? In an office? My worst nightmare! Comfort me tiny ad!
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!