0

I know that there are previous questions that ask the same but I still couldn't find the right solution. I am getting: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. I am using a Tomcat server.

Could someone please help me, the following is my project structure:

project structure.

Adil B
  • 14,635
  • 11
  • 60
  • 78
Bernard Mizzi
  • 49
  • 1
  • 1
  • 8
  • see https://stackoverflow.com/questions/43186315/tomcat-404-error-the-origin-server-did-not-find-a-current-representation-for-th – George Birbilis Mar 31 '18 at 23:44

6 Answers6

2

I was stuck into this problem for a month.

Finally, I figured out that in Eclipse, "Build Automatically" was not set, and I was trying to run my servlet.java file without any servlet.class file, since I wasn't building my project.

The thing which worked for me is to

first build the project => restart the server => run the server on servlet.

Hope it helps!!

Deepam Gupta
  • 2,374
  • 1
  • 30
  • 33
0

I was running into a similar problem, where my package name was wrong. I fixed the package name and fixed the problem.

Please check your configuration snippet in the web.xml file.

Also, for a cleaner structure, you can create a new folder "jsps" under WEB_INF and move the .jsp files into the same.

0

The following scenario is explained with the name of the project as abcd, and the port as 8080. The folder WebContent will be inside folder abcd.

In application.properties, add your path

upload.path=C:/.........../abcd/WebContent/

If the last slash after WebContent is ignored, then uploaded files are saved at abcd and not in WebContent (which is inside abcd).

Now, say, there is 1.JPG inside WebContent. If I have to access it, then in my browser ,I have to put URL as http://localhost:8080/abcd/1.JPG

Having the URL as http://localhost:8080/abcd/1.jpg wont work (note the small case alphabets of .jpg)

Also make sure that the file 1.JPG is visible inside WebContent in abcd in IDE (in my case, it was Spring Tool Suite). Else refresh the project from the IDE.

Now, if the file 1.JPG is inside abcd/WebContent/new/1.JPG, then the URL will be http://localhost:8080/abcd/new/1.JPG

Rishaba Jain
  • 11
  • 1
  • 1
0

I faced this issue once when there was a runtime exception in the code block of ContextLoaderListener.

public class YourApplicationContenxtLoaderListener extends ContextLoaderListener{
@Override
public void contextInitialized(ServletContextEvent event){
            /* There should not be any exception/error in this block , as it would impact the context initialization by tomcat server for respective war file. */
}

}

Vishy Anand
  • 93
  • 1
  • 10
  • If you want to scan maybe you don't know the ssid but you want to find. This answer will give you details of the ssid you put in. I think the point in the question is that he wants to find which hidden ssid are in range of my station. – louigi600 Sep 20 '21 at 07:37
0

I encountered this problem on an Azure WebApp running on Java 11 and Tomcat 9.0.

I changed the Java Web Server version from Apache Tomcat 9.0 (auto update) to Apache Tomcat 9.0.20, and then the server worked.

enter image description here

gordon613
  • 2,770
  • 12
  • 52
  • 81
-1

here is the solution for your query, Simply follow these steps: go to project properties settings type demployment and assembly settings then click on add folder then and add the webcontent folder to your project, click apply and close then run the project

I hope your problem will be solved.

Max
  • 2,561
  • 1
  • 24
  • 29
  • Can you add some punctuation to your answer, so users can understand you better, please? – Max Sep 23 '20 at 07:07