permaculture playing cards*
The moose likes Struts and the fly likes File not found error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "File not found error" Watch "File not found error" New topic
Author

File not found error

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jan 08, 2010
Posts: 510
this is print in console
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jan 08, 2010
Posts: 510
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

Joined: Sep 29, 2008
Posts: 12617

You're welcome.

Please start new threads for new topics.

The answer to your question is "it depends".
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
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

Joined: Jan 08, 2010
Posts: 510
screenshot is here as a attachment.



[Thumbnail for err.GIF]

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jan 08, 2010
Posts: 510
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Apr 01, 2009
Posts: 643
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

Joined: Jan 08, 2010
Posts: 510
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.



[Thumbnail for sc.GIF]

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

STOP POSTING SCREENSHOTS.

You *still* do not have the libraries I told you you needed.
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jan 08, 2010
Posts: 510
still i have error.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please post a *text* list of the libraries you are deploying.
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
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

Joined: Sep 29, 2008
Posts: 12617

Where is commons-io?

Is devMode turned on? Is logging turned up to DEBUG?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File not found error