• 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

Resource not found

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,
I am new to struts 2. I did very small program using struts 2 it is saying requested resource not found error. I deplyed it using Apache tomcat.
My directory structure is

vino(root directory)
------web-inf
---------classes
------------Helloworld.class
------------struts.xml
---------lib
-----------commons-logging.jar
-----------freemarker.jar
-----------ognl.jar
-----------struts-core.jar
-----------xwork-core.jar
--------src
-----------Helloworld.java
--------web.xml
------index.jsp
------success.jsp

web.xml file


struts.xml


index.jsp


success.jsp


Helloworld.java


When i run it shows the requested resource not. Help me in this. Thanks
 
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
Check the startup logs. If nothing else, you're missing the commons-fileupload and commons-io libraries--but without specifics it's impossible to help further.
 
vinoth ramanathan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David Newton,
Thanks for your reply. I have included commons-fileupload and commons-io libraries. But still it is saying the

The requested resource (/vino/Helloworld) is not available.
when i call using http://localhost:8080/vino/Helloworld.


 
David Newton
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
Which version of Struts 2 are you using? Did you try "Helloworld.action"? Did you look at the startup logs?
 
vinoth ramanathan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I dont know how to check startup logs. Helloworld.action not working. using struts-core-1.3.10.jar but my struts-core-1.3.10.jar doesn't contain struts-taglib.jar. I dont know how to refer the struts-taglib in taglib tag and where to place the struts-taglib.jar file. will problem be there?
<%@ taglib prefix="s" uri="/struts-tags" %>
 
David Newton
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
I think the biggest problem will be thinking you're using Struts 2, but actually using Struts 1.3.

You need to know how to look at your log files before you continue.
 
vinoth ramanathan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

1. I don`t know how to refer the struts-tags in the taglib uri tag. and where to place the struts-taglib.jar in the directory structure
2.Can you give hint how to read startup logs.

Thanks.
 
David Newton
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
Did you read what I wrote? You claim you're using Struts 2--but the library you say you're deploying is Struts 1.3. What libraries are you deploying?

For Tomcat-specific questions, please post in the Tomcat forum... it's really, really important you know how to look at the log files.
 
vinoth ramanathan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David,
You were correct i changed the version of struts its working now, but now new problem comes when i put struts.xml file in
web-inf/classes/App/struts.xml it is showing index page
then when i send the request it is showing another error
There is no Action mapped for namespace / and action name Helloworld.
but when i put it in
web-inf/classes/struts.xml it is not displaying index.jsp itself and saying
requested resource not found error
 
David Newton
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
What libraries are you deploying? Is there anything in the logs? (I don't understand not being able to look at the logs.)
 
vinoth ramanathan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David

Log is showing

SEVERE: Exception starting filter struts2
Unable to load configuration. - file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/Example1/WEB-INF/classes/struts.xml:1:8

I am using the following library

commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-logging-1.0.4.jar
freemarker-2.3.15.jar
ognl-2.7.3.jar
struts2-core-2.1.8.1.jar
xwork-core-2.1.6.jar
 
David Newton
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
You need to show the entire stack trace.
 
vinoth ramanathan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David,
Above mentioned errors are cleared the new error araises
ERROR: There is no Action mapped for namespace / and action name Helloworld.

the stacktrace as follows


And this is my struts-config.xml
 
David Newton
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
Is there anything else in the logs?
 
Ranch Hand
Posts: 119
Oracle Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
iam also stucked here, getting the same error. i need to know where should i place my struts.xml

this is my struts.xml




and web.xml



i want to use struts2
 
Atul Darne
Ranch Hand
Posts: 119
Oracle Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a complete log is as below

 
reply
    Bookmark Topic Watch Topic
  • New Topic