This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Error filterStart 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 "Error filterStart" Watch "Error filterStart" New topic
Author

Error filterStart

Marc Brevoort
Greenhorn

Joined: Mar 31, 2009
Posts: 3
Hello World,

I'm trying to get a simple Hello World application up and running.
However, every time I try to deploy it, I'm getting an error message
Error filterStart:

31-Mar-2009 12:56:51 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-default.xml]
31-Mar-2009 12:56:51 org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
31-Mar-2009 12:56:51 org.apache.catalina.core.StandardContext start
SEVERE: Context [/HelloWorld] startup failed due to previous errors
31-Mar-2009 12:57:51 org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/HelloWorld]
31-Mar-2009 12:57:51 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive HelloWorld.war
31-Mar-2009 12:57:52 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-default.xml]
31-Mar-2009 12:57:52 org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
31-Mar-2009 12:57:52 org.apache.catalina.core.StandardContext start
SEVERE: Context [/HelloWorld] startup failed due to previous errors

The following jars are in my classpath:

commons-beanutils-1.7.0.jar
commons-collections-3.2.jar
commons-digester-1.8.jar
commons-io-1.3.2.jar
commons-lang-2.3.jar
commons-logging-1.1.1.jar (version included in 2.1.6 package didn't work either)
commons-logging-api-1.1.jar
freemarker-2.3.13.jar
json-lib-2.1.jar
ognr-2.6.11.jar
oro-2.0.8.jar
plexus-utils-1.2.jar
sitemesh-2.3.jar
spring-context-2.5.3.jar
struts2-core-2.1.6.jar
struts2-javatemplates-plugin-2.1.6.jar
struts2-sitemesh-plugin-2.1.6.jar
struts2-tiles-plugin-2.1.6.jar
tiles-api-2.0.6.jar
tiles-core-2.0.6.jar
tiles-jsp-2.0.6.jar
xstream-1.2.2.jar
xwork-2.1.2.jar

This is my web.xml:

<web-app id="WebApp_ID" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>HelloWorld</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.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>

and my 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" />
<package name="tutorial" namespace="/www" extends="struts-default">
<action name="HelloWorld" class="tutorial.HelloWorld">
<result>/HelloWorld.jsp</result>
</action>
</package>
</struts>

And Helloworld.jsp:
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Struts 2 - Hello World tutorial</title>
</head>

<body>
<h2><s:property value="message"/></h2>
If you can see above message, Congrats! You have successfully created your first Struts 2 application.
</body>
</html>

The only clue I have left is the line
INFO: Parsing configuration file [struts-default.xml]
in the log file, as I don't understand what this xml file
is about. I've been hunting about for missing jar files
but I think I've got all the needed ones included by now.

As I've been at 'hello world' for nearly a week,
I am getting ever so slightly frustrated by now.
'Error filterStart' is not very informative, is there a
more effective way to see what's wrong?

Best,
Marc
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Turning on devMode and setting the logging levels to debug is almost always the best and easiest place to start.

You're missing commons-fileupload, which is now a requirement, even if you're not uploading files.

I'm generally wary of including unnecessary plugins (here, SiteMesh) if you're not actually using it. You shouldn't need the spring-context jar if you're not using Spring. If you *are* using Spring, you'll need more than that, and probably want the Struts 2 Spring plugin.

Managing dependencies by hand is... problematic, and I don't really recommend it. A simple "hello, world" app, however, really only needs: commons-io, commons-fileupload, commons-logging (both), freemarker, ognl, struts2-core, and xwork. (Might need beanutils and collections, but I don't think so).

Note that there are several dependency browsers available both standalone and online. For example, see here for Struts 2.1.6-core dependencies. (According to that you don't need commons-logging, too, but I've never used S2 w/o it, so I have no idea. In general I usually recommend putting a logging package in there too, like Log4J or SLF4J or whatever.)
Marc Brevoort
Greenhorn

Joined: Mar 31, 2009
Posts: 3
A simple "hello, world" app, however, really only needs: commons-io, commons-fileupload, commons-logging (both), freemarker, ognl, struts2-core, and xwork.


Indeed. I threw away all jars and re-included just those and that solved it. Thank you very much!
ketan bhavsar
Greenhorn

Joined: May 06, 2009
Posts: 2
Hi, all I am having same problem. I have also removed all unnecessary jars but the problem still remain.

I have used jars

commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-logging-1.1.1.jar
freemarker-2.3.13.jar
ognl-2.6.11.jar
struts2-core-2.1.6.jar
xwork-2.1.2.jar

also added and removed commons-logging-api.jar for checking weather it is running by this trial and error or not. But it is still not working.

Any one please help me.
ketan bhavsar
Greenhorn

Joined: May 06, 2009
Posts: 2
Hi, all I am having same problem. I have also removed all unnecessary jars but the problem still remain.

I have used jars

commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-logging-1.1.1.jar
freemarker-2.3.13.jar
ognl-2.6.11.jar
struts2-core-2.1.6.jar
xwork-2.1.2.jar

also added and removed commons-logging-api.jar for checking weather it is running by this trial and error or not. But it is still not working.

Any one please help me.
Marc Brevoort
Greenhorn

Joined: Mar 31, 2009
Posts: 3
> Hi, all I am having same problem. I have also removed all unnecessary jars but the problem still remain.

Obviously you're using the right JAR files (by the way, I managed to get things running in the end)

If things aren't working, probably your application isn't finding them.
Take a look at your classpath settings.

Also, take some time looking at the .war file that is being generated; a .war file is simply
a zipped archive, and you should be able to see if all required jar files have been
included in there.

Best,
Marc
shree kodali
Greenhorn

Joined: Jul 03, 2009
Posts: 1
Hi All,

I was able to resolve that issue after seeing the tomcat log details. Actual problem relies here

1) There are two struts.xml & example.xml files in the classpath, so it is unable to start an application properly.
problem message in loggers :- Caused by: The package name 'roseindia' at location package -....... is already been used by another package at location package - .....
console message :- Error filterStart:
solution :- you can comment out the jar command of compile tag in the build.xml, so that there will be only one distinct files/package.
2) after that check the required jar files, if we wont get any result and errors,
solution: you just keep the jars mentioned in the struts2-blank.zip.

By following the above steps , I was able to resolve the issues.

Thanks
Shrik
Navneet Yadav
Greenhorn

Joined: May 29, 2011
Posts: 3
I am having the sameproblem and none of the solutions above are working
justin cj
Greenhorn

Joined: Nov 03, 2011
Posts: 1
could download struts-x.x.x.x-apps.zip and check the sample apps within the zip. You can find the necessary jars for your struts version there.
Ryan Rivera
Greenhorn

Joined: Nov 29, 2006
Posts: 1
For simple hello world...

You need to check the Tomcat Logs... I'm using Tomcat 7

<Tomcat>\logs\localhost.YYYY-MM-DD


Dec 12, 2011 8:07:30 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter <project name>
java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:198)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:180)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
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:4624)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5281)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
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.lang.StringUtils
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
... 26 more

The fix is just to include the commons-lang-2.5 JAR

Yuta Lolap
Ranch Hand

Joined: Jun 03, 2012
Posts: 80

Where did you download the libraries from? The .jar files.
Erick Alves
Greenhorn

Joined: Sep 03, 2012
Posts: 1
Hi guys,
I had the same problem. I resolved when I removed the jars that I wasn't using. This worked with me.
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi All,

You need to check for the right version .. you can check it from the manifest.mf file where the version of the jar is specified as it might be possible that the jar you are downloading is with the wrong tag.

Also, If you are not able to solve the problem post the code with list of jar and log file here.
Regards
Jatan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error filterStart
 
Similar Threads
Unable to load configuration-struts2
Error in Struts2 application
First Struts Application + Unable to load configuration
Struts2 and JBoss 5.0.0Beta2
Exception in Struts2