• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File not found error

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is struts.xml filw


this is web.xml


this is Struts2HelloWorld.java file


this is HolloWorld.jsp


struts.xml file is in src folder
HelloWorld.jsp file is in WebContent folder
I am using Eclips as a IDE.

when i type this url
http://localhost:8080/struts2tutorial/HelloWorld

it gives this error



 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see any error that says a file wasn't found; are you sure you posted the right code?

In any case, which version of Struts 2 are you using? You're asking for an extension-less URL, which is not turned on by default in earlier versions of S2.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is print in console
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure would have been a lot quicker to post that in the first place.

You're missing commons-fileupload (or whatever it's called) and possibly commons-io.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using this tutorials.
look at this part

and the Struts2HelloWorld.java file



it says create directory structure struts2tutorial\WEB-INF\src\java\net\roseindia and put java file here.
then how the package become "package net.roseindia"
it shouold be java.net.roseindia;
is it?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.

Please start new threads for new topics.

The answer to your question is "it depends".
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i change my project
this is my web.xml


this is my struct.xml file


this is HelloWorld.jsp


this is java file


HelloWorld.jsp is in WebContent
Struts2HelloWorld.java file is in package called my
struct.xml and web.xml files are in WEB-INF.

i have added all jar files too.
but when i type
my\Struts2HelloWorld.java
it gives

but there is no any error in console or server.
i have screenshot also.But someone says don't add screenshot as a URL.So i am not added here.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
screenshot is here as a attachment.
err.GIF
[Thumbnail for err.GIF]
Error
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand what additional information you think you've provided.

You still don't have the libraries. Please don't post screenshots to show error messages.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyway i try to attach my project as a war file.But it is unable.
i uploaded my war file a site and i can give a link.
Is it ok post a my link.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no need--you're still not including the required libraries if that screenshot is correct.

I don't understand why you can't get a directory listing of the libraries you have in the project and just cut-and-paste it into a post.
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a lot of typographical errors in your post, so it's hard to tell what is a typo and what is an actual mistake. However, I noticed that you said you placed your struct.xml file in the WEB-INF directory. I have two comments:
1. The file should be named struts.xml (I expect that was just a typo);
2. The file should be accessible on the application's classpath. A simple way to achieve this is to place it in the WEB-INF/classes directory.

Best Regards,
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is a screenshot as a attachment.
But when i try http://localhost:8080/My/index.jsp it is working.

but if i try http://localhost:8080/struts2tutorial/HelloWorld it gives error.
sc.GIF
[Thumbnail for sc.GIF]
sc
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
STOP POSTING SCREENSHOTS.

You *still* do not have the libraries I told you you needed.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my struts.xml file


my struts.xml file is in WEB-INF/classes folder
then should i need to add this



 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Sure would have been a lot quicker to post that in the first place.

You're missing commons-fileupload (or whatever it's called) and possibly commons-io.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
still i have error.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post a *text* list of the libraries you are deploying.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
commons-fileupload
commons-logging-1.1
freemarker-2.3.8
ognl-2.6.11
struts2-core-2.0.6
struts2tutorial
xwork-2.0.1
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is commons-io?

Is devMode turned on? Is logging turned up to DEBUG?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic