Troubleshooting – Struts2 – java.lang.NoClassDefFoundError

Description:
The tomcat server started without starting the webapp saying Listner start error. I had JEE app with Spring2.5, Struts2 and Tomcat 5.x combination.

Trace:
java.lang.NoClassDefFoundError: ognl/ClassResolver
at com.opensymphony.xwork2.util.OgnlValueStackFactory.createValueStack(OgnlValueStackFactory.java:14)
at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:55)
at org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:52)
at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49)
at org.apache.jsp.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java:156)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:77)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at …

Cause:
The class path given in bean tag may be having incorrect path errors.
Or there are some extra bean definition in applicationContext.xml which is not valid.