17976

NoClassDefFoundError using struts 2

Question:

I am building an app using struts,i go through with the similar questions asked on StackOverflow but could not get the correct answer.

<hr /> Aug 25, 2014 5:15:41 PM com.opensymphony.xwork2.config.providers.XmlConfigurationProvider info INFO: Parsing configuration file [struts-default.xml] Aug 25, 2014 5:15:41 PM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter struts2 java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:211) at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:234) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:445) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:489) at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:193) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547) ... 20 more Aug 25, 2014 5:15:41 PM org.apache.catalina.core.StandardContext startInternal SEVERE: Error filterStart

This is a list of jar file am using

commons-fileupload-1.3.1 commons-io-2.2 commons-lang-2.4 commons-logging-1.1.3 commons-logging-api-1.1 freemarker-2.3.19 javassist-3.11.0.GA ognl-3.0.6 struts2-core-2.3.16.3 xwork-core-2.3.16.3

Answer1:

As explained by the Exception:

<blockquote>

Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils

</blockquote>

You need to include the <strong>commons-lang3</strong> library together with the existing <strong>commons-lang</strong> one.

More info and download link <a href="https://stackoverflow.com/a/20682698/1654265" rel="nofollow">here</a>.

Recommend

  • Efficently Replacement of all unsupported chars in a String [duplicate]
  • How to integrate Liferay DXP with Apache POI?
  • Is there simple regex to convert Java String List to Oracle IN condition?
  • Check if a Java version is greater than a certain iteration in Java?
  • Binary XML file line #16: Error inflating class android.support.design.widget.NavigationView
  • String.format using a exception.getMessage() as a format
  • JSF PrimeFaces ajax request after logout and session invalidation
  • Dependencies error while running “mvn compile”
  • Using Class.getResourcesAsStream to get Apache Commons Configuration
  • Arquillian: Attempted to register the same Observer, ServerSetupObserver multiple times
  • Deploy Microsoft Azure API jar on karaf
  • Java. Spring boot. Application startup failed
  • How to read Excel file with *.xlsx Extension?
  • How to make Javamelody use different port (Spring Boot+two HTTP ports exposed)
  • Using OraclePreparedStatement with DBCP Connection
  • How to pass object data between action class and jsp page?
  • validate that an email address contains “@” and “.”
  • How gradle dependencies work
  • ADT to Android Studio UNEXPECTED TOP-LEVEL EXCEPTION
  • Conversation Plugin vs ActionFlow
  • Clojure Regex: If string is a URL, return string
  • Java - Sort one array based on values of another array?
  • how to implement a logger factory for jboss EAP 6.2 applications
  • org.apache.commons.io.IOUtils.toString mis-interpretting UTF-8
  • How to prevent a ResultSet from being invalidated on Connection close?
  • Java out of memory errors on large WSDLs (play framework)
  • Struts2 simple Application not executing
  • Grails Elastic Search Plugin SEVERE: Unexpected transforming call sites grails elasticsearch
  • How can I configure HTTP Response Headers in a Struts2 Interceptor?
  • WSO2 ESB 4.0.3 - Error installing Data Services feature from 4.0.* repositories
  • DependencyObject.AssociatedObject is always null
  • Curried UDF - Pyspark
  • jersey/tomcat Description The origin server did not find a current representation for the target res
  • Magento get URL before current
  • Installing iPhone App to iPhone
  • OpenGL ES texture problem, 4 duplicate columns and horizontal lines (Android)
  • Cross-Platform Protobuf Serialization
  • How to format a variable of double type
  • coudnt use logback because of log4j
  • JaxB to read class hierarchy