• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can't run Hello World Application  RSS feed

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,
I can't run a Hello World Application, here is the steps that I have followed, what did I miss ?
Versions used: Tomcat 8.5.24 - Struts 2.5.14.1 - Eclipse Neon 3 Release 4.6.3

Step 1
Creating a new Dynamic Web Project

Step 2
Adding Struts 2 to java build path as a user defined library, the external jars included list is:
commons-fileupload
commons-io
commons-lang
commons-lang3
commons-logging
freemarker
javassist
ognl
struts2-core

Step 3
Editing /WEB-INF/web.mxl

Step 4
Adding /HelloWorld.jsp

Step 5
Adding src/com.company.struts2.actions.HelloWorldAction.java

Step 6
Adding /src/struts.xml

Step 7
Testing the project, the internal web browser of eclipse can't find the resource!

HTTP Status 404 - Not Found
Type Status Report
Message /Struts2Starter/helloworld
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/8.5.24


The console reports this error: java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
The markers tab show this warning: Classpath Dependency Validator Message

Description Classpath entry org.eclipse.jdt.USER_LIBRARY/Struts 2 Framework will not be exported or published. Runtime ClassNotFoundExceptions may result.


When I fixed this by adding Struts 2 to be exported in /WEB-INF/lib tomcat failed to start with the error message Could not launch in profiling mode because no profilers are configured.

That's all, and thank's for help.
 
Bartender
Posts: 9481
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Lahouari Bendriss wrote:
The console reports this error: java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter



This error tells us that the web container either can't find Struts or one of its dependencies.

Lahouari Bendriss wrote:
When I fixed this by adding Struts 2 to be exported in /WEB-INF/lib tomcat failed to start with the error message Could not launch in profiling mode because no profilers are configured.



That sounds like you are attempting to start Tomcat through Eclipse using a profiler plugin like TPTP, but you haven't set up TPTP correctly.

Learning how to program while simultaneously learning how to use an IDE is a big learning curve.  I'd recommend simplifying things and working with a text editor and the command line to start.  Try the first 3 steps in the Tomcat manual, then, once you have that working, try adding Struts to that application.  Once you are comfortable with that, try it in an IDE.
 
Lahouari Bendriss
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Joe Ess for your try.
I have succeed to run my application by changing the included struts 2 jars. I have used only the essentials dependencies pack: http://www-us.apache.org/dist/struts/2.5.14.1/struts-2.5.14.1-min-lib.zip which contains the following jars:
commons-fileupload
commons-io
commons-lang3
freemarker
javassist
log4j
ognl
struts2-core
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!