IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

GWT et Vaadin Java Discussion :

HTTP ERROR: 404 servlet mapping


Sujet :

GWT et Vaadin Java

  1. #1
    Membre régulier
    Profil pro
    Inscrit en
    avril 2002
    Messages
    210
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : avril 2002
    Messages : 210
    Points : 87
    Points
    87
    Par défaut HTTP ERROR: 404 servlet mapping
    Bonjour
    je suis en train de suivre un tutoriel pour apprendre GWT, et quand je fais tourner l'appli j'ai cette erreur :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    Please enter employee sssinfo (id name surname job):
        SaveOrUpdate
    Please enter employee id:
        Retrieve
     
    Remote Procedure Call - Failure
    Sending request to the server:
    10 11 12 13
     
    Server replies:
    An error occurred while attempting to contact the server. Please check your network connection and try again. The error is : com.google.gwt.user.client.rpc.StatusCodeException:
    HTTP ERROR: 404
     
    NOT_FOUND
    RequestURI=/employeeService
     
    Powered by Jetty://
    Pourtant j'ai bien suivi les instruction mais rien a faire .

    Voici le code que je teste :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    @RemoteServiceRelativePath("/employeeService")
    public interface EmployeeService extends RemoteService {
     
        public EmployeeDTO findEmployee(long employeeId);
        public void saveEmployee(long employeeId, String name, String surname, String jobDescription) throws Exception;
        public void updateEmployee(long employeeId, String name, String surname, String jobDescription) throws Exception;
        public void saveOrUpdateEmployee(long employeeId, String name, String surname, String jobDescription) throws Exception;
        public void deleteEmployee(long employeeId) throws Exception;
     
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    @Service("employeeService")
    public class EmployeeServiceImpl extends RemoteServiceServlet  implements EmployeeService {
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    private EmployeeServiceAsync getEmployeeServiceInstance() {
            if (employeeService == null) {
                // Instantiate the service
                employeeService = (EmployeeServiceAsync) GWT
                        .create(EmployeeService.class);
     
                // Specify the URL at which the service implementation is running.
                // The target URL must reside on the same domain and port from
                // which the host page was served.
                ((ServiceDefTarget) employeeService).setServiceEntryPoint("/employeeService");
     
            }
            return employeeService;
        }

    merci d'avance

  2. #2
    Membre actif
    Profil pro
    Inscrit en
    janvier 2006
    Messages
    165
    Détails du profil
    Informations personnelles :
    Localisation : France, Rhône (Rhône Alpes)

    Informations forums :
    Inscription : janvier 2006
    Messages : 165
    Points : 244
    Points
    244
    Par défaut
    Comment sont organisés tes packages?

    Que contient ton fichier web.xml?

  3. #3
    Membre régulier
    Profil pro
    Inscrit en
    avril 2002
    Messages
    210
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : avril 2002
    Messages : 210
    Points : 87
    Points
    87
    Par défaut
    le tuto que je fais c'est :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    http://www.javacodegeeks.com/2010/07/gwt-2-spring-3-jpa-2-hibernate-35.html
    pour mes packages

    com.javacodegeeks.gwtspring
    com.javacodegeeks.gwtspring.server.dao
    com.javacodegeeks.gwtspring.server.services
    com.javacodegeeks.gwtspring.shared.dto
    com.javacodegeeks.gwtspring.shared.services


    voici mon web.xml

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    <!DOCTYPE web-app PUBLIC
     "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
     "http://java.sun.com/dtd/web-app_2_3.dtd" >
     
    <web-app>
        <display-name>GWT-Maven-Archetype</display-name>
     
        <listener>
            <listener-class>
                org.springframework.web.context.ContextLoaderListener
        </listener-class>
        </listener>
     
        <servlet>
            <servlet-name>springGwtRemoteServiceServlet</servlet-name>
            <servlet-class>org.spring4gwt.server.SpringGwtRemoteServiceServlet
        </servlet-class>
        </servlet>
        <!-- Servlet Definitions -->
        <servlet>
            <servlet-name>employeeService</servlet-name>
            <servlet-class>com.javacodegeeks.gwtspring.server.services.EmployeeServiceImpl</servlet-class>
        </servlet>
     
        <servlet-mapping>
            <servlet-name>springGwtRemoteServiceServlet</servlet-name>
            <url-pattern>/com.javacodegeeks.gwtspring.Application/springGwtServices/*</url-pattern>
        </servlet-mapping>
     
        <!-- Servlet URL Mappings -->
        <servlet-mapping>
            <servlet-name>employeeService</servlet-name>
            <url-pattern>employeeService</url-pattern>
        </servlet-mapping>
     
     
        <welcome-file-list>
            <welcome-file>index.html</welcome-file>
        </welcome-file-list>
    </web-app>

  4. #4
    Membre actif
    Profil pro
    Inscrit en
    janvier 2006
    Messages
    165
    Détails du profil
    Informations personnelles :
    Localisation : France, Rhône (Rhône Alpes)

    Informations forums :
    Inscription : janvier 2006
    Messages : 165
    Points : 244
    Points
    244
    Par défaut
    Il semble que ton

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     <!-- Servlet URL Mappings -->
        <servlet-mapping>
            <servlet-name>employeeService</servlet-name>
            <url-pattern>employeeService</url-pattern>
        </servlet-mapping>
    ne soit pas bon.

    En GWT 2.x l'url pattern est de la forme /le-nom-de-ton-appli/le-nom-de-la-servlet

    Avec "le-nom-de-ton-appli" la valeur de l’attribut rename-to dans le fichier tonprojet.gwt.xml dans la balise module

  5. #5
    Rédacteur
    Avatar de benwit
    Profil pro
    dev
    Inscrit en
    septembre 2004
    Messages
    1 676
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : dev

    Informations forums :
    Inscription : septembre 2004
    Messages : 1 676
    Points : 4 198
    Points
    4 198
    Par défaut
    Je confirme ce que dis Galel.

    Remarques :

    Depuis que GWT a introduit l'annotation @RemoteServiceRelativePath
    Tu peux directement faire :
    private static final EmployeeServiceAsync service = GWT.create(EmployeeService.class);


    Ton annotation @Service, c'est pour Spring ?

    Tout le monde savait que c'était impossible. Il est venu un imbécile qui ne le savait pas et qui l'a fait. Marcel PAGNOL
    On ne savait pas que c'était impossible, alors on l'a fait. John Fitzgerald KENNEDY.
    L'inexpérience est ce qui permet à la jeunesse d'accomplir ce que la vieillesse sait impossible. Paul (Tristant) BERNARD
    La meilleure façon de prédire l'avenir, c'est de l'inventer.

  6. #6
    Candidat au Club
    Inscrit en
    mai 2008
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : mai 2008
    Messages : 2
    Points : 2
    Points
    2
    Par défaut
    Je penses que tu dois vérifier tes fichiers de conf spring et surtout:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
     
    <!-- Detects beans annotated with @Service et @Controller-->
     
    <context:component-scan
    base-package="pakage1, pakage2" use-default-filters="false">
     
    <!-- pour les @Service-->
    		<context:include-filter type="annotation"
    			expression="org.springframework.stereotype.Service" />
     
    <!-- pour les @Controller-->
    		<context:exclude-filter type="annotation"
    			expression="org.springframework.stereotype.Controller" />
     
    	</context:component-scan>

Discussions similaires

  1. HTTP Error 404.0 - Not Found
    Par Aquellito dans le forum IIS
    Réponses: 6
    Dernier message: 08/07/2013, 17h05
  2. [gwt] HTTP ERROR: 404 upload image
    Par dareman dans le forum GWT et Vaadin
    Réponses: 1
    Dernier message: 31/10/2010, 15h23
  3. HTTP Error 404 - File or Directory not found
    Par kince dans le forum IIS
    Réponses: 0
    Dernier message: 17/09/2007, 16h59
  4. Réponses: 2
    Dernier message: 22/11/2006, 17h12
  5. Etat HTTP 404 - Servlet action n'est pas disponible.???
    Par iftolotfi dans le forum Servlets/JSP
    Réponses: 3
    Dernier message: 05/05/2006, 14h44

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo