• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Saloon Keeper
Posts: 24295
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let me move this to the JSF forum.
 
Tim Holloway
Saloon Keeper
Posts: 24295
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!).
 
Tim Holloway
Saloon Keeper
Posts: 24295
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
sakir syed
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Tim Holloway
Saloon Keeper
Posts: 24295
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

 
sakir syed
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Error message showing the full text
 
Tim Holloway
Saloon Keeper
Posts: 24295
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
sakir syed
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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]
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't copy it into the PlantPlaces directory, you copy the war into the webapp directory.
 
Tim Holloway
Saloon Keeper
Posts: 24295
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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



What he said!
 
sakir syed
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Dave Tolls
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So, what does your directory structure look like now?
 
reply
    Bookmark Topic Watch Topic
  • New Topic