Win a copy of Functional Design and Architecture this week in the Functional programming forum!
  • 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

 
Ranch Hand
Posts: 817
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear experts,

I run into this error which I have been solving for hours but to no avail.

Hope someone can give m a clue how to diagnose on this problem and how to go about resolve the error.

The error is :

HTTP Status 404 - Not Found
The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

This is the first time I got this error.  Please help.
Tks.
 
Saloon Keeper
Posts: 7089
165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems you forgot to tell us anything at all about the context in which you saw this message.
 
author & internet detective
Posts: 40746
827
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
404 means page not found. So you have the wrong URL, your page isn't up, your app isn't started. It could be anything. We will need more info to be helpful.
 
tangara goh
Ranch Hand
Posts: 817
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:It seems you forgot to tell us anything at all about the context in which you saw this message.



Sorry but here's the infor :

Eclipse Neon 3
Java 8
Java EE 3.0
Tomcat 8.0.25

Here's my web.xml :


jsp :

<form name="tutorRegister" method="POST" action="${pageContext.request.contextPath}/addTutor" id="contactForm" novalidate>

Sevlet ;


@WebServlet("/tutorController")
public class tutorController extends HttpServlet {


Hope you could tell me where have I gone wrong.

Tks.  
 
Tim Moores
Saloon Keeper
Posts: 7089
165
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which URL are you trying to access? What is the name of the web app?
 
Marshal
Posts: 22441
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your form action is /addTutor but you haven't defined it anywhere. Your servlet is mapped to /tutorController, and you don't have any servlets in your web.xml file.
 
tangara goh
Ranch Hand
Posts: 817
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Spoor wrote:Your form action is /addTutor but you haven't defined it anywhere. Your servlet is mapped to /tutorController, and you don't have any servlets in your web.xml file.



Hi Rob,

From my understanding, if Java EE 3.0 and above is used, as in my case, then there is no need to define servlet in web.xml.

Can you tell me where about should I put /addTutor in the web.xml ?

Hope to hear from you soon.

 
Tim Moores
Saloon Keeper
Posts: 7089
165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't need to add anything, but you do need to have matching names - either "addTutor" or "tutorController", but not declaring one and then using the other.
 
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

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">
 <display-name>PlantPlaces</display-name>
 <welcome-file-list>
   <welcome-file>index.xhtml</welcome-file>
   <welcome-file>index.html</welcome-file>
   <welcome-file>index.htm</welcome-file>
   <welcome-file>index.jsp</welcome-file>
   <welcome-file>default.html</welcome-file>
   <welcome-file>default.htm</welcome-file>
   <welcome-file>default.jsp</welcome-file>
 </welcome-file-list>
 <servlet>
   <servlet-name>Faces Servlet</servlet-name>
   <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
   <load-on-startup>1</load-on-startup>
 </servlet>
 <servlet-mapping>
   <servlet-name>Faces Servlet</servlet-name>
   <url-pattern>/faces/*</url-pattern>
   <url-pattern>*.xhtml</url-pattern>
 </servlet-mapping>
 <context-param>
   <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
   <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
   <param-value>client</param-value>
 </context-param>
 <context-param>
   <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
   <param-value>resources.application</param-value>
 </context-param>
 <listener>
   <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
 </listener>
</web-app>


index.xhtml:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Plant Places.com</title>
</head>
<body>
<h1>Welcome to PlantPlaces.com</h1>
Promoting plant diversity through education

</body>
</html>

Any help is appreciated.

Thanks


Sakir
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic