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 :

Déploiement application GWT


Sujet :

GWT et Vaadin Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Février 2010
    Messages
    53
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2010
    Messages : 53
    Par défaut Déploiement application GWT
    Bonjour à tous,

    Voila, je developpe une application GWT avec serveur Spring/Hibernate.
    En development mode, tout fonctionne parfaitment, l'affichage, appels RPC, connection BDD, tout.

    Et pour deployer sur Tomcat... Bonjour la galère !

    Alors j'utilise Maven pour compiler mon projet et obtenir au final un war de l'application.
    Je deploie ce war sur Tomcat.

    Il m'affiche alors une LinkerError, comme quoi il y aurait une redefinition de classe. je me suis renseigné, et en fait GWT génère du code javax, dont il faut supprimer certaines classes. Je l'explique au cas ou ca pourrait poser problème pour la suite.

    Ensuite, je redémarre le serveur, et je relance l'application.

    Et la, 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
    javax.servlet.ServletException: La classe org.springframework.web.servlet.DispatcherServlet n'est pas une servlet
    	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
    	org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    	org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    	java.lang.Thread.run(Thread.java:619)
     
    cause mère
     
    java.lang.ClassCastException: org.springframework.web.servlet.DispatcherServlet cannot be cast to javax.servlet.Servlet
    	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
    	org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    	org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    	java.lang.Thread.run(Thread.j

    Le problème, c'est que je 'narrive pas du tout à m'en sortir !

    Est-ce que j'ai commis une faute dans mon processus ? Est-ce que ca vient de GWT ou de Spring (je configure mes appels RPC avec Spring au moyen d'un DispatcherServlet) ?

    Pourriez-vous m'aider ?

  2. #2
    Membre éclairé
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    54
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2008
    Messages : 54
    Par défaut
    Bonjour,

    Je comprends pas trop cette histoire de génération de code GWT et comme quoi tu devrais supprimer certaines classes. J'ai développé plusieurs applications spring/hibernate/maven/tomcat et je n'ai jamais eu ce genre problème... Tu pourrais être plus précis ?

    Pour en revenir à ton problème, est-ce que tu as des erreurs ou warning autre dans les logs de tomcat ? Je pense à un déploiement d'un servlet.jar avec une version différente de celle fourni par tomcat.

    Et tu utilises quelles versions de ces bibliothèques (spring, gwt, servlet...) ?

  3. #3
    Membre chevronné
    Profil pro
    Lead Tech Agile
    Inscrit en
    Septembre 2004
    Messages
    316
    Détails du profil
    Informations personnelles :
    Âge : 44
    Localisation : France

    Informations professionnelles :
    Activité : Lead Tech Agile

    Informations forums :
    Inscription : Septembre 2004
    Messages : 316
    Par défaut
    +1, moi aussi j'ai fait des projets spring/hibernate/maven/tomcat et je n'ai pas eu de soucis particulier.

    A mon avis ca n'est pas bon de supprimer des fichiers à la main.

    La procédure normale est de faire un mvn package et de balancer le war dans tomcat. C'est tout.

    Une erreur typique du couple GWT / Maven peut venir du fichier web.xml. Fais attention car le web.xml qui est copié dans le war n'est pas celui que tu as mis dans le war d'Eclipse. Mais celui qui se trouve dans les sources de ton projet.

    Tu as peut etre mis à jour le web.xml du war qui se trouve dans ton projet Eclipse, sans mettre à jour celui qui se trouve dans les sources de ton projet. Et du coup dans le war généré, le web.xml n'est pas bon et ca pourrait expliquer ton message.

  4. #4
    Membre averti
    Profil pro
    Inscrit en
    Février 2010
    Messages
    53
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2010
    Messages : 53
    Par défaut
    Rebonjour à tous, et merci de votre disponibilité.

    Pour ce qui est de la suppression des fichiers à la main, c'est ce qui m'a été conseillé comme résolution de mon premier problème.

    En effet, si je met le war dans le dossier webapps de tomcat, sans aucun changement, j'obtiens l'erreur suivante :


    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
    type Rapport d'exception
     
    message
     
    description Le serveur a rencontré une erreur interne () qui l'a empêché de satisfaire la requête.
     
    exception
     
    javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/jasper/servlet/JasperLoader) previously initiated loading for a different type with name "javax/servlet/http/HttpServletRequest"
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:268)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
     
    cause mère
     
    java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/jasper/servlet/JasperLoader) previously initiated loading for a different type with name "javax/servlet/http/HttpServletRequest"
    	java.lang.Class.getDeclaredMethods0(Native Method)
    	java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
    	java.lang.Class.getDeclaredMethods(Class.java:1791)
    	org.apache.catalina.util.DefaultAnnotationProcessor.processAnnotations(DefaultAnnotationProcessor.java:226)
    	org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:148)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

    Pour le web.xml, j'ai vérifié, c'est bien le bon web.xml qui a été mis en place.
    Le voici :

    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
    41
    42
    43
    44
    <?xml version="1.0" encoding="utf-8"?>
    <web-app version="2.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
    	xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
     
    	<listener>
    		<listener-class>com.novedia.ce.gwt.server.ClassPathContextListener</listener-class>
    	</listener>
     
    	<listener>
            <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
        </listener>
     
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>
    			classpath*:META-INF/spring/applicationContext*.xml
    		</param-value>
    	</context-param>
     
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
     
    	<!-- Delegate Filter to spring -->
     
    	<servlet>
    		<servlet-name>rpc</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<init-param>
    			<param-name>contextConfigLocation</param-name>
    			<param-value>/WEB-INF/spring/rpc-config.xml</param-value>
    		</init-param>
    	</servlet>
     
    	<servlet-mapping>
    		<servlet-name>rpc</servlet-name>
    		<url-pattern>*.rpc</url-pattern>
    	</servlet-mapping>
     
    	<welcome-file-list>
    		<welcome-file>ce.jsp</welcome-file>
    	</welcome-file-list>
     
    </web-app>
    Pourtant, lorsque j'accède à mon application, j'arrive bien sur l'erreur 500.

    Pour infos, voici les logs de tomcat au démarrage

    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
    5 août 2010 17:03:16 org.apache.catalina.startup.Embedded initDirs
    GRAVE: Cannot find specified temporary folder at C:\java\apache-tomcat-6.0.24\temp
    5 août 2010 17:03:16 org.apache.catalina.core.AprLifecycleListener init
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\java\jdk1.6.0_18\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;c:\program files\imagemagick-5.5.7-q8;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;D:\apache-ant-1.8.0RC1-bin\apache-ant-1.8.0RC1\bin;C:\java\jdk1.6.0_18\bin;C:\java\apache-maven-2.2.1\bin;;D:\00_SOFTWARE\tortoise\bin;C:\Program Files\QuickTime\QTSystem\
    5 août 2010 17:03:17 org.apache.coyote.http11.Http11Protocol init
    INFO: Initialisation de Coyote HTTP/1.1 sur http-8080
    5 août 2010 17:03:17 org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 1032 ms
    5 août 2010 17:03:17 org.apache.catalina.core.StandardService start
    INFO: Démarrage du service Catalina
    5 août 2010 17:03:17 org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
    5 août 2010 17:03:17 org.apache.catalina.startup.HostConfig deployDescriptor
    INFO: Déploiement du descripteur de configuration host-manager.xml
    5 août 2010 17:03:17 org.apache.catalina.startup.DigesterFactory register
    ATTENTION: Could not get url for /javax/servlet/resources/j2ee_web_services_1_1.xsd
    5 août 2010 17:03:17 org.apache.catalina.startup.DigesterFactory register
    ATTENTION: Could not get url for /javax/servlet/resources/j2ee_web_services_1_1.xsd
    5 août 2010 17:03:17 org.apache.catalina.startup.HostConfig deployDescriptor
    INFO: Déploiement du descripteur de configuration manager.xml
    5 août 2010 17:03:17 org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Déploiement du répertoire docs de l'application web
    5 août 2010 17:03:17 org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Déploiement du répertoire examples de l'application web
    5 août 2010 17:03:18 org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Déploiement du répertoire ROOT de l'application web
    5 août 2010 17:03:18 org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Déploiement du répertoire war de l'application web
    5 août 2010 17:03:18 org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(C:\java\apache-tomcat-6.0.24\webapps\war\WEB-INF\lib\servlet-api-2.5.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    5 août 2010 17:03:19 org.apache.coyote.http11.Http11Protocol start
    INFO: Démarrage de Coyote HTTP/1.1 sur http-8080
    5 août 2010 17:03:19 org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    5 août 2010 17:03:19 org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/47  config=null
    5 août 2010 17:03:19 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 2327 ms

    et de l'application

    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
    5 août 2010 17:03:18 org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    5 août 2010 17:03:18 org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    5 août 2010 17:03:26 org.apache.catalina.core.ApplicationContext log
    INFO: La servlet rpc est marqué comme indisponible
    5 août 2010 17:03:26 org.apache.catalina.core.StandardWrapperValve invoke
    GRAVE: Exception lors de l'allocation pour la servlet rpc
    java.lang.ClassCastException: org.springframework.web.servlet.DispatcherServlet cannot be cast to javax.servlet.Servlet
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1116)
    	at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
    	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    	at java.lang.Thread.run(Thread.java:619)

    Pour autre infos, c'est mon premier déploiement ^^

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Février 2010
    Messages
    53
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2010
    Messages : 53
    Par défaut
    Et pour ce qui est des versions, j'ai

    Spring v 3.0.2
    GWT v 2.0.3
    Servlet-api v 2.5

  6. #6
    Membre averti
    Profil pro
    Inscrit en
    Février 2010
    Messages
    53
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2010
    Messages : 53
    Par défaut
    Il semblerait que je n'ai plus àsupprimer les fichiers pour faire fonctionner mon application (même si la redirection est faite manuellement)

    Pourtant l'erreur 500 persiste !

Discussions similaires

  1. [GWT2.3] Déploiement application GWT sous MAC
    Par valkeke dans le forum GWT et Vaadin
    Réponses: 9
    Dernier message: 09/02/2012, 23h40
  2. Prolème de déploiement d'une application GWT simple
    Par Angi21 dans le forum Wildfly/JBoss
    Réponses: 0
    Dernier message: 11/10/2011, 13h48
  3. [Tomcat] Déploiement application
    Par le Daoud dans le forum Tomcat et TomEE
    Réponses: 2
    Dernier message: 21/04/2006, 14h58
  4. [OCI] Déploiement application
    Par Rupella dans le forum Interfaces de programmation
    Réponses: 1
    Dernier message: 07/03/2006, 02h27
  5. [Déploiement Application] Quel SGBD sont conseillés ?
    Par charliejo dans le forum Décisions SGBD
    Réponses: 5
    Dernier message: 24/01/2006, 17h47

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