File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "File "/struts-tags" not found Exception in Sturts 2 Simple Example." Watch "File "/struts-tags" not found Exception in Sturts 2 Simple Example." New topic
Author

File "/struts-tags" not found Exception in Sturts 2 Simple Example.

Vikash Chahal
Greenhorn

Joined: Sep 20, 2012
Posts: 11
Hi All,
I am running a "Hello World " struts 2 example.I have put all the required dependencies in the "/WEB-INF/lib" location.I have the following jars in my lib location :-

commons.io_2.0.1.jar
commons-collections-3.2.1.jar
commons-fileupload-1.2.2.jar
commons-logging-1.1.1.jar
freemarker-2.3.16.jar
ognl-2.6.11.jar
struts2-core-2.0.1.jar
xwork-2.0.4.jar

Do I need any other jar file?

When I am running my app,then 404 Exception is coming.
But when I am giving any specific .jsp file name in the URL then "/struts-tags" not found exception is coming.
My "struts-tags.tld" file is in the META-INF directory of the "struts2-core-2.0.1.jar".

But I have not used "taglib" in my web.xml file. Is it required?

Any help or suggestion ?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8841
    
    7

Vikash Chahal wrote:
But when I am giving any specific .jsp file name in the URL then "/struts-tags" not found exception is coming.


You can't skip Struts when you are using Struts tags. The tags have dependencies on the Struts engine and if you go straight to the JSP, the tags will fail.
I'm not saying this is related to your problems but you are using a very old version of Struts. The current version is 2.3.8. I recommend you upgrade.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Vikash Chahal
Greenhorn

Joined: Sep 20, 2012
Posts: 11
Hi Joe Ess,
Now I am using "struts2-core-2.2.3.jar" in place of "struts2-core-2.0.1.jar" .
But now also I am getting the same behavour
"HTTP Status 404 - requested resource is not available" when I am running my app. I have Login.jsp in my welcomelist in web.xml , but this exception is coming.

Do I need to add more dependencies in my web.xml or struts.xml which are given below
-----------------------
web.xml :-
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" 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>Struts2 Application</display-name>
<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>
<welcome-file-list>
<welcome-file>Login.jsp</welcome-file>
</welcome-file-list>
</web-app>
-----------------------------------
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.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="false" />
<constant name="struts.custom.i18n.resources" value="ApplicationResources" />
<package name="default" extends="struts-default" namespace="/">
<action name="login" class="net.viralpatel.struts2.LoginAction">
<result name="success">Welcome.jsp</result>
<result name="error">Login.jsp</result>
</action>
</package>
</struts>

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

I have placed this struts.xml in "resources" folder which is under "Java Resources " folder. Is it fine?
I am using Eclipse Juno.

I am not getting why this HTTP 404 is coming ?
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

What URL are you trying to hit ?

is it http://localhost:8080/<context_name>/login ?


Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
Vikash Chahal
Greenhorn

Joined: Sep 20, 2012
Posts: 11
Saif Asif :-
I am simply trying to hit the base url(http://localhost:8080/<context_name>;") of the web-app. My Login.jsp file is in the "<welcome-file-list>" element of the web.xml. Also after appending the "/login" to the
base URL same exception(HTTP Status 404) is coming .
I also tried to hit the url "http://localhost:8080/<context_name>/Login.jsp " .In the starting ,it was showing "File "/stuts-tags" not found Exception" . But now it is also giving me the same HTTP 404
exception.

Chiranjib Bhattacharjee
Greenhorn

Joined: Nov 08, 2012
Posts: 12

Could you share the web.xml entry?


~ godspeed.
Vikash Chahal
Greenhorn

Joined: Sep 20, 2012
Posts: 11
Chiranjib :-
This is my web.xml :-

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" 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>Struts2 Application</display-name>
<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>

<welcome-file-list>
<welcome-file>Login.jsp</welcome-file>
</welcome-file-list>

</web-app>
--------------------
Chiranjib Bhattacharjee
Greenhorn

Joined: Nov 08, 2012
Posts: 12

I hope you are hitting the correct URL. If your context-root is "Struts2 Application", you would have to hit http://localhost/Struts2%20Application".
Vikash Chahal
Greenhorn

Joined: Sep 20, 2012
Posts: 11
Chiranjib :-
Yes Chiranjib , I am hitting the correct URL. Even I tried changing this name(Struts2 Application) both in web.xml and in the URL , but again same HTTP 404 Exception.
Vikash Chahal
Greenhorn

Joined: Sep 20, 2012
Posts: 11
Hi All,
Any Suggestion?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8841
    
    7

Vikash Chahal wrote: Hi All,
Any Suggestion?


Please be patient. We are all volunteers here.
First, if you update the Struts core JAR file, you should update all the dependencies.
Next, you cannot use a JSP that has a Struts tag as a welcome file for the same reason I mentioned before, Struts tags require that the interceptors run before the tag is rendered. The common workaround is to use an HTML page as a welcome page and put an automatic redirect to a Struts action in the HTML page.
Last, what server are you using? Does it have a console so you can see that the web application is deployed where you think it is?
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

what is the taglib uri you specified on your jsp to use struts tags ? Make sure it is exactly similar to this


Also, as Joe has suggested , update all your dependancies and libraries.
Vaishali Paramane
Ranch Hand

Joined: Mar 05, 2007
Posts: 106
Can you please check the setting below video?
http://javabrains.koushik.org/2012/01/struts-2-tutorial-02-setting-up.html


SCJP, SCJD
Preparing for SCWCD
Vikash Chahal
Greenhorn

Joined: Sep 20, 2012
Posts: 11

Thanks Joe Ess for your reply.

Joe Ess wrote
Last, what server are you using? Does it have a console so you can see that the web application is deployed where you think it is?

I am using Tomcat6.0.36 with Eclipse Juno and the console log of the eclipse while running the app is :-
-----------------------------

Mar 15, 2013 11:21:18 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.6.0_07\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Intel\DMIX;C:\Program Files\Windows Imaging\;C:\Program Files\Java\jdk1.6.0_31\bin;%M2%;C:\Program Files\Microsoft Application Virtualization Client;C:\apache-maven-3.0.4-bin\apache-maven-3.0.4\bin;.;C:\eclipse;
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:First' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:POC' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:RealTime' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:RunTime' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:MultiRecord' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:iDigi' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:TaglibTesting' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:StrutsViral' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:StNew' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:XMLReading' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:WS' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Struts2_first' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Struts2_second' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:struts2_mk' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Struts2_Dzone' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:S1_First' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Struts_Test' did not find a matching property.
Mar 15, 2013 11:21:18 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 15, 2013 11:21:18 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 324 ms
Mar 15, 2013 11:21:18 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 15, 2013 11:21:18 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.36
Mar 15, 2013 11:21:19 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-default.xml]
Mar 15, 2013 11:21:19 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-plugin.xml]
Mar 15, 2013 11:21:19 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
SEVERE: Dispatcher initialization failed
Unable to load configuration. - bean - jar:file:/C:/Documents%20and%20Settings/499451/workspace_Juno/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Struts2_Dzone/WEB-INF/lib/struts2-gxp-plugin-2.3.8.jar!/struts-plugin.xml:8:162
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:471)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: Unable to load bean: typerg.apache.struts2.views.gxp.inject.InjectedObjectContainer classrg.apache.struts2.views.gxp.inject.InjectedObjectContainer - bean - jar:file:/C:/Documents%20and%20Settings/499451/workspace_Juno/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Struts2_Dzone/WEB-INF/lib/struts2-gxp-plugin-2.3.8.jar!/struts-plugin.xml:8:162
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:245)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:215)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 22 more
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.views.gxp.inject.InjectedObjectContainer
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:152)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:216)
... 25 more
Mar 15, 2013 11:21:19 AM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. - bean - jar:file:/C:/Documents%20and%20Settings/499451/workspace_Juno/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Struts2_Dzone/WEB-INF/lib/struts2-gxp-plugin-2.3.8.jar!/struts-plugin.xml:8:162
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:483)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: Unable to load configuration. - bean - jar:file:/C:/Documents%20and%20Settings/499451/workspace_Juno/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Struts2_Dzone/WEB-INF/lib/struts2-gxp-plugin-2.3.8.jar!/struts-plugin.xml:8:162
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:471)
... 20 more
Caused by: Unable to load bean: typerg.apache.struts2.views.gxp.inject.InjectedObjectContainer classrg.apache.struts2.views.gxp.inject.InjectedObjectContainer - bean - jar:file:/C:/Documents%20and%20Settings/499451/workspace_Juno/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Struts2_Dzone/WEB-INF/lib/struts2-gxp-plugin-2.3.8.jar!/struts-plugin.xml:8:162
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:245)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:215)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 22 more
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.views.gxp.inject.InjectedObjectContainer
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:152)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:216)
... 25 more
Mar 15, 2013 11:21:19 AM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Mar 15, 2013 11:21:19 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/Struts2_Dzone] startup failed due to previous errors
Mar 15, 2013 11:21:20 AM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
java.lang.IncompatibleClassChangeError: Found interface com.opensymphony.xwork2.ActionProxyFactory, but class was expected
at org.apache.struts2.dispatcher.Dispatcher.<clinit>(Dispatcher.java:85)
at org.apache.struts2.dispatcher.FilterDispatcher.createDispatcher(FilterDispatcher.java:397)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:163)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Mar 15, 2013 11:21:20 AM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Mar 15, 2013 11:21:20 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/Struts2_first] startup failed due to previous errors
Mar 15, 2013 11:21:20 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/Struts2_first] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@651e95]) and a value of type [org.apache.struts2.impl.StrutsObjectFactory] (value [org.apache.struts2.impl.StrutsObjectFactory@baf589]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Mar 15, 2013 11:21:20 AM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:269)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Mar 15, 2013 11:21:20 AM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Mar 15, 2013 11:21:20 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/Struts2_second] startup failed due to previous errors
Mar 15, 2013 11:21:20 AM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:269)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Mar 15, 2013 11:21:20 AM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Mar 15, 2013 11:21:20 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/struts2_mk] startup failed due to previous errors
Mar 15, 2013 11:21:20 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-default.xml]
Mar 15, 2013 11:21:20 AM 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:215)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:471)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 26 more
Mar 15, 2013 11:21:20 AM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Mar 15, 2013 11:21:20 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/Struts_Test] startup failed due to previous errors
Mar 15, 2013 11:21:20 AM org.apache.commons.digester.Digester error
SEVERE: Parse Error at line 3 column 15: Document is invalid: no grammar found.
org.xml.sax.SAXParseException: Document is invalid: no grammar found.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1745)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:738)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:687)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Mar 15, 2013 11:21:20 AM org.apache.commons.digester.Digester error
SEVERE: Parse Error at line 3 column 15: Document root element "struts-config", must match DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "struts-config", must match DOCTYPE root "null".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1745)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:738)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:687)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Mar 15, 2013 11:21:21 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 15, 2013 11:21:21 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 15, 2013 11:21:21 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/15 config=null
Mar 15, 2013 11:21:21 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2164 ms


Joe Ess wrote
First, if you update the Struts core JAR file, you should update all the dependencies.

Now, I updated all the jars and used jar files provided by Apache for the "struts 2.3.8 ".My jar files include
commons-fileupload-1.2.2
commons-io-2.0.1
commons-logging-1.1.1
commons-logging-api-1.1
freemarker-2.3.19
javaassist-3.11.0.GA
ognl-3.0.6
struts2-core-2.3.8
xwork-core-2.3.8

Joe Ess wrote
Next, you cannot use a JSP that has a Struts tag as a welcome file for the same reason I mentioned before, Struts tags require that the interceptors run before the tag is rendered. The common workaround is to use an HTML page as a welcome page and put an automatic redirect to a Struts action in the HTML page.


As suggested by you, I used a simple index.jsp file as welcome file in the "web.xml " with no Struts tags in it.
But same problem is there HTTP 404.

Vikash Chahal
Greenhorn

Joined: Sep 20, 2012
Posts: 11
Saif Asif :-
I used samething in my jsp files for struts-tags.
Vikash Chahal
Greenhorn

Joined: Sep 20, 2012
Posts: 11
Thanks Vaishali for your reply.
I will check this tutorial. But here in office the videos are blocked , I have to check these at home.
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

I see multiple ClassNotFoundExceptions and also struts-plugin.xml missing errors in your logs. Means that your project is not setup correctly as struts require it to. I suggest you start with the struts2 blank project war . Get the blank war flie inside struts2-app from the downloads location of struts2 website and compare it with your project for any missing dependencies or properties.
Do post back for any further queries.
Vikash Chahal
Greenhorn

Joined: Sep 20, 2012
Posts: 11

Saif Asif wrote
I suggest you start with the struts2 blank project war . Get the blank war flie inside struts2-app from the downloads location of struts2 website and compare it with your project for any missing dependencies
or properties.


Thanks a lot Asif. This approach proved really helpful and I am able to run simple struts2 app.



Thanks everybody for your support!
 
 
subject: File "/struts-tags" not found Exception in Sturts 2 Simple Example.
 
Similar Threads
struts2 question!
Error in Struts2 application
Struts2 & XWork
Hello World with Struts2
Struts2 Jar Dependencies