1 2 Previous Next 21 Replies Latest reply on Jun 15, 2012 7:20 PM by froed Go to original post
      • 15. Re: Can Errai be used with existing JAX-RS interfaces?
        mcaspers

        Actually, as it turns out that didn't fix the problem. I had a left over JAX-RS interface in my project that was being found - it wasn't the one in the JAR file. So moving the ErraiApp.properties file made no difference.

        • 16. Re: Can Errai be used with existing JAX-RS interfaces?
          csa

          Did you add the interface source path to your .gwt.xml as I suggested? Can you share/attach you project's source (or a subset) so we can reproduce the problem?

          • 17. Re: Can Errai be used with existing JAX-RS interfaces?
            mcasperson

            I'll see if I can create a test case at some point, and post it here.

            • 18. Re: Can Errai be used with existing JAX-RS interfaces?
              froed

              Hello Christian,

               

              I'am faced into the same problem with JAX-RS interfaces.

               

              I have a maven multi-module project from org.jboss.spec.archetypes/jboss-javaee6-webapp.ear-archetype 7.1.1 archetyp and added another maven module from org.jboss.errai.archetypes/jaxrs-quickstart 2.0-SNAPSHOT.

              The project which contains the REST-Interface (TestSample-web) has the GWT module description .gwt.xml and the ErraiApp.properties file. The GWT project (TestSample-w3w) has a dependency to the REST project and also the entry in the App.gwt.xml for the GWT module.

               

              When I try to create a package from the multi-module project (mvn package) I see that the additioanal classes for REST-Interfaces in the .errai/JaxrsProxyLoaderImpl.java are not created. I noticed that the ErraiApp.properties from the REST project was not included in the project's jar. After that I extended the POM of the REST project by

               

              <resources>
                          <resource>
                              <directory>src/main/java</directory>                
                              <includes>
                                  <include>**/*.java</include>
                                  <include>**/*.gwt.xml</include>
                              </includes>
                          </resource>
                          
                          <resource>
                              <directory>src/main/resources</directory>
                              <includes>
                                  <include>**/*.properties</include>
                              </includes>                                
                          </resource>
              </resources>
              

               

              and now I see that ErraiApp.properties is inside the jar, but I get many errors during the GWT project compilation.

               

              [INFO] --- gwt-maven-plugin:2.4.0:compile (default) @ TestSample-w3w ---
              [INFO] auto discovered modules [org.jboss.testsample.www.App]
              [INFO] Compiling module org.jboss.testsample.www.App
              [INFO]    Validating newly compiled units
              [INFO]       Ignored 3 units with compilation errors in first pass.
              [INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
              [ERROR] SLF4J: Class path contains multiple SLF4J bindings.
              [ERROR] SLF4J: Found binding in [jar:file:/home/davidfr/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
              [ERROR] SLF4J: Found binding in [jar:file:/home/davidfr/.m2/repository/org/jboss/weld/servlet/weld-servlet/1.1.6.Final/weld-servlet-1.1.6.Final.jar!/org/slf4j/impl/StaticLoggerBinder.class]
              [ERROR] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
              [INFO]    Scanning for additional dependencies: jar:file:/home/davidfr/.m2/repository/org/jboss/errai/errai-ioc/2.1-SNAPSHOT/errai-ioc-2.1-SNAPSHOT.jar!/org/jboss/errai/ioc/client/Container.java
              [INFO]       Computing all possible rebind results for 'org.jboss.errai.ioc.client.Bootstrapper'
              [INFO]          Rebinding org.jboss.errai.ioc.client.Bootstrapper
              [INFO]             Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator
              [INFO]                Generating Extensions Bootstrapper...
              [INFO] INFO [IOCBootstrapGenerator] generating IOC bootstrapping class...
              [INFO] INFO [Reflections] Reflections took 2856 ms to scan 10 urls, producing 310 keys and 1040 values 
              [INFO] INFO [Reflections] Reflections took 364 ms to scan 10 urls, producing 310 keys and 1040 values 
              [INFO]                Checking ErraiApp.properties for configured types ...
              [ERROR] java.lang.NoClassDefFoundError: javax/faces/context/FacesContext
              [ERROR]         at java.lang.Class.getDeclaredMethods0(Native Method)
              [ERROR]         at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
              [ERROR]         at java.lang.Class.getDeclaredMethod(Class.java:1952)
              [ERROR]         at org.jboss.errai.reflections.util.Utils.getMethodFromDescriptor(Utils.java:74)
              [ERROR]         at org.jboss.errai.reflections.Reflections.getMethodsAnnotatedWith(Reflections.java:402)
              [ERROR]         at org.jboss.errai.common.metadata.MetaDataScanner.getMethodsAnnotatedWith(MetaDataScanner.java:198)
              [ERROR]         at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCProcessorFactory.process(IOCProcessorFactory.java:379)
              [ERROR]         at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator.generateExtensions(IOCBootstrapGenerator.java:273)
              [ERROR]         at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator._generate(IOCBootstrapGenerator.java:247)
              [ERROR]         at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator.generate(IOCBootstrapGenerator.java:158)
              [ERROR]         at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator.generateIOCBootstrapClass(IOCGenerator.java:90)
              [ERROR]         at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator.generate(IOCGenerator.java:61)
              [ERROR]         at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48)
              [ERROR]         at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60)
              [ERROR]         at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:647)
              [ERROR]         at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
              [ERROR]         at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:78)
              [ERROR]         at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:268)
              [ERROR]         at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:257)
              [ERROR]         at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:91)
              [ERROR]         at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:96)
              [ERROR]         at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:254)
              [ERROR]         at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
              [ERROR]         at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:173)
              [ERROR]         at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:288)
              [ERROR]         at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access$400(AbstractCompiler.java:139)
              [ERROR]         at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:588)
              [ERROR]         at com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:97)
              [ERROR]         at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:52)
              [ERROR]         at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:569)
              [ERROR]         at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:33)
              [ERROR]         at com.google.gwt.dev.Precompile.precompile(Precompile.java:284)
              [ERROR]         at com.google.gwt.dev.Precompile.precompile(Precompile.java:233)
              [ERROR]         at com.google.gwt.dev.Precompile.precompile(Precompile.java:145)
              [ERROR]         at com.google.gwt.dev.Compiler.run(Compiler.java:232)
              [ERROR]         at com.google.gwt.dev.Compiler.run(Compiler.java:198)
              [ERROR]         at com.google.gwt.dev.Compiler$1.run(Compiler.java:170)
              [ERROR]         at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88)
              [ERROR]         at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82)
              [ERROR]         at com.google.gwt.dev.Compiler.main(Compiler.java:177)
              [ERROR] Caused by: java.lang.ClassNotFoundException: javax.faces.context.FacesContext
              [ERROR]         at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
              [ERROR]         at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
              [ERROR]         at java.security.AccessController.doPrivileged(Native Method)
              [ERROR]         at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
              [ERROR]         at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
              [ERROR]         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
              [ERROR]         at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
              [ERROR]         ... 40 more
              [INFO]                [ERROR] Error generating extensions
              [INFO] java.lang.NoClassDefFoundError: javax/faces/context/FacesContext
              [INFO]  at java.lang.Class.getDeclaredMethods0(Native Method)
              [INFO]  at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
              [INFO]  at java.lang.Class.getDeclaredMethod(Class.java:1952)
              [INFO]  at org.jboss.errai.reflections.util.Utils.getMethodFromDescriptor(Utils.java:74)
              [INFO]  at org.jboss.errai.reflections.Reflections.getMethodsAnnotatedWith(Reflections.java:402)
              [INFO]  at org.jboss.errai.common.metadata.MetaDataScanner.getMethodsAnnotatedWith(MetaDataScanner.java:198)
              [INFO]  at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCProcessorFactory.process(IOCProcessorFactory.java:379)
              [INFO]  at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator.generateExtensions(IOCBootstrapGenerator.java:273)
              [INFO]  at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator._generate(IOCBootstrapGenerator.java:247)
              [INFO]  at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator.generate(IOCBootstrapGenerator.java:158)
              [INFO]  at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator.generateIOCBootstrapClass(IOCGenerator.java:90)
              [INFO]  at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator.generate(IOCGenerator.java:61)
              [INFO]  at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48)
              [INFO]  at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60)
              [INFO]  at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:647)
              [INFO]  at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
              [INFO]  at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:78)
              [INFO]  at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:268)
              [INFO]  at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:257)
              [INFO]  at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:91)
              [INFO]  at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:96)
              [INFO]  at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:254)
              [INFO]  at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
              [INFO]  at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:173)
              [INFO]  at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:288)
              [INFO]  at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access$400(AbstractCompiler.java:139)
              [INFO]  at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:588)
              [INFO]  at com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:97)
              [INFO]  at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:52)
              [INFO]  at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:569)
              [INFO]  at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:33)
              [INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:284)
              [INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:233)
              [INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:145)
              [INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:232)
              [INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:198)
              [INFO]  at com.google.gwt.dev.Compiler$1.run(Compiler.java:170)
              [INFO]  at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88)
              [INFO]  at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82)
              [INFO]  at com.google.gwt.dev.Compiler.main(Compiler.java:177)
              [INFO] Caused by: java.lang.ClassNotFoundException: javax.faces.context.FacesContext
              [INFO]  at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
              [INFO]  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
              [INFO]  at java.security.AccessController.doPrivileged(Native Method)
              [INFO]  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
              [INFO]  at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
              [INFO]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
              [INFO]  at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
              [INFO]  ... 40 more
              [INFO]          Rebinding org.jboss.errai.ioc.client.Bootstrapper
              [INFO]             Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator
              

               

              I have not idea what to do, may be you have a hint to fix this.

               

              I've attached the maven project.

              • 19. Re: Can Errai be used with existing JAX-RS interfaces?
                csa

                Hi Dave,

                 

                You are actually having a different problem here. Your modules are discovered just fine after you added the ErraiApp.properties (Matthew: if you still struggle to make this work you could compare your app with Dave's example).

                 

                However, the problem here is that the MemberController class has a dependecy to javax/faces/context/FacesContext which is not on the classpath of your GWT app (TestSample-w3w). The same is true for the WebResources class. Looking at your service implementation, it seems that you don't even need this classes and probably could just remove them.

                 

                Cheers,

                Christian

                • 20. Re: Can Errai be used with existing JAX-RS interfaces?
                  froed

                  Hi Christian,

                   

                  thanks for pointing me in the right direction. It seems my GWT basics are unsufficient. After deleting the mentioned classes the problem is gone, but my intention is to keep the classes as they are and make them invisible  by the GWT-Compiler. Searching a litle bit I found this

                   

                  https://developers.google.com/web-toolkit/doc/1.6/DevGuideOrganizingProjects#DevGuidePathFiltering

                  http://management-platform.blogspot.de/2011/07/telling-gwt-to-ignore-certain-classes.html

                   

                  so my approach was to exclude the related classes with:

                   

                  <module>
                    <inherits name='com.google.gwt.user.User'/>
                    <source path="rest">      
                       <exclude name="MemberController.java" />
                       <exclude name="JaxRsActivator.java" />
                       <exclude name="WebResources.java" />     
                    </source>
                  </module>
                  

                  but this leads to the same result

                  • 21. Re: Can Errai be used with existing JAX-RS interfaces?
                    froed

                    Finally I was able to solve the most problems and now it's possible to compile the project in the commandline as well as in eclipse. For those who are interested in the sample see below.

                    1 2 Previous Next