• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error filterStart

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> 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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having the sameproblem and none of the solutions above are working
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Ranch Hand
Posts: 86
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where did you download the libraries from? The .jar files.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
I had the same problem. I resolved when I removed the jars that I wasn't using. This worked with me.
 
Ranch Hand
Posts: 300
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic