• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Add items to database using Servlet

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic