wood burning stoves*
The moose likes Beginning Java and the fly likes Servlet throws Unload Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Servlet throws Unload Exception" Watch "Servlet throws Unload Exception" New topic
Author

Servlet throws Unload Exception

Mohini Dhanaskar
Ranch Hand

Joined: Mar 27, 2012
Posts: 54
Please help me out,i started learning java few months ago.

SEVERE: Servlet EmailFormatServlet threw unload() exception
javax.servlet.ServletException: Servlet.destroy() for servlet EmailFormatServlet threw exception
at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1413)
at org.apache.catalina.core.StandardWrapper.stop(StandardWrapper.java:1739)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4601)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3222)
at org.apache.catalina.manager.ManagerServlet.reload(ManagerServlet.java:943)
at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:361)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:199)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:558)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at EmailFormatServlet.destroy(EmailFormatServlet.java:27)
at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1394)
... 23 more
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8


Obviously something is null on which you are invoking some method.
So you want to show us your EmailFormatServlet #destroy() ?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Mohini Dhanaskar
Ranch Hand

Joined: Mar 27, 2012
Posts: 54
Sir,this is my servlet code.


Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

In future, while posting code, please UseCodeTags I have added them this time for you. As you can see they make the code much more easier to read and understand

As per your stack trace the NullPointerException originated on line 27 of your code. viz.

That would indicate that the variable ps is null. Just put a null check before you invoke a method on it.

This is not really a servlet question. Moving to a more appropriate forum
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37962
    
  22
. . . and we can see that[ttt ps [/tt]was previously initialised to null. You ought to initialise it to something useful and correct, then it will work
 
jQuery in Action, 2nd edition
 
subject: Servlet throws Unload Exception
 
Similar Threads
Error during ActionServlet initialisation
Problem while running a project using tiles in netbeans
Help with java.lang.OutOfMemoryError: Java heap space
Problem in loading servlet in startup
Tomcat not loading mysql database driver