Salut à tous!
J'ai commencé à coder un petit projet GWT, mais j'ai un bug que je ne comprends pas quand je compile, il me dit ça:
J'ai vu qu'il pouvait y avoir un problème dans le fichier .gwt.xml qui pourrait expliquer cela mais je ne comprends pas comment faire pour corriger.Compiling module com.gwt.test.TestGWT
Validating newly compiled units
[ERROR] Errors in 'file:/D:/EclipseWorkspace/testGWT/src/com/gwt/test/client/ArticleServiceAsync.java'
[ERROR] Line 13: No source code is available for type org.cmn.metier.Article; did you forget to inherit a required module?
[ERROR] Errors in 'file:/D:/EclipseWorkspace/testGWT/src/com/gwt/test/client/ArticleService.java'
[ERROR] Line 14: No source code is available for type org.cmn.metier.Article; did you forget to inherit a required module?
Finding entry point classes
[ERROR] Unable to find type 'com.gwt.test.client.TestGWT'
[ERROR] Hint: Previous compiler errors may have made this type unavailable
[ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
Voilà mon code:
TestGWT.gwt.xml
ArticleService.java
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 <?xml version="1.0" encoding="UTF-8"?> <module rename-to='testgwt'> <inherits name='com.google.gwt.user.User'/> <inherits name='com.google.gwt.user.theme.standard.Standard'/> <entry-point class='com.gwt.test.client.TestGWT'/> <source path='client'/> <source path='shared'/> </module>
ArticleServiceSync.java
Code java : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package com.gwt.test.client; import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; import java.util.List; import org.cmn.metier.Article; /** * The client side stub for the RPC service. */ @RemoteServiceRelativePath("article") public interface ArticleService extends RemoteService { List<Article> articleServer() throws IllegalArgumentException; }
ArticleServiceImpl.java
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 package com.gwt.test.client; import java.util.List; import org.cmn.metier.Article; import com.google.gwt.user.client.rpc.AsyncCallback; /** * The async counterpart of <code>GreetingService</code>. */ public interface ArticleServiceAsync { void articleServer(AsyncCallback<List<Article>> callback); }
Je n'ai aucun warning ni erreur renvoyés par Eclipse et pourtant il m'envoie péter à la compilation avec l'erreur citée ci-dessus. Je comprends pas...
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 package com.gwt.test.server; import java.util.List; import net.sf.hibernate.*; import org.cmn.metier.Article; import org.cmn.hibernate.HibernateUtil; import com.gwt.test.client.ArticleService; import com.google.gwt.user.server.rpc.RemoteServiceServlet; /** * The server side implementation of the RPC service. */ @SuppressWarnings("serial") public class ArticleServiceImpl extends RemoteServiceServlet implements ArticleService { @SuppressWarnings("unchecked") @Override public List<Article> articleServer() throws IllegalArgumentException { List<Article> list = null; try { Session session = HibernateUtil.currentSession(); list = (List<Article>)session.find("from Article"); HibernateUtil.closeSession(); } catch (Exception e) { } return list; } }
Vous avez une idée de ce qu'il se passe?
Merci d'avance!
Gwinyam
Partager