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 :

RPC OK en host mode mais pas sous tomcat


Sujet :

GWT et Vaadin Java

  1. #1
    bdx
    bdx est déconnecté
    Candidat au Club
    Inscrit en
    Avril 2004
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Avril 2004
    Messages : 2
    Points : 2
    Points
    2
    Par défaut [Résolu] RPC OK en host mode mais pas sous tomcat
    Bonjour,

    J'ai développé un projet GWt 1.7 + SmartGwt 1.2. Le programme fonctionne bien en host mode (y compris les rpc).
    Par contre en déploiement sous tomcat, les rpc ne fonctionnent pas, je ne voie en effet que l'ecran principal, sans les données; les events fonctionnent bien.
    Je joins quelques extraits de code.

    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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    	<display-name>
    	IndicatorGwt</display-name>
    	<servlet>
    		<servlet-name>IndicatorIhmServiceDb</servlet-name>
    		<servlet-class>
    		indicator.main.web.server.IndicatorIhmServiceDbImpl</servlet-class>
    	</servlet>
    	<servlet-mapping>
    		<servlet-name>IndicatorIhmServiceDb</servlet-name>
    		<url-pattern>/IndicatorIhmServiceDb</url-pattern>
    	</servlet-mapping>
    	<welcome-file-list>		
    		<welcome-file>IndicatorIhm.html</welcome-file>
    	</welcome-file-list>
    </web-app>
    IndicatorIhm.gwt.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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <module>
     
    	<!-- Inherit the core Web Toolkit stuff.                  -->
    	<inherits name="com.google.gwt.user.User"/>
    	<inherits name="com.smartgwt.SmartGwt"/>
    	<inherits name="com.google.gwt.visualization.Visualization"/>
     
    	<!-- Specify the app entry point class.                   -->
    	<entry-point class="indicator.main.web.client.IndicatorIhm"/>
     
      	<inherits name="com.google.gwt.user.theme.standard.Standard"/>
      	<!-- <inherits name="com.google.gwt.user.theme.chrome.Chrome"/> -->
      	<!-- <inherits name="com.google.gwt.user.theme.dark.Dark"/> -->
     
      	<source path='client'/>
    	<source path='bean'/>
     
    	<servlet 
    		class="indicator.main.web.server.IndicatorIhmServiceDbImpl" 
    		path="/IndicatorIhmServiceDb"/>
     
    </module>


    EntryPoint
    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
     
    public class IndicatorIhm implements EntryPoint {
     
    	private IndicatorScreen indicatorScreen;
    	private IndicatorIhmServiceDbAsync async;	
    	private PeriodicityIndicator periodicityIndicator;
    	private int timeGmtOffset;
     
    	public void onModuleLoad() {  		
     
    		//initialisations
    		indicatorScreen =  new IndicatorScreen();
    		initData();				
     
    		//les events d'ihm
    		(...)
     
     
     
    		//affichage
    		indicatorScreen.draw();
    	}  
     
    	public void  initData()
    	{
     
     
    		async = IndicatorIhmServiceDb.Util.getInstance();
     
    //avec ou sans les 2 lignes suivantes, meme constat meme probleme
    //		ServiceDefTarget asyncEndPoint = (ServiceDefTarget) async;
    //	    	asyncEndPoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "/IndicatorIhmServiceDb");
     
     
    		async.getAllSearchIndicator(new SearchIndicatorCallback());
     
    		(...)
    	}
    	(...)
    }


    IndicatorIhmServiceDb

    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
     
    @RemoteServiceRelativePath("IndicatorIhmServiceDb")
    public interface IndicatorIhmServiceDb extends RemoteService {
     
    	public static class Util {
     
    		public static IndicatorIhmServiceDbAsync getInstance() {
     
    			return GWT.create(IndicatorIhmServiceDb.class);
    		}
    	}
     
    	public SearchIndicatorList getAllSearchIndicator();
    	(...)
    }
    IndicatorIhmServiceDbAsync

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    public interface IndicatorIhmServiceDbAsync {
     
    	public void getAllSearchIndicator(AsyncCallback<SearchIndicatorList> callback);
    	(...)
    }

    IndicatorIhmServiceDbImpl

    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
     
    public class IndicatorIhmServiceDbImpl extends RemoteServiceServlet implements IndicatorIhmServiceDb {
     
    	private static final long serialVersionUID = 0L;
     
    	private IDao dao;
     
     
    	public IDao getDao()
    	{
    		return dao;
    	}
     
    	public void setDao(IDao dao)
    	{
    		this.dao = dao;
    	}
     
    	public void setDao()
    	{
    		this.dao = new Dao();
    	}
     
     
    	public SearchIndicatorList getAllSearchIndicator()
    	{
    		setDao();
    		return dao.getAllSearchIndicator(); 	
    	}
     
    	(...)
    }

  2. #2
    Membre du Club
    Inscrit en
    Mai 2009
    Messages
    68
    Détails du profil
    Informations forums :
    Inscription : Mai 2009
    Messages : 68
    Points : 47
    Points
    47
    Par défaut
    Essaye de rajouter le contexte dans ce morceau de code de ton web.xml

    <servlet-mapping>
    <servlet-name>IndicatorIhmServiceDb</servlet-name>
    <url-pattern>contexte/IndicatorIhmServiceDb</url-pattern>
    </servlet-mapping>

  3. #3
    bdx
    bdx est déconnecté
    Candidat au Club
    Inscrit en
    Avril 2004
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Avril 2004
    Messages : 2
    Points : 2
    Points
    2
    Par défaut
    J'ai résolu mon probleme.

    Ce n'etait pas un problème de fichier xml de configuration, mais de librairies jar dans le module dependencies.

    J'exportais le gwr_user au lieu du gwt-servlet.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Application qui fonctionne sous Eclipse mais pas sous Tomcat
    Par stoner2008 dans le forum Tomcat et TomEE
    Réponses: 1
    Dernier message: 16/09/2013, 12h14
  2. [Hudson] Scripts fonctionnant en mode console mais pas sous Jenkins
    Par gbdivers dans le forum Intégration Continue
    Réponses: 1
    Dernier message: 31/08/2011, 17h07
  3. [Turbo Pascal] TPX peut être exécuté en mode fenêtré sous Vista mais pas sous Win7
    Par Torank dans le forum Turbo Pascal
    Réponses: 4
    Dernier message: 06/09/2010, 17h58
  4. Servlet fonctionne en hosted mais pas sous Tomcat
    Par Maxiflo dans le forum GWT et Vaadin
    Réponses: 0
    Dernier message: 01/03/2010, 16h31
  5. projet qui marche en mode "hosted" mais pas sous Tomcat
    Par sdesbure dans le forum GWT et Vaadin
    Réponses: 3
    Dernier message: 02/02/2009, 23h54

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