This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Unexpected error when running application from tomcat. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Unexpected error when running application from tomcat." Watch "Unexpected error when running application from tomcat." New topic
Author

Unexpected error when running application from tomcat.

Owais Zahid
Greenhorn

Joined: Nov 11, 2009
Posts: 21
I have recently started using struts 2 . I am developed a web application. When i deploy the site on my tomcat 6 and start tomcat , i got the following error.

SEVERE: Servlet.service() for servlet default threw exception
java.lang.NoClassDefFoundError: Could not initialize class com.opensymphony.xwork2.util.profiling.UtilTimerStack
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:425)
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.core.StandardHostValve.invoke(StandardHostValve.java:128)
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:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:636)


please help , tell me what to do.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Post your configuration and what libraries you're deploying.
Owais Zahid
Greenhorn

Joined: Nov 11, 2009
Posts: 21
David , this is my web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<!-- precompiled jsp mappings -->

<!-- Define the default CSS Theme -->
<context-param>
<param-name>csstheme</param-name>
<param-value>simplicity</param-value>
</context-param>
<!-- Define the basename for a resource bundle for I18N -->
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>ApplicationResources</param-value>
</context-param>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

</web-app>

-----------------------------------------------------

And i am using the following libs

oscache-2.3.jar
hamcrest-library-1.1.jar
struts-menu-2.4.3.jar
xwork-2.0.4.jar
jstl-1.1.2.jar
jstl.jar
commons-dbcp-1.2.1.jar
commons-io-1.3.1.jar
dom4j-1.6.1.jar
sitemesh-2.2.1.jar
commons-pool-1.2.jar
xstream-1.3.1.jar
ognl-2.6.11.jar
commons-digester-1.7.jar
spring-test-2.5.4.jar
commons-httpclient-3.0.jar
commons-codec-1.3.jar
jdom-1.0.jar
commons-collections-3.2.jar
struts2-core-2.0.11.1.jar
hamcrest-core-1.1.jar
freemarker-2.3.8.jar
commons-lang-2.3.jar
commons-fileupload-1.2.1.jar
commons-logging-1.0.3.jar
itext-1.3.jar
jettison-1.1.jar
displaytag-1.1.1.jar
standard-1.1.2.jar
commons-beanutils-1.7.0.jar
standard.jar

----------------------------------

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read.

You can edit your post by using the button.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You did not include your Struts 2 configuration file(s).
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Wouldn't it make more sense to start with a plain S2 app, get that working, then continue, instead of trying to do everything at once?
Owais Zahid
Greenhorn

Joined: Nov 11, 2009
Posts: 21


Sorry for the inconvenience. David, the application was working before, i don't know why its giving me this error now.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What did you change?

Try to isolate the problem by creating a small testcase and post the libs/configs for that.
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 643
Are you missing the xwork-core Jar, or is it called just xwork in that version of Struts 2?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Unexpected error when running application from tomcat.
 
Similar Threads
TreeStructure of type org.ajax4jsf.application.TreeStructureNode is not supported.
Help appriciated. SQLServer 2000 JDBC exception.
Apache Tomcat error... org.apache.catalina.core.StandardWrapperValve invoke .. Help Please
Starting Tomcat as a Windows Service
tomcat formAutheticator problem