• 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

Can't run Hello World Application

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic