1 Reply Latest reply on May 31, 2015 9:14 PM by Hristo Stoyanov

    Strange WF 8.2+RestEasy/JAXRS+Errai 3.1.1+KeyCloak 1.2.Final FAILURE

    Hristo Stoyanov Master

      Hi guys,

      I posted an issue to the WildFly forum, but it might belong here ... no idea where it belongs. Any help is appreciated! Thanks.

       

      Strange WF 8.2+RestEasy/JAXRS+Errai 3.1.1+KeyCloak 1.2.Final FAILURE

        • 1. Re: Strange WF 8.2+RestEasy/JAXRS+Errai 3.1.1+KeyCloak 1.2.Final FAILURE
          Hristo Stoyanov Master

          Ok ... I seem to have solved the above runtime exception by excluding rest easy caused by Errai. Not sure it it was Errai or KC that caused that resteasy problem.

          Overall, Errai  includes tons of jars, asking for jar hell issues like this. Take a look at all the jars I had to purge in my build (see 'compileExcludes' in my gradle build file) . Next, I am trying to purge the old 1.0.4 keycloak jars from Errai 3.1.2 . Still no success ... if I ever get there. But at least now I can deploy my app and getting the same type of runtime exception the Errai KC demo does when deployed against KC 1.2.Final.  See [ERRAI-855] Upgrade to keycloak 1.2.0 - JBoss Issue Tracker

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

          //This Errai Gradle build file uses the following excellent Gradle plug-ins:

          //  1. CARGO:

          //  https://github.com/bmuschko/gradle-cargo-plugin

          //

          //  2. GWT:

          //  https://github.com/steffenschaefer/gwt-gradle-plugin

           

           

          project.description = 's4g web app'

           

           

          apply plugin: 'war'

          apply plugin: 'gwt'

          apply plugin: 'com.bmuschko.cargo'

           

           

          buildscript {

            

              repositories {

                  jcenter()

                  maven {

                      url 'http://dl.bintray.com/steffenschaefer/maven'

                  }

                

                  mavenCentral()

              }

            

              dependencies {

                  classpath 'com.bmuschko:gradle-cargo-plugin:2.1'

                  classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'

              }

            

          }

           

           

           

           

          gwt {

              gwtVersion='2.7.0'

              modules 'com.s4g.web.gwt.S4GWebApp'

              devModules 'com.s4g.web.gwt.S4GWebAppDev'

              minHeapSize = "512M";

              maxHeapSize = "1024M";

              //logLevel = 'INFO';

           

           

              compiler {

                  strict = true;

                  optimize = 9;

                  enableClosureCompiler = true;

                

                  //Does not work for Errai: https://community.jboss.org/thread/241064

                  //disableClassMetadata = true;

                

                  disableCastChecking = true;

                  //ea = true;

                  localWorkers = 2;

                  //style = 'DETAILED';

              }

            

              superDev{

                  noPrecompile = true;

              }

           

           

          }

           

           

          cargo {

              containerId = 'wildfly8x'

              remote {

                  hostname = 'localhost'

                  username = 'admin'

                  password = 'admin'

              }

              local {

                  jvmArgs = '-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n'

                  homeDir = file("${wildfly_root}")

              }

              deployable {

                  file = tasks.draftWar.archivePath

                  context = '/draft'

              }

          }

           

           

           

           

          dependencies {

            

              //We exclude some modules, which should have never been referenced in Errai to begin with!

              //Also see http://stackoverflow.com/questions/23508612/gradle-multiple-compile-dependencies-syntax

              def compileExcludes = {

                  exclude group: 'com.google.gwt'

                  exclude group: 'com.google.guava'

                  exclude group: 'javax.enterprise'

                  exclude group: 'javax.annotation'

                  exclude group: 'javax.inject:javax'

                  exclude group: 'org.keycloak'

                  exclude group: 'org.apache.deltaspike'

                  exclude group: 'org.jboss.resteasy'

                  exclude group: 'javax.servlet'

                  exclude group: 'org.jboss.spec'

                  exclude group: 'org.hibernate'

                  exclude group: 'asm'

              }

            

              //Cargo dependencies. You should only need the uberjar module, but see this discussion:

              //https://github.com/bmuschko/gradle-cargo-plugin/issues/78

              def cargoVersion = '1.4.14'

              def wildflyVersion = '8.2.0.Final'

              def keycloakVersion =  '1.2.0.Final'

           

              cargo  "org.codehaus.cargo:cargo-core-uberjar:$cargoVersion",

                     "org.codehaus.cargo:cargo-ant:$cargoVersion",

                     "org.wildfly:wildfly-controller-client:$wildflyVersion"

            

              compile project(":s4g-common")

            

              //Java EE

              providedCompile "javax:javaee-api:7.0"

           

            

              //We want to use some Hibernate proprietary extensions to JPA, but since they are available at runtime  in Wildfly, we only want to compile against them here. We shoot for the same version as in WF 8.2

              providedCompile "org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final"

              providedCompile "org.hibernate:hibernate-validator:5.1.2.Final"

              providedCompile "org.hibernate:hibernate-core:4.3.7.Final"

             

              //We want to use Infinispan cache built into Wildfly, so here we only compile against it. We shoot for the same version as in WF 8.2

              def infinispanVersion = '6.0.2.Final'

              providedCompile "org.infinispan:infinispan-core:$infinispanVersion"

            

            

              //We want to use SLF4J  built into Wildfly, so here we only compile against it - see https://developer.jboss.org/thread/248963

              def slf4jVersion = '1.7.2'

              providedCompile "org.slf4j:slf4j-api:$slf4jVersion"

           

           

            

            

              //Other compile dependencies

              def guavaVersion = '18.0'

              compile "com.google.guava:guava:$guavaVersion"

              gwt "com.google.guava:guava-gwt:$guavaVersion"

            

              compile "commons-lang:commons-lang:2.6"

                                

              //Errai dependencies

              def erraiVersion = '3.1.2.Final'

              compile "org.jboss.errai:errai-bus:$erraiVersion", compileExcludes

              compile "org.jboss.errai:errai-ioc:$erraiVersion", compileExcludes

              compile "org.jboss.errai:errai-cdi-client:$erraiVersion", compileExcludes

              compile "org.jboss.errai:errai-weld-integration:$erraiVersion", compileExcludes

              compile "org.jboss.errai:errai-data-binding:$erraiVersion", compileExcludes

            

              //These unfortunately brings in dependency to JPA 2.0, while Java EE& requires JPA 2.1. Please address with Errai team! Time to ditch java EE 6 already!

              //compile "org.jboss.errai:errai-jpa-client:$erraiVersion", compileExcludes

              //compile "org.jboss.errai:errai-jpa-datasync:$erraiVersion", compileExcludes

            

              //Cordova is only used for GWT compilation

              gwt "org.jboss.errai:errai-cordova:$erraiVersion", compileExcludes

              //compile "org.jboss.errai:errai-cordova:$erraiVersion", compileExcludes

            

              compile "org.jboss.errai:errai-jaxrs-client:$erraiVersion:", compileExcludes

              compile "org.jboss.errai:errai-jaxrs-provider:$erraiVersion:", compileExcludes

            

              // Errai 3 Keycloak Security

              compile "org.jboss.errai:errai-security-server:$erraiVersion", compileExcludes

              compile "org.jboss.errai:errai-security-client:$erraiVersion", compileExcludes

              compile "org.jboss.errai:errai-security-keycloak:$erraiVersion", compileExcludes

              compile "org.keycloak:keycloak-core:$keycloakVersion", compileExcludes

              compile "org.keycloak:keycloak-adapter-core:$keycloakVersion", compileExcludes

              compile "org.keycloak:keycloak-servlet-oauth-client:$keycloakVersion", compileExcludes

            

              // These are documented in Errai 3 as needed only for gwt compile, which is not true - they are needed at runtime as well.

              //gwt "org.jboss.errai:errai-ui:$erraiVersion", compileExcludes

              //gwt "org.jboss.errai:errai-navigation:$erraiVersion", compileExcludes

              compile "org.jboss.errai:errai-ui:$erraiVersion", compileExcludes

              compile "org.jboss.errai:errai-navigation:$erraiVersion", compileExcludes

            

              compile "org.jboss.errai:errai-jboss-as-support:$erraiVersion", compileExcludes

            

              //This seems to be an Errai 3 mistake, which includes dependence on com.google.gwt.junit.server.JUnitHostImpl

              //Remove when the Errai team fixes the issue, also remove the JUnit servlet in web.xml

              def  gwtVersion = '2.7.0'

              runtime  "com.google.gwt:gwt-user:$gwtVersion"

            

          }