<Jul 29, 2015 10:55:58 AM IST> <Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: org.apache.st
ruts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.
Unable to load configuration. - action - zip:C:/DEV/bea92MP3/user_projects/domains/cv_domain/servers/AdminServer/tmp/_WL
_user/ficv2/3ie869/war/WEB-INF/lib/_wl_cls_gen.jar!/struts.xml:9:72
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:493)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:309)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
Truncated. see log file for complete stacktrace
Unable to load configuration. - action - zip:C:/DEV/bea92MP3/user_projects/domains/cv_domain/servers/AdminServer/tmp/_WL
_user/ficv2/3ie869/war/WEB-INF/lib/_wl_cls_gen.jar!/struts.xml:9:72
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:967)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:435)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:479)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
Truncated. see log file for complete stacktrace
Action class [com.login.action.LoginAction] not found - action - zip:C:/DEV/bea92MP3/user_projects/domains/cv
_domain/servers/AdminServer/tmp/_WL_user/ficv2/3ie869/war/WEB-INF/lib/_wl_cls_gen.jar!/struts.xml:9:72
I get above exception on deploying ear built using struts 2.3 jars to weblogic server
struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<package name="default" namespace="/" extends="struts-default">
<action name="login" class="com.login.action.LoginAction">
<result name="success">/jsp/index.jsp</result>
</action>
</package>
</struts>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>ficv2.0</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>/jsp/index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Below is the list of jars used
- commons-fileupload-1.3.1.jar
- commons-io-2.2.jar
- commons-lang3-3.0.jar
- freemarker-2.3.22.jar
- javassist-3.11.0.GA.jar
- ognl-3.0.6.jar
- struts2-core-2.3.24.jar
xwork-core-2.3.24.jar
build.xml
<target name="set_env" unless="set_env" description="setup the properties."> <!-- All the system environment variables will be accessed by prefixing "env.". To do that following property has to be set and be pointing to env --> <property environment="env" /> <property name="java.home" value="${env.JAVA_HOME}" /> <!-- Settings for global directories --> <property name="root.dir" value="." /> <property name="source.dir" value="${root.dir}/src" /> <property name="build.dir" value="${root.dir}/build" /> <property name="webapp.dir" value="${root.dir}/WebContent" /> <property name="lib.dir" value="${webapp.dir}/WEB-INF/lib" /> <property name="classes.dir" value="${webapp.dir}/WEB-INF/classes" /> <!-- Refers to cvs_build dir --> <property name="web.jar.name" value="struts2.0-web" /> <property name="ear.name" value="struts2.0" /> <property name="war.name" value="struts2.0" /> <!-- Class path settings --> <property name="struts.jars" value="${lib.dir}/struts2-core-2.3.24.jar ; ${lib.dir}/freemarker-2.3.22.jar ; ${lib.dir}/xwork-core-2.3.24.jar ; ${lib.dir}/ognl-3.0.6.jar ; ${lib.dir}/commons-fileupload-1.3.1.jar; ${lib.dir}/commons-io-2.2.jar; ${lib.dir}/commons-lang3-3.0.jar;${lib.dir}/javaassist-3.11.0.GA.jar;" /> <!-- End - Class path settings --> </target> <target name="init" depends="set_env" description="Initializes the required directories."> <mkdir dir="${webapp.dir}" /> <mkdir dir="${lib.dir}" /> <mkdir dir="${classes.dir}" /> <mkdir dir="${build.dir}" /> <path id="project.class.path"> <fileset dir="${lib.dir}"> <include name="*.jar" /> </fileset> </path> </target> <target name="clean" depends="set_env" description="Cleans up the classes and output directories"> <echo message="Deleting Classes..." /> <delete dir="${classes.dir}" /> <echo message="Deleting ear and war..." /> <delete dir="${build.dir}/${ear.name}.ear" /> <delete dir="${build.dir}/${war.name}.war" /> </target> <target name="compile" depends="init" description="Compiles all source files"> <javac debug="on" srcdir="${source.dir}" destdir="${classes.dir}" verbose="true" classpath="${struts.jars}"> </javac> <echo message="${webapp.dir}" /> <copy file="${source.dir}/struts.xml" todir="${classes.dir}"/> </target> <target name="create_jar" depends="compile" description="Package the Java classes into a jar."> <echo message="Creating Jar file..." /> <delete file="${webapp.dir}/WEB-INF/lib/${web.jar.name}.jar" /> <jar jarfile="${webapp.dir}/WEB-INF/lib/${web.jar.name}.jar" basedir="${classes.dir}" includes="**/action/**" /> </target> <target name="create_war"> <delete file="${build.dir}/${war.name}.war" /> <echo message="${webapp.dir}" /> <jar jarfile="${build.dir}/${war.name}.war" update="yes" manifest="${webapp.dir}/META-INF/MANIFEST.MF"> <fileset dir="${webapp.dir}"> <include name="**" /> </fileset> <zipfileset dir="${webapp.dir}/images" prefix="images"> <include name="**" /> </zipfileset> </jar> </target> <target name="create_ear" depends="create_war"> <delete file="${build.dir}/${ear.name}.ear" /> <ear earfile="${build.dir}/${ear.name}.ear" appxml="${root.dir}/META-INF/application.xml"> <fileset dir="${build.dir}"> <include name="*.jar" /> </fileset> <fileset file="${build.dir}/${war.name}.war" /> </ear> </target> <target name="all" depends="set_env, create_jar, create_ear" description="Perform all targets." />
Please let me know how can this be solved.
struts.xml must be placed in WEB-INF directory. And also please make sure "LoginAction" is present in the specified path (com\ssga\fi\cv\login\action\LoginAction)
I changed the build script which resolved the error though do not know what was wrong with previous build script(may be previous build script was causing jars conflict).