Servlet 500 Cannot Initialise
alexadranghi Feb 26, 2006 6:28 AMHi, getting an error one mydeployed application that I'm a little stumped on. First of all something of relevence is that XDoclets aren't automatically generating much in the way of content in my web descriptors, so I have had to write them manually.
Error:
exception javax.servlet.ServletException: Error instantiating servlet class panacea.stl.genericSTL org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39) org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159) org.jboss.web.tomcat.tc5.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:81) org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) java.lang.Thread.run(Unknown Source) root cause java.lang.InstantiationException sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(Unknown Source) java.lang.reflect.Constructor.newInstance(Unknown Source) java.lang.Class.newInstance0(Unknown Source) java.lang.Class.newInstance(Unknown Source) org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39) org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159) org.jboss.web.tomcat.tc5.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:81) org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) java.lang.Thread.run(Unknown Source)
Web.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app > <distributable/> <!-- To use non XDoclet filters, create a filters.xml file that contains the additional filters (eg Sitemesh) and place it in your project's merge dir. Don't include filter-mappings in this file, include them in a file called filter-mappings.xml and put that in the same directory. --> <!-- To use non XDoclet filter-mappings, create a filter-mappings.xml file that contains the additional filter-mappings and place it in your project's merge dir. --> <!-- To use non XDoclet listeners, create a listeners.xml file that contains the additional listeners and place it in your project's merge dir. --> <servlet> <servlet-name>genericSTL</servlet-name> <display-name>Generic STL</display-name> <description><![CDATA[Servlet that takes inputs]]></description> <servlet-class>panacea.stl.genericSTL</servlet-class> </servlet> <!-- To use non XDoclet servlets, create a servlets.xml file that contains the additional servlets (eg Struts) and place it in your project's merge dir. Don't include servlet-mappings in this file, include them in a file called servlet-mappings.xml and put that in the same directory. --> <servlet-mapping> <servlet-name>genericSTL</servlet-name> <url-pattern>/panacea.stl</url-pattern> </servlet-mapping> <!-- To specify mime mappings, create a file named mime-mappings.xml, put it in your project's mergedir. Organize mime-mappings.xml following this DTD slice: <!ELEMENT mime-mapping (extension, mime-type)> --> <!-- To specify error pages, create a file named error-pages.xml, put it in your project's mergedir. Organize error-pages.xml following this DTD slice: <!ELEMENT error-page ((error-code | exception-type), location)> --> <!-- To add taglibs by xml, create a file called taglibs.xml and place it in your merge dir. --> <!-- To set up security settings for your web app, create a file named web-security.xml, put it in your project's mergedir. Organize web-security.xml following this DTD slice: <!ELEMENT security-constraint (display-name?, web-resource-collection+, auth-constraint?, user-data-constraint?)> <!ELEMENT web-resource-collection (web-resource-name, description?, url-pattern*, http-method*)> <!ELEMENT web-resource-name (#PCDATA)> <!ELEMENT url-pattern (#PCDATA)> <!ELEMENT http-method (#PCDATA)> <!ELEMENT user-data-constraint (description?, transport-guarantee)> <!ELEMENT transport-guarantee (#PCDATA)> <!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)> <!ELEMENT auth-method (#PCDATA)> <!ELEMENT realm-name (#PCDATA)> <!ELEMENT form-login-config (form-login-page, form-error-page)> <!ELEMENT form-login-page (#PCDATA)> <!ELEMENT form-error-page (#PCDATA)> --> <ejb-ref> <description><![CDATA[Central communication hub within a Panacea deployment.]]></description> <ejb-ref-name>ejb/Director</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <home>panacea.routing.DirectorHome</home> <remote>panacea.routing.Director</remote> </ejb-ref> </web-app>
jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_3_0.dtd"> <jboss-web> <!-- Resource Environment References --> <!-- For additional resouce-env-ref tags add a merge file called jbossweb-resource-env-ref.xml --> <!-- Resource references --> <!-- For additional resouce-ref tags add a merge file called jbossweb-resource-ref.xml --> <!-- EJB References --> <!-- For additional ejb-ref tags add a merge file called jbossweb-ejb-ref.xml --> <ejb-ref> <ejb-ref-name>ejb/Director</ejb-ref-name> <jndi-name>ejb/Director</jndi-name> </ejb-ref> <!-- EJB Local References --> </jboss-web>
application.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd"> <application> <display-name>Sum Application</display-name> <module> <ejb>FiboEJB.jar</ejb> </module> <module> <web> <web-uri>FiboWeb.war</web-uri> <context-root>/fibo</context-root> </web> </module> </application>
I'm still using the same names as the tutorial files, as I'm just changing the application and removing the tutorial slowly so I make sure I understand whats going on.
Thanks