Ich bekomme die oben genannte Fehlermeldung beim Versuch, GET-Methode auf Benutzer Ressource aufrufen: http://localhost:8080/Trempiada/users/12345. Oder geben Sie einfach die Haupt-URI des Projekts ein: http://localhost:8080/Trempiada. Ich habe Spring's Listener für DI und der Tomcat-Server lädt ohne Ausnahme. Hier ist meine web.xml-Datei:Die angeforderte Ressource ist nicht verfügbar (HTTP 404) - Jersey und Spring Integration
<?xml version="1.0" encoding="UTF-8"?>
<!-- This web.xml file is not required when using Servlet 3.0 container,
see implementation details http://jersey.java.net/nonav/documentation/latest/jax-rs.html -->
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<!-- Configure ContextLoaderListener to use JavaConfigWebApplicationContext
instead of the default XmlWebApplicationContext -->
<context-param>
<param-name>contextClass</param-name>
<param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
</context-param>
<!-- Configuration locations must consist of one or more comma- or space-delimited
fully-qualified @Configuration classes -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>org.sharon.trempiada.resources.ResourcesConfiguration org.sharon.trempiada.services.ServicesConfiguration</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>trempiada</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>org.sharon.trempiada.resources</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>trempiada</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
Was soll ich überprüfen und wo könnte das Problem sein?
löste mein Problem. Ich habe nicht bemerkt, dass die Groß-/Kleinschreibung beachtet wird (Trempiada! = Trempiada), und ich dachte, dass der Kontext auf dem Webapp-Namen basiert, wie er unter der Registerkarte "Servers/Tomcat" in Eclipse angezeigt wird. – sharon182