Forums Login/signup

The origin server did not find a current representation for the target resource or is not willing to

+Pie Number of slices to send: Send
hi Can you help me out. I am following a tutorial - https://www.youtube.com/watch?v=n6L7uX-o930&list=PL73qvSDlAVVhIVQX7d36glpQllxCIxEyR&index=7, which asks to create an index.xhtml page. I have followed all the instructions but I keep getting the following error - "the origin server did not find a current representation for the target resource or is not willing to disclose that one exists." Below you will find the web.xml I am using. I make the call to the webpage using : http://localhost:8080/PlantPlaces and then get the error

J2EE
Java 1.8
JRE 1.8
web.xml - see below
index.xhtml - see below

Web.xml


index.xhtml:


Any help is appreciated.

Thanks


Sakir
+Pie Number of slices to send: Send
Let me move this to the JSF forum.
+Pie Number of slices to send: Send
Pasting raw code in the message forum is hazardous. Not only is it hard to read, but also the message formatter can garble things. There's a "Code" button that you can use to insert special tags that tell the Ranch to handle things like that.

I'm going to apply Code Tags to your examples, so you can see what I mean (and so that we can better read them!).
+Pie Number of slices to send: Send
OK. Housekeeping is done. Welcome to the Ranch!

Are you using the Tomcat webapp server? That message should have been displayed on a "404 - Not Found" webpage.

If you could tell me what the "Message" line says, it would help.
+Pie Number of slices to send: Send
Hi Tim

Thankyou for getting back to me. I am using tomcat 9.0 and yes i get a 404 message with the description "The origin server did not find a current representation for the target resource or is not willing to..."

Let me know if you need any further information.

Kind regards

Sakir
+Pie Number of slices to send: Send
 

Tim Holloway wrote:
If you could tell me what the "Message" line says, it would help.

 
+Pie Number of slices to send: Send
HI Tim,

I have uploaded a pic of the error message to this post. I hope you can see it. Below is the "Message" part of the Http 404 error:

Message : /PlantPlaces/

Thanks

Sakir
Error-Message.png
Error message showing the full text
[Thumbnail for Error-Message.png]
+Pie Number of slices to send: Send
I just needed the Message, not the picture, but now I know.

Most likely, then, the entire webapp cannot be found. For Tomcat to be able to locate a webapp (and its resources), the webapp must be constructed in the form of a WAR and made visible to Tomcat. The simplest way to deploy, then, is to create a WAR file and copy it into the TOMCAT_HOME/webapps/ directory. If your WAR file is named "PlantPlaces.war", then Tomcat would find it, unzip ("explode") it to create a TOMCAT_HOME/webapps/PlantPlaces directory subtree, and resolve any URLs send to http://localhost:8080/PlantPlaces. There are several alternate ways to deploy WARs as well, but this is the simplest. Note that upper/lower case in both filenames and URLs is critical. You can't name a WAR "plantplaces" and expect to find it at http://localhost:8080/PlantPlaces, nor the reverse. Windows users can find this especially confusing, since Windows itself doesn't care about upper/lower case in filename, but Java does.
+Pie Number of slices to send: Send
Hi Tim,

I Created the War file and copied it to the Tomcat_Home/webapp/PlantPlaces directory as you suggested. Then used the url - http://localhost:8080/PlantPlaces/ to access it (even tried - http://localhost:8080/PlantPlaces) but both urls gave the same error as before.

Any further suggestions are really appreciated.

Kind Regards

Sakir
War-file-deploy-path.png
[Thumbnail for War-file-deploy-path.png]
+Pie Number of slices to send: Send
You don't copy it into the PlantPlaces directory, you copy the war into the webapp directory.
+Pie Number of slices to send: Send
 

Dave Tolls wrote:You don't copy it into the PlantPlaces directory, you copy the war into the webapp directory.



What he said!
+Pie Number of slices to send: Send
Hi Tim/Dave,

I tried copying the war file into the webapps directory and it still did not work. I do not know how to progress from this. Can you suggest any thing else?

Kind Regards

Sakir
+Pie Number of slices to send: Send
So, what does your directory structure look like now?

reply
reply
This thread has been viewed 26098 times.
Similar Threads
The origin server did not find a current representation for the target resource
JSF Hello World program not working
Help with Simple Java EE Facelets Composite Application
doesn't show up bean's attributes in .xhtml
Don't work any jfs scripts
More...

All times above are in ranch (not your local) time.
The current ranch time is
Jun 27, 2025 20:41:32.