This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
If you can see above message, Congrats! You have successfully created your first Struts 2 application.
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?
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.)
Joined: Mar 31, 2009
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!
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.
You need to check the Tomcat Logs... I'm using Tomcat 7
Dec 12, 2011 8:07:30 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter <project name>
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
... 26 more
The fix is just to include the commons-lang-2.5 JAR
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.