Getting started with Errai and Gradle
malpi Sep 28, 2013 5:15 AMHello there,
I currently try to get Errai running with Gradle, and I have a quite hard time.
I am using the following dependencies:
- org.jboss.errai:errai-javaee-all:2.4.0.Final
- com.google.gwt:gwt-dev:2.4.0 (For Compiling)
At first, all dem Applications I find, are either not compileable, or not able to resolve dependencies and so on...
Therefore I thought, ok lets get it done and start on your own....
I'm getting the Application Compiled and started by the Eclipse GWT Developer Plugin.
My Project has the following structure:
src/main/java/myProject/
|client/local/
+ Application.java
+ application.gwt.xml
|server
+ ServerApp.java
src/main/webapp/
+ index.html
|WEB-INF
+ web.xml
They have the following Content:
Application.java
@EntryPoint public class Application extends VerticalPanel { @Inject RegisterWidget widget; //Currently not used to make the usecase more simple Label lbl; @PostConstruct public void onModuleLoad() { lbl = new Label("What up?"); add(lbl); } }
ServerApp.java
@ApplicationScoped public class ServerApp { public ServerApp(){ System.out.println("############### GODSAKE I RUN!!!!!!!!!!"); } }
application.gwt.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6//EN" "http://google-web-toolkit.googlecode.com/svn/releases/1.6/distro-source/core/src/gwt-module.dtd"> <module rename-to="application"> <inherits name="org.jboss.errai.enterprise.All" /> </module>
web.xml
<?xml version="1.0" encoding="UTF-8"?> <!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> <servlet> <servlet-name>jUnitHostImpl</servlet-name> <servlet-class>com.google.gwt.junit.server.JUnitHostImpl</servlet-class> </servlet> <servlet-mapping> <servlet-name>jUnitHostImpl</servlet-name> <url-pattern>/application/junithost/*</url-pattern> </servlet-mapping> <!-- Default page to serve --> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> </web-app>
When I try to access the Application the Page stays with a white Background and the Console is getting Spammed with
[WARN] 404 - POST /out.80377-44424.erraiBus?z=2&clientId=80377-44424&wait=1&phase=connection (127.0.0.1) 1410 bytes Request headers Host: 127.0.0.1:8888 Connection: keep-alive Accept: */* User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1638.0 Safari/537.36 Accept-Encoding: gzip,deflate,sdch Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4 Referer: http://127.0.0.1:8888/index.html?gwt.codesvr=127.0.0.1:9997 Content-Length: 159 Origin: http://127.0.0.1:8888 Content-Type: application/json; charset=UTF-8 Response headers Content-Type: text/html; charset=iso-8859-1 Content-Length: 1410
So, what am I missing here? Hope somebody can help me!
Cheers,
Malte