4 Replies Latest reply on Sep 28, 2013 5:20 AM by malpi

    Getting started with Errai and Gradle


      Hello 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:




           +     Application.java

           +     application.gwt.xml


           +     ServerApp.java


      +     index.html


           +     web.xml


      They have the following Content:



      public class Application extends VerticalPanel {
          RegisterWidget widget; //Currently not used to make the usecase more simple
          Label lbl;
          public void onModuleLoad() {
              lbl = new Label("What up?");



      public class ServerApp {
          public ServerApp(){
              System.out.println("############### GODSAKE I RUN!!!!!!!!!!");



      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6//EN"
      <module rename-to="application">
           <inherits name="org.jboss.errai.enterprise.All" />



      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app
          PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        <!-- Default page to serve -->



      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 ( 1410 bytes
         Request headers
            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
            Content-Length: 159
            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!




        • 1. Re: Getting started with Errai

          Hi Malte,


          Currently the easiest way to get started is to download the errai-tutorial project (checkout the README file):


          Unfortunately, we don't have a setup using Gradle. From the console log it looks like the server-side bus didn't deploy correctly (/out. returning a 404). Can you check if the errai-bus.jar has been deployed?



          1 of 1 people found this helpful
          • 2. Re: Getting started with Errai

            Hi Christian,


            Thanks for answering. If I interpret your answer right, I need an Java Application server running to get an example running properly? My assumption was that, the GWT Plugin of Eclipse would take care of that?


            Is there the possibility to do a proper setup with the GWT Plugin only?


            If I get the Project running with Gradle, I will provide some documentation and an Excample Project.





            • 3. Re: Re: Getting started with Errai

              I got the App running now with some support form IRC.


              At first, there was still an Issue with my Gradle script which I had to fix to create a valid WAR file.

              Than I had to setup an EAS where I could deploy the WAR. Than you can also use the "run on external server" command of the Eclipse GWT plugin.


              Furthermore I upgraded to version 2.4.0.Final of Errai. Just to let you know following Exception is known by the Errai Team but doesn't harm your code:


              21:01:25,531 ERROR [org.jboss.errai.reflections.Reflections] (Thread-68) could not create Vfs.Dir from url. ignoring the exception and continuing: org.jboss.errai.reflections.ReflectionsException: could not create Vfs.Dir from url, no matching UrlType was found [vfs:/C:/Program Files (x86)/jboss-eap-6.1/bin/content/tts-ui-1.0.war/WEB-INF/lib/errai-marshalling-2.4.0.Final.jar/]


              Available types: [jarfile, jarUrl, directory, vfsfile, vfszip, org.jboss.errai.common.metadata.WarUrlType@1e8608b4, *.jnilib, *.zip, *.pom]

              Do you need to add app server specific support to your deployment? (For example, errai-jboss-as-support for AS7)

                      at org.jboss.errai.reflections.vfs.Vfs.fromURL(Vfs.java:126) [reflections-2.4.0.Final.jar:2.4.0.Final]

                      at org.jboss.errai.reflections.vfs.Vfs.fromURL(Vfs.java:108) [reflections-2.4.0.Final.jar:2.4.0.Final]

                      at org.jboss.errai.reflections.Reflections.scan(Reflections.java:228) [reflections-2.4.0.Final.jar:2.4.0.Final]

                      at org.jboss.errai.common.metadata.MetaDataScanner.<init>(MetaDataScanner.java:105) [errai-common-2.4.0.Final.jar:2.4.0.Final]

                      at org.jboss.errai.common.metadata.MetaDataScanner.createInstance(MetaDataScanner.java:202) [errai-common-2.4.0.Final.jar:2.4.0.Final]

                      at org.jboss.errai.common.metadata.MetaDataScanner.createInstance(MetaDataScanner.java:190) [errai-common-2.4.0.Final.jar:2.4.0.Final]

                      at org.jboss.errai.common.metadata.ScannerSingleton$1.call(ScannerSingleton.java:39) [errai-common-2.4.0.Final.jar:2.4.0.Final]

                      at org.jboss.errai.common.metadata.ScannerSingleton$1.call(ScannerSingleton.java:31) [errai-common-2.4.0.Final.jar:2.4.0.Final]

                      at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]

                      at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]


              And the important hint I got from IRC was, I have to use the "data-field" tag in the HTML file!


              Thanks especially to mbarkley!


              I will share a blog post regarding the Gradle build and will let you know about.





              1 of 1 people found this helpful
              • 4. Re: Getting started with Errai and Gradle



                as promised, you can find a small HowTo about that here:




                I hope it will be usefull for someone.