3 Replies Latest reply on Jun 22, 2016 7:12 AM by stbland

    Errai on other servers than JBoss

    kospiotr

      Hi,

       

      Is it possible to deploy Errai project to other servers than JBoss AS? What about servlet containers? We would like to start new project with Errai but we are limited to Jetty (Dev) and Tomcat (Dev / Prod) servers.

       

      I found jetty, jetty7+ and tomcat profiles in the pom. I guess that jetty profiles are for running development mode on embedded jetty, and tomcat is just placeholder for future support. Are there any plans to support it in the near future?

        • 1. Re: Errai on other servers than JBoss
          jfuerth

          Hi Piotr,

           

          The answer depends on which server-side facilities of Errai your app is using. Here's a quick run-down of the major Errai features and what server-side requirements they have:

           

          Errai Bus: Any Servlet 2.x container (or 3.0 for async dispatch)

          Errai CDI container (without distributed events): no server dependency

          Errai CDI distributed events: Weld >= 1.1.5 and < 2.0 (presently a hard requirement on Weld, not other CDI implementations)

          Errai Cordova wrappers: no server dependency

          Errai Data Binding: no server dependency

          Errai IOC container: no server dependency

          Errai JAX-RS in Jackson compatibility mode: no server dependency

          Errai JAX-RS with Errai Marshalling: any JAX-RS implementation plus errai-jaxrs-provider

          Errai JPA: no server dependency

          Errai JPA data sync: any JPA 2.0 or 2.1 implementation

          Errai Navigation: no server dependency

          Errai Validation: no server dependency

          Errai UI Templates: no server dependency

           

          If you constrain yourself to the "no server dependency" features, you can even deploy on Apache HTTP, nginx, or any other non-Java webserver.

           

          On a Java-based server where you can't deploy Weld 1.1.x, you can expect everything except distributed CDI events to work.

           

          On a Java-based server that includes Weld 1.1.x, or one where you can deploy it with your .war (including Tomcat and Jetty), you can expect all of Errai to work.

           

          Our demos whose poms include tomcat and jetty profiles should produce working apps for those servers when you mvn clean package -P[tomcat|jetty]. The main difference between these profiles and the jboss7 profile are that they include a lot more jars in the app (all the stuff you get for free in an EE container). Some of them (for example, jetty-env.xml in errai-cdi-demo-tagcloud) also provide static JNDI configuration for Weld in Jetty. You could use one of these demos as a starting point for your app.

           

          We chose to leave the profiles out of our new errai-tutorial demo in an effort to simplify the pom and keep the number of possible branches in the tutorial to a minimum. We're trying to make the getting started experience as linear as possible.

           

          Hope that helps!

          Jonathan

          • 2. Re: Errai on other servers than JBoss
            kospiotr

            As far I understand the key is to configure Weld with container, the rest is up to Errai modules I'm currently using. Thank you for your wide explanation.

            • 3. Re: Errai on other servers than JBoss
              stbland

              Hello,

               

              I wrote a answer on StackOverflow and a small Maven project on GitHub to show how to run an Errai 4 webapp on Tomcat server.

              I hope that helps us.

               

              Stéphane.