Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello Friends while starting

Status
Not open for further replies.

rakesh76

Programmer
Feb 15, 2002
9
US

Hello Friends

while starting tomcat i am getting following errors.

javax.servlet.ServletException: Error instantiating servlet class org.apache.struts.action.ActionServlet

I am using tomcat 4.1.18. can anybody tell me what will be solutions for this error.

Thanx

Rakesh Sanghvi
 
Rakesh,

I just got into struts and have experienced the exact same problem. I just wonder if you've found the answer for this issue?

Thanks,
Mike
 
1. Do you have the struts.jar file in your /WEB-INF/lib directory?

2. What's in your deployment descriptor web.xml?
 
I have experienced the exact same problem too..
I have the struts.jar in my app_dir/WEB-INF/lib and this is my web.xml
<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<!DOCTYPE web-app PUBLIC &quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&quot; &quot;<web-app>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>5</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-template.tld</taglib-location>
</taglib>
</web-app>

I'm using Jbuilder 8, and jboss-3.2.2
Thanks, Alejandro....
 
Hi,

Remove &quot;;&quot; at the end of <!DOCTYPE .....> tag from the above web.xml and try.

Cheers,
Venu
 
Oh.. sorry it was a mistake when I copied.... !!! In the web.xml this &quot;;&quot; it doesn't exist... !!!

Thanks
Alejamdro....
 
Hi,

Could you paste the ---Root Cause-- Excepiton that the tomcat is throwing. That would be helpful.


Cheers,
Venu
 
Ok, this is the message that TOMCAT is throwing me:

StandardContext[/customerwebapp]: Servlet /customerwebapp threw load() exception: javax.servlet.ServletException: Error instantiating servlet class org.apache.struts.action.ActionServlet

javax.servlet.ServletException: Error instantiating servlet class org.apache.struts.action.ActionServlet

at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:901)

at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)

at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3341)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:3534)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)

at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:529)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:228)

at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:260)

at org.apache.commons.digester.Digester.endElement(Digester.java:1036)

at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1536)

at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)

at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)

at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)

at org.apache.commons.digester.Digester.parse(Digester.java:1514)

at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:335)

at org.apache.catalina.core.StandardHost.install(StandardHost.java:803)

at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:452)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:409)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:879)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:368)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)

at org.apache.catalina.core.StandardService.start(StandardService.java:497)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)

at org.apache.catalina.startup.Catalina.start(Catalina.java:510)

at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)

at org.apache.catalina.startup.Catalina.process(Catalina.java:180)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

09/12/2003 07:38:56 AM org.apache.coyote.http11.Http11Protocol start

INFO: Starting Coyote HTTP/1.1 on port 8080

09/12/2003 07:39:17 AM org.apache.struts.util.PropertyMessageResources <init>

INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true

09/12/2003 07:39:17 AM org.apache.struts.util.PropertyMessageResources <init>

INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true

09/12/2003 07:39:17 AM org.apache.struts.util.PropertyMessageResources <init>

INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true

09/12/2003 07:39:17 AM org.apache.struts.util.PropertyMessageResources <init>

INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true

StandardWrapperValve[debugjsp]: Servlet.service() for servlet debugjsp threw exception

org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans collection

org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans collection

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)

at java.lang.Thread.run(Thread.java:536)


Thanks...
Alejandro
 
Hi,

I think you dont not have all the necessary .jar files in your class path. From the Exceptions above I think you are missing commons-digester.jar file.

The List of Jar files that are required in your Classpath for struts.

commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-lang.jar
commons-logging.jar
commons-validator.jar (if using DynaActionForm)
struts.jar

Cheers,
Venu
 
Hi Venu...
Thanks for all of you advice... I tried what you said and it doesn't work.... I put the folder (C:\jakarta-struts-1.1\lib) where all of those .jar are in my WINDOWS classpath and I still can't compile the app.... If you have any other advice...

Thanks...
Alejandro
 
Hi,

Try doing this, copy all those jar file into your Webapp lib folder and then compile.

Cheers,
Venu
 
Yeeeesssss !!!! It works perfectly...!!! The Jbuilder compile the app and run perfect, now I have an error when I run the app, I don't know if it is my app or other problem with Jbuilder,Struts and JBoss because I make the .jar and .war and I put it into a web server and the app run perfect..... I'm going to check the source code, but if you get any advice this is the message that Jbuilder is throwing me when I submit the form:

StandardWrapperValve[action]: Servlet.service() for servlet action threw exception

javax.servlet.ServletException: Error de Comunicacion con JBoss: ejbstruts.CustomerUpdateException: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]

javax.servlet.ServletException: Error de Comunicacion con JBoss: ejbstruts.CustomerUpdateException: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]

at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)

at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)

at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)

at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)

at java.lang.Thread.run(Thread.java:536)


Again, thank you very much for all of your advice.. !!
Alejandro.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top