wood burning stoves*
The moose likes Struts and the fly likes Exception starting filter struts2 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 "Exception starting filter struts2" Watch "Exception starting filter struts2" New topic
Author

Exception starting filter struts2

sitaramaraju psn
Greenhorn

Joined: Dec 22, 2008
Posts: 3
Iam struggling to crack the issue since last two days and not able to find the root cause.I'm new to web development and asked to learn and work on Struts2.

The example contains both struts1 and struts2 functionality as it is a migration example.

Step1 : I downloaded sourcecode from following URL:http://www.infoq.com/articles/migrating-struts-2-part3
Step2: Downloaded content is a maven style project structure and downloaded all jars that are needed by following pom.xml .
Step3: Created a Empty Web project(Example) and Copied the extracted srcfolder to eclipse src and added resouces folder containg strutsproperties,struts.xml to it
Step4: Deleted the Web content folder of eclipse and added webapps folder in my project example.
Step5:Created a lib folder and add jars that i downloaded with reference from pom.xml and added jars in the build path and deleted pom.xml from project.
Step6:The changes I made in the to the downloaded content are as follows in my first attempt are just changed webwork to struts2 in web.xml
Step7: On running I got some as mention below in my eclipse.(Console and 404 fromapache )
12 May, 2011 6:54:04 PM 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\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jdk1.6.0_21/bin/../jre/bin/client;C:/Program Files/Java/jdk1.6.0_21/bin/../jre/bin;C:/Program Files/Java/jdk1.6.0_21/bin/../jre/lib/i386;C:\Program Files\Java\jdk1.6.0_21\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Common Files\Lenovo;C:\Windows\Tools\Wintools;
12 May, 2011 6:54:04 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Example' did not find a matching property.
12 May, 2011 6:54:04 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
12 May, 2011 6:54:04 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 342 ms
12 May, 2011 6:54:04 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
12 May, 2011 6:54:04 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
12 May, 2011 6:54:04 PM org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
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.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:928)
at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:193)
at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1138)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.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.tomcat.util.digester.Digester.parse(Digester.java:1642)
at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:365)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1076)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4540)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
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.IllegalArgumentException: Invalid <url-pattern> /*.action in filter mapping
at org.apache.catalina.core.StandardContext.addFilterMap(StandardContext.java:2459)
... 37 more
12 May, 2011 6:54:04 PM org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Parse error in application web.xml file at jndi:/localhost/Example/WEB-INF/web.xml
java.lang.IllegalArgumentException: Invalid <url-pattern> /*.action in filter mapping
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2806)
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2832)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.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.tomcat.util.digester.Digester.parse(Digester.java:1642)
at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:365)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1076)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4540)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
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.IllegalArgumentException: Invalid <url-pattern> /*.action in filter mapping
at org.apache.catalina.core.StandardContext.addFilterMap(StandardContext.java:2459)
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.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:928)
at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:193)
at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1138)
... 29 more
12 May, 2011 6:54:04 PM org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Occurred at line 13 column 22
12 May, 2011 6:54:04 PM org.apache.catalina.startup.ContextConfig start
SEVERE: Marking this application unavailable due to previous error(s)
12 May, 2011 6:54:04 PM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
12 May, 2011 6:54:04 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/Example] startup failed due to previous errors
Step7:I checked mailing list of apachestruts best practice for URL pattern and found some suggestion i.e to change the existing <url-pattern>/*.action</url-pattern> to <url-pattern>*.action</url-pattern> and then on running the application resulted as follows:
2 May, 2011 6:58:04 PM 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\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jdk1.6.0_21/bin/../jre/bin/client;C:/Program Files/Java/jdk1.6.0_21/bin/../jre/bin;C:/Program Files/Java/jdk1.6.0_21/bin/../jre/lib/i386;C:\Program Files\Java\jdk1.6.0_21\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Common Files\Lenovo;C:\Windows\Tools\Wintools;
12 May, 2011 6:58:05 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Example' did not find a matching property.
12 May, 2011 6:58:05 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
12 May, 2011 6:58:05 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 349 ms
12 May, 2011 6:58:05 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
12 May, 2011 6:58:05 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
12 May, 2011 6:58:05 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
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:4001)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4651)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
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)
12 May, 2011 6:58:05 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
12 May, 2011 6:58:05 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/Example] startup failed due to previous errors
Step8:even tried by changing<url-pattern>*.action</url-pattern> to standard <url-pattern>/*</url-pattern> and even then above error is observed.

Please kindly check this and respond at the earliest.
Note: Not included entire source code as it is already available in Net at http://www.infoq.com/articles/migrating-struts-2-part3.

Expecting Help from experts and Thanks a lot for reading my post i.e for your valuable time.

I check for existing posts but none served my purpose so, posted finally after 2 day long struggle to crack the mystery.
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

12 May, 2011 6:54:04 PM org.apache.tomcat.util.digester.Digester endElement

It's clearly saying there is problem in the configuration file. (web.xml) or (struts.xml)


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
sitaramaraju psn
Greenhorn

Joined: Dec 22, 2008
Posts: 3
Your right . but that was resolved when i performed Step 7 that you are mentioning in your post but still the console shows the error that is posted under step7.



i knew where the issue probably lies thats why I tried by all possible url patterns in web.xml but still not able to understand how to resolve the issue.As this example contains both Struts,Struts2 implementation in same project it had Struts.xml for Struts2 and also struts-config.xml for struts so I had not changed anything after importing into Eclipse and I clearly mentioned the changes I made in web.xml to the downloaded content.

I'm Dam new to Web development and novice to Struts2 Framework but curious to learn please help and would be indebted for your help.

I urge any one to deploy the zip available @http://www.infoq.com/articles/migrating-struts-2-part3 into an eclipse to resolve the Issue.

I knew what i am begging you is Your valuable time .I choose this example as it is simple and gives clear picture of Struts building blocks in details and this zip contains code of same example in both Struts and Struts2


try,try,try till you succeed................................

Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

specify, what are the files you are included in the project. Expecting struts2-core-2.x.xxx.jar file is missing.
sitaramaraju psn
Greenhorn

Joined: Dec 22, 2008
Posts: 3


I added all the jars mentioned in pom.xml but struts2-core vesrion i added is 2.1.6 and xwork is 2.1.2 and these version are latest to the specified versions in pom.xml
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception starting filter struts2
 
Similar Threads
Web.xml not found
Getting error----NoContextLoaderListener registered
Getting 404 error while running Struts application
404 error while compiling the servlet
"HTTP Status 404" error when starting tomcat