7 Replies Latest reply on Oct 17, 2011 5:20 AM by midona

    Errai and Glassfish

    midona

      Hi Guys,

       

      I've downloaded the 1.2.2Final release and have managed to get the examples running on Jetty in development mode from Eclipse.  I'm now trying to do a standalone (maven) build and deploy to Glassfish 3.1.1, but I'm having a couple of problems.

       

      Initially, I  got an error message asking me if I'd remembered to include ErraiService.properties.   I checked the war file, and sure enough it handn't been included.   I changed a few things and managed to get he ErraiService.properties and ErraiApp.properties in the WEB-INF/classes folder in the war file, but I still get the same error message from Glassfish.

       

      Where should these files be placed in the war?

       

      Thanks,

       

      Alan.

        • 1. Re: Errai and Glassfish
          midona

          Here is the error I get from Glassfish:

           

          Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: com.google.inject.ProvisionException: Guice provision errors:  1) Error injecting constructor, org.jboss.errai.bus.server.ErraiBootstrapFailure: Error reading from configuration. Did you include ErraiService.properties? at org.jboss.errai.bus.server.service.ErraiServiceConfiguratorImpl.<init>(ErraiServiceConfiguratorImpl.java:53)  while locating org.jboss.errai.bus.server.service.ErraiServiceConfiguratorImpl while locating org.jboss.errai.bus.server.service.ErraiServiceConfigurator for parameter 1 at org.jboss.errai.bus.server.service.ErraiServiceImpl.<init>(ErraiServiceImpl.java:50)  while locating org.jboss.errai.bus.server.service.ErraiServiceImpl while locating org.jboss.errai.bus.server.service.ErraiService  1 error.

           

          Thanks,

           

          Alan.

          • 2. Re: Errai and Glassfish
            midona

            Also guys, in desparation I've just tried deploying it on jetty (stand-alone) and I'm getting the following:

             

            ============================

             

            2011-10-13 14:24:27.025:INFO:oejd.DeploymentManager:Deployable added: C:\Development\jetty-hightide-8.0.1.v20110908\cont

            exts\errai-bus-demos-stockdemo-1.2.2.Final.xml

            2011-10-13 14:24:27.032:WARN:oejd.DeploymentManager:Unable to reach node goal: started

            java.lang.IllegalStateException: Unknown configuration type: configure in org.eclipse.jetty.xml.XmlConfiguration@4ed2079

            3

                    at org.eclipse.jetty.xml.XmlConfiguration.setConfig(XmlConfiguration.java:222)

                    at org.eclipse.jetty.xml.XmlConfiguration.<init>(XmlConfiguration.java:147)

                    at org.eclipse.jetty.deploy.providers.ContextProvider.createContextHandler(ContextProvider.java:60)

                    at org.eclipse.jetty.deploy.App.getContextHandler(App.java:97)

                    at org.eclipse.jetty.deploy.bindings.StandardDeployer.processBinding(StandardDeployer.java:33)

                    at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:183)

                    at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:485)

                    at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:138)

                    at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:140)

                    at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:53)

                    at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:604)

             

            ============================

             

            So I guessing that I've got something fundementally wrong with my .war

             

            Any ideas please?

             

            Alan.

            • 3. Re: Errai and Glassfish
              csa

              I think the easiest thing to do here is to use the bus-stockdemo of Errai 1.3 and to execute the maven build using the tomcat or jboss7 profile (these profiles just switch from the JettyContinuationServlet to the DefaultBlockingServlet in your web.xml).

               

              mvn -Pjboss7 clean install

               

              The resulting errai-bus-demos-stockdemo.war deploys fine to Glassfish 3.1.1.

               

              You don't need to provide a profile when building for Jetty.

              • 4. Re: Errai and Glassfish
                midona

                Hi Christian,

                 

                Thanks for getting back to me.

                 

                I've tried as you suggested.  I downloaded the Errai 1.3, built it from scratch (the stock demo doesn't seem to be included in the RC download).

                I've tried loading the stockdemo app into both Glassfish and Jetty and get exactly the same results :-(   I am using clean installations of both.

                 

                I'm also now having difficulties getting any of these 1.3 demos to work in eclipse.  Here is the output when I try to run stockdemo:

                 

                ===================

                 

                [WARN] Server class 'com.google.gwt.junit.server.JUnitHostImpl' could not be found in the web app, but was found on the system classpath

                   [WARN] Adding classpath entry 'file:/C:/Users/OptaAdmin/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar' to the web app classpath for this session

                [WARN] Server class 'org.jboss.errai.bus.server.servlet.JettyContinuationsServlet' could not be found in the web app, but was found on the system classpath

                   [WARN] Adding classpath entry 'file:/C:/Users/OptaAdmin/.m2/repository/org/jboss/errai/errai-bus/2.0-SNAPSHOT/errai-bus-2.0-SNAPSHOT.jar' to the web app classpath for this session

                Starting Jetty on port 8888

                   [WARN] failed ErraiServlet

                java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

                    at org.jboss.errai.bus.server.servlet.AbstractErraiServlet.<init>(AbstractErraiServlet.java:58)

                    at org.jboss.errai.bus.server.servlet.JettyContinuationsServlet.<init>(JettyContinuationsServlet.java:40)

                 

                ===================

                 

                They are just warnings, but I can't get through to the app from a browser.

                 

                I'll keep plugging away, but I can't help but think I'm missing some important step somewhere.

                • 5. Re: Errai and Glassfish
                  csa

                  The stockdemo is included in the CR1 download: http://download.jboss.org/errai/dist/1.3.0.CR1/errai-1.3.0.CR1.zip . It's in the examples dir. To run it in jetty, cd into the stockdemo dir and run "mvn gwt:run". For glassfish, package the app using the command I pasted above. For running it within Eclipse, either use Maven, the GWT pluging, or DevMode directly. You can also take a look at this thread: http://community.jboss.org/thread/173092

                  • 6. Re: Errai and Glassfish
                    midona

                    Hi Christian,

                     

                    I think there is a little missunderstanding here, so sorry of I haven't explained things properly.   Yes I have had the example running (1.2.2) in both developer mode from eclipse and in jetty using the "mvn  gwt:run" as you say.   Here is what I'm trying to do...

                     

                    I'm  setting up a new project based on GWT/Errai.   The project will use Bamboo as the build server and I envisage three build plans: the first to build the application and run the unit tests, the second to deploy the application to a Jetty (or GlassFish) container on the Acceptance Test Environment, and the third to run the Cucumber/Capybarra acceptance tests.

                     

                    I have already got the embryo project set up (based on you 1.2.2 HelloWorld example) and the first of the build plans working.  What I now need to do is deploy it to the ATE.  To do this, I followed the Jetty instructions, created an errai-bus-demos-helloworld-1.2.2.Final.xml file in the %JETTY_HOME%/contexts folder, popped the corresponding .war file into the %JETTY_HOME%/webapps and then started jetty by cd'ing to the JETTY_HOME and "java -jar start.jar".   It was then that I got the error above.   I then tried loading the war into GlassFish via the admin console and got simillar results. 

                     

                    I've now re-tried all of this with 1.3CR, but I'm still getting the same results. 

                     

                    I will re-try this again over the weekend from a different PC, jut in case there is something screwed up with this one.   I'll also have a good look through the thread as you suggest.

                     

                    Thanks again!

                    • 7. Re: Errai and Glassfish
                      midona

                      Hi Guys,

                       

                      I managed to solve my original problem...that of getting an Errai application deployed in Glassfish 3.1.1.   It turns out that JEE 6 (or at least the Glassfish implementation) insists on a beans.xml file in the WEB-INF/ folder, even if it is empty, which in my case it is.  I'm still can't get it to load standalone in Jetty, but I think I'll be parking that issue for the moment.  I now need to solve my eclipse problem. 

                       

                      Cheers,

                       

                      Alan.