You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by jay <rm...@yahoo.com> on 2012/03/02 04:52:37 UTC

struts 2 - excepting starting filter

I downloaded from google code Basic_Struts2_Ant
 and modified web.xml, added
struts.xml and index.jsp along with log4j 
stuff according to instructions on
struts website for this example.  

The app does not work on tomcat 7.0
I built with ant and deployed on tomcat


jars I am using

commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
commons-lang-2.5.jar
commons-logging-1.1.1.jar
commons-logging-api-1.1.jar
freemarker-2.3.18.jar
javassist-3.11.0.GA.jar
ognl-3.0.4.jar
struts2-core-2.3.1.2.jar
xwork-core-2.3.1.2.jar
log4j-1.2.14.jar


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="basicstruts2" extends="struts-default">

		<action name="index">
			<result>/index.jsp</result>
		</action>

	</package>

</struts>

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
id="WebApp_ID" version="3.0">
  <display-name>Basic_Struts2_Ant</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>

<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>

</web-app>

basic index.jsp

<%@ page language="java" contentType="text/html; 
charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" 
content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h1> Welcome one and all to Strut2</h1>
</body>
</html>









---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts 2 - excepting starting filter

Posted by jay <rm...@yahoo.com>.
Thanks for your help!  I found a struts jar in my tomcat\lib folder

Dave Newton <davelnewton <at> gmail.com> writes:

> 
> The error message says it all, you need to remove the struts/etc. libs you
> put in the tomcat lib directory and deploy only the application's copies.
> 
> Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts 2 - excepting starting filter

Posted by Dave Newton <da...@gmail.com>.
The error message says it all, you need to remove the struts/etc. libs you
put in the tomcat lib directory and deploy only the application's copies.

Dave

(pardon brevity and typos, on cell)
On Mar 1, 2012 11:16 PM, "jay" <rm...@yahoo.com> wrote:

> Here is log with the error
>
>
> jars I am using
>
> commons-fileupload-1.2.2.jar
> commons-io-2.0.1.jar
> commons-lang-2.5.jar
> commons-logging-1.1.1.jar
> commons-logging-api-1.1.jar
> freemarker-2.3.18.jar
> javassist-3.11.0.GA.jar
> ognl-3.0.4.jar
> struts2-core-2.3.1.2.jar
> xwork-core-2.3.1.2.jar
> log4j-1.2.14.jar
>
>
> Here is log information:
>
> Mar 1, 2012 9:12:46 PM
> org.apache.catalina.core.StandardContext filterStart
> SEVERE: Exception starting filter struts2
> Unable to load configuration.
> - bean - jar:file:/C:/apache-tomcat-7.0.26/webapps/
> Basic_Struts2_Ant/WEB-INF/lib/struts2-core-2.3.1.2.jar!
> /struts-default.xml:29:72
>        at org.apache.struts2.dispatcher.Dispatcher.init
> (Dispatcher.java:449)
>        at org.apache.struts2.dispatcher.ng.InitOperations.
> initDispatcher(InitOperations.java:69)
>        at org.apache.struts2.dispatcher.ng.filter.
> StrutsPrepareAndExecuteFilter.init
> (StrutsPrepareAndExecuteFilter.java:51)
>        at org.apache.catalina.core.ApplicationFilterConfig.
> initFilter(ApplicationFilterConfig.java:277)
>        at org.apache.catalina.core.ApplicationFilterConfig.
> getFilter(ApplicationFilterConfig.java:258)
>        at org.apache.catalina.core.ApplicationFilterConfig.
> setFilterDef(ApplicationFilterConfig.java:382)
>        at org.apache.catalina.core.ApplicationFilterConfig.
> <init>(ApplicationFilterConfig.java:103)
>        at org.apache.catalina.core.StandardContext.
> filterStart(StandardContext.java:4638)
>        at org.apache.catalina.core.StandardContext.
> startInternal(StandardContext.java:5294)
>        at org.apache.catalina.util.LifecycleBase.
> start(LifecycleBase.java:150)
>        at org.apache.catalina.core.ContainerBase.
> addChildInternal(ContainerBase.java:895)
>        at org.apache.catalina.core.ContainerBase.
> addChild(ContainerBase.java:871)
>        at org.apache.catalina.core.StandardHost.
> addChild(StandardHost.java:615)
>        at org.apache.catalina.startup.HostConfig.
> deployWAR(HostConfig.java:958)
>        at org.apache.catalina.startup.HostConfig$
> DeployWar.run(HostConfig.java:1599)
>        at java.util.concurrent.Executors$RunnableAdapter.
> call(Executors.java:441)
>        at java.util.concurrent.FutureTask$Sync.
> innerRun(FutureTask.java:303)
>        at java.util.concurrent.FutureTask.
> run(FutureTask.java:138)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.
> runTask(ThreadPoolExecutor.java:886)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.
> run(ThreadPoolExecutor.java:908)
>        at java.lang.Thread.run(Thread.java:619)
> Caused by: Unable to load configuration. - bean -
> jar:file:/C:/apache-tomcat-7.0.26/webapps/Basic_Struts2_Ant/
> WEB-INF/lib/struts2-core-2.3.1.2.jar!/struts-default.xml:29:72
>        at com.opensymphony.xwork2.config.ConfigurationManager.
> getConfiguration(ConfigurationManager.java:69)
>        at org.apache.struts2.dispatcher.Dispatcher.
> init_PreloadConfiguration(Dispatcher.java:390)
>        at org.apache.struts2.dispatcher.Dispatcher.
> init(Dispatcher.java:436)
>        ... 20 more
> Caused by: Unable to load bean: type: class:com.opensymphony.
> xwork2.ObjectFactory - bean - jar:file:/C:/apache-tomcat-7.0.26/
> webapps/Basic_Struts2_Ant/WEB-INF/lib/struts2-core-2.3.1.2.jar!
> /struts-default.xml:29:72
>        at com.opensymphony.xwork2.config.providers.
> XmlConfigurationProvider.register(XmlConfigurationProvider.java:235)
>        at org.apache.struts2.config.StrutsXmlConfigurationProvider.
> register(StrutsXmlConfigurationProvider.java:102)
>        at com.opensymphony.xwork2.config.impl.DefaultConfiguration.
> reloadContainer(DefaultConfiguration.java:180)
>        at com.opensymphony.xwork2.config.ConfigurationManager.
> getConfiguration(ConfigurationManager.java:66)
>        ... 22 more
> Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory
> with the name xwork has already been loaded by bean -
> jar:file:/C:/apache-tomcat-7.0.26/lib/struts2-core-2.3.1.2.jar!
> /struts-default.xml:29:72 - bean - jar:file:/C:/apache-tomcat-7.0.26
> /webapps/Basic_Struts2_Ant/WEB-INF/lib/struts2-core-2.3.1.2.jar!
> /struts-default.xml:29:72
>        at com.opensymphony.xwork2.config.providers.
> XmlConfigurationProvider.register(XmlConfigurationProvider.java:219)
>        ... 25 more
> Mar 1, 2012 9:12:46 PM org.apache.catalina.core.ApplicationContext log
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: struts 2 - excepting starting filter

Posted by jay <rm...@yahoo.com>.
Here is log with the error


jars I am using

commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
commons-lang-2.5.jar
commons-logging-1.1.1.jar
commons-logging-api-1.1.jar
freemarker-2.3.18.jar
javassist-3.11.0.GA.jar
ognl-3.0.4.jar
struts2-core-2.3.1.2.jar
xwork-core-2.3.1.2.jar
log4j-1.2.14.jar


Here is log information:

Mar 1, 2012 9:12:46 PM 
org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. 
- bean - jar:file:/C:/apache-tomcat-7.0.26/webapps/
Basic_Struts2_Ant/WEB-INF/lib/struts2-core-2.3.1.2.jar!
/struts-default.xml:29:72
	at org.apache.struts2.dispatcher.Dispatcher.init
(Dispatcher.java:449)
	at org.apache.struts2.dispatcher.ng.InitOperations.
initDispatcher(InitOperations.java:69)
	at org.apache.struts2.dispatcher.ng.filter.
StrutsPrepareAndExecuteFilter.init
(StrutsPrepareAndExecuteFilter.java:51)
	at org.apache.catalina.core.ApplicationFilterConfig.
initFilter(ApplicationFilterConfig.java:277)
	at org.apache.catalina.core.ApplicationFilterConfig.
getFilter(ApplicationFilterConfig.java:258)
	at org.apache.catalina.core.ApplicationFilterConfig.
setFilterDef(ApplicationFilterConfig.java:382)
	at org.apache.catalina.core.ApplicationFilterConfig.
<init>(ApplicationFilterConfig.java:103)
	at org.apache.catalina.core.StandardContext.
filterStart(StandardContext.java:4638)
	at org.apache.catalina.core.StandardContext.
startInternal(StandardContext.java:5294)
	at org.apache.catalina.util.LifecycleBase.
start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.
addChildInternal(ContainerBase.java:895)
	at org.apache.catalina.core.ContainerBase.
addChild(ContainerBase.java:871)
	at org.apache.catalina.core.StandardHost.
addChild(StandardHost.java:615)
	at org.apache.catalina.startup.HostConfig.
deployWAR(HostConfig.java:958)
	at org.apache.catalina.startup.HostConfig$
DeployWar.run(HostConfig.java:1599)
	at java.util.concurrent.Executors$RunnableAdapter.
call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.
innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.
run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.
runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.
run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
Caused by: Unable to load configuration. - bean - 
jar:file:/C:/apache-tomcat-7.0.26/webapps/Basic_Struts2_Ant/
WEB-INF/lib/struts2-core-2.3.1.2.jar!/struts-default.xml:29:72
	at com.opensymphony.xwork2.config.ConfigurationManager.
getConfiguration(ConfigurationManager.java:69)
	at org.apache.struts2.dispatcher.Dispatcher.
init_PreloadConfiguration(Dispatcher.java:390)
	at org.apache.struts2.dispatcher.Dispatcher.
init(Dispatcher.java:436)
	... 20 more
Caused by: Unable to load bean: type: class:com.opensymphony.
xwork2.ObjectFactory - bean - jar:file:/C:/apache-tomcat-7.0.26/
webapps/Basic_Struts2_Ant/WEB-INF/lib/struts2-core-2.3.1.2.jar!
/struts-default.xml:29:72
	at com.opensymphony.xwork2.config.providers.
XmlConfigurationProvider.register(XmlConfigurationProvider.java:235)
	at org.apache.struts2.config.StrutsXmlConfigurationProvider.
register(StrutsXmlConfigurationProvider.java:102)
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.
reloadContainer(DefaultConfiguration.java:180)
	at com.opensymphony.xwork2.config.ConfigurationManager.
getConfiguration(ConfigurationManager.java:66)
	... 22 more
Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory 
with the name xwork has already been loaded by bean - 
jar:file:/C:/apache-tomcat-7.0.26/lib/struts2-core-2.3.1.2.jar!
/struts-default.xml:29:72 - bean - jar:file:/C:/apache-tomcat-7.0.26
/webapps/Basic_Struts2_Ant/WEB-INF/lib/struts2-core-2.3.1.2.jar!
/struts-default.xml:29:72
	at com.opensymphony.xwork2.config.providers.
XmlConfigurationProvider.register(XmlConfigurationProvider.java:219)
	... 25 more
Mar 1, 2012 9:12:46 PM org.apache.catalina.core.ApplicationContext log




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts 2 - excepting starting filter

Posted by Dave Newton <da...@gmail.com>.
What's in the startup log? Have you turned on devMode? Logging at debug
level?

IMO doing this via Ant will end up being a pain. IIRC there was done other
issue with this particular project, too, although I'd have to dig to try to
recall.

Dave

(pardon brevity and typos, on cell)
On Mar 1, 2012 10:53 PM, "jay" <rm...@yahoo.com> wrote:

> I downloaded from google code Basic_Struts2_Ant
>  and modified web.xml, added
> struts.xml and index.jsp along with log4j
> stuff according to instructions on
> struts website for this example.
>
> The app does not work on tomcat 7.0
> I built with ant and deployed on tomcat
>
>
> jars I am using
>
> commons-fileupload-1.2.2.jar
> commons-io-2.0.1.jar
> commons-lang-2.5.jar
> commons-logging-1.1.1.jar
> commons-logging-api-1.1.jar
> freemarker-2.3.18.jar
> javassist-3.11.0.GA.jar
> ognl-3.0.4.jar
> struts2-core-2.3.1.2.jar
> xwork-core-2.3.1.2.jar
> log4j-1.2.14.jar
>
>
> 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="basicstruts2" extends="struts-default">
>
>                <action name="index">
>                        <result>/index.jsp</result>
>                </action>
>
>        </package>
>
> </struts>
>
> web.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="http://java.sun.com/xml/ns/javaee"
> xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
> id="WebApp_ID" version="3.0">
>  <display-name>Basic_Struts2_Ant</display-name>
>  <welcome-file-list>
>    <welcome-file>index.html</welcome-file>
>    <welcome-file>index.htm</welcome-file>
>    <welcome-file>index.jsp</welcome-file>
>    <welcome-file>default.html</welcome-file>
>    <welcome-file>default.htm</welcome-file>
>    <welcome-file>default.jsp</welcome-file>
>  </welcome-file-list>
>
> <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>
>
> </web-app>
>
> basic index.jsp
>
> <%@ page language="java" contentType="text/html;
> charset=ISO-8859-1"
>    pageEncoding="ISO-8859-1"%>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type"
> content="text/html; charset=ISO-8859-1">
> <title>Insert title here</title>
> </head>
> <body>
> <h1> Welcome one and all to Strut2</h1>
> </body>
> </html>
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>