7 Replies Latest reply on May 10, 2012 12:16 PM by htfv

    Compilation problems with Errai 2.0.0.Final

    htfv

      Hello World!

       

      I'm getting exceptions like the following when I build my project:

       

      [INFO] INFO [RpcProxyLoaderGenerator] generating rpc proxy loader class.
      [INFO]    [ERROR] An internal compiler exception occurred
      [INFO] com.google.gwt.dev.jjs.InternalCompilerException: Failed to get JNode
      [INFO]     at com.google.gwt.dev.jjs.impl.TypeMap.get(TypeMap.java:140)
      [INFO]     at com.google.gwt.dev.jjs.impl.TypeMap.get(TypeMap.java:71)
      [INFO]     at com.google.gwt.dev.jjs.impl.BuildTypeMap.getType(BuildTypeMap.java:730)
      [INFO]     at com.google.gwt.dev.jjs.impl.BuildTypeMap.processMethodBinding(BuildTypeMap.java:951)
      [INFO]     at com.google.gwt.dev.jjs.impl.BuildTypeMap.access$400(BuildTypeMap.java:99)
      [INFO]     at com.google.gwt.dev.jjs.impl.BuildTypeMap$BuildDeclMapVisitor.visit(BuildTypeMap.java:222)
      [INFO]     at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.traverse(MethodDeclaration.java:209)
      [INFO]     at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1294)
      [INFO]     at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.traverse(QualifiedAllocationExpression.java:478)
      [INFO]     at org.eclipse.jdt.internal.compiler.ast.Assignment.traverse(Assignment.java:255)
      [INFO]     at org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration.traverse(ConstructorDeclaration.java:505)
      [INFO]     at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1239)
      [INFO]     at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:687)
      [INFO]     at com.google.gwt.dev.jjs.impl.BuildTypeMap.createPeersForNonTypeDecls(BuildTypeMap.java:637)
      [INFO]     at com.google.gwt.dev.jjs.impl.BuildTypeMap.exec(BuildTypeMap.java:514)
      [INFO]     at com.google.gwt.dev.jjs.impl.BuildTypeMap.exec(BuildTypeMap.java:523)
      [INFO]     at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:599)
      [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]       [ERROR] <no source info>: public class com.brandmaker.research.ng.gwt.shop.shared.search.MediaSearchRequest
      [INFO]     extends java.lang.Object
      [INFO] /*   fields   */
      [INFO] private [unresolved] java.lang.String query
      [INFO] /*   methods   */
      [INFO] public void <init>() 
      [INFO] public java.lang.String getQuery() 
      [INFO] public void setQuery(java.lang.String) 
      [INFO] 
      [INFO] 
      [INFO] 
      [INFO]          org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding
      [INFO]       [ERROR] at MarshallerFactoryImpl.java(411): public MediaSearchRequest demarshall(EJValue a0, MarshallingSession a1) {
      [INFO]   try 
      [INFO]     {
      [INFO]       if (a0.isNull())
      [INFO]           {
      [INFO]             return null;
      [INFO]           }
      [INFO]       EJObject obj = a0.isObject();
      [INFO]       String objId = obj.get("^ObjectID").isString().stringValue();
      [INFO]       if (a1.hasObjectHash(objId))
      [INFO]           {
      [INFO]             return a1.getObject(MediaSearchRequest.class, objId);
      [INFO]           }
      [INFO]       MediaSearchRequest entity = new MediaSearchRequest();
      [INFO]       a1.recordObjectHash(objId, entity);
      [INFO]       if ((obj.containsKey("query") && (! obj.get("query").isNull())))
      [INFO]           {
      [INFO]             entity.setQuery(java_lang_String.demarshall(obj.get("query"), a1));
      [INFO]           }
      [INFO]       return entity;
      [INFO]     }
      [INFO]   catch (Throwable t)     {
      [INFO]       t.printStackTrace();
      [INFO]       throw new RuntimeException("error demarshalling entity: com.brandmaker.research.ng.gwt.shop.shared.search.MediaSearchRequest", t);
      [INFO]     }
      [INFO] }
      [INFO]          org.eclipse.jdt.internal.compiler.ast.MethodDeclaration
      

       

      Sometimes it occurs for other classes. Here's the source of MediaSearchRequest:

       

      package com.brandmaker.research.ng.gwt.shop.shared.search;
      
      import org.jboss.errai.common.client.api.annotations.Portable;
      
      @Portable
      public class MediaSearchRequest
      {
          private String query;
      
          public String getQuery()
          {
              return query;
          }
      
          public void setQuery(String query)
          {
              this.query = query;
          }
      }
      

       

      What am I doing wrong?

       

      Regards

        • 1. Re: Compilation problems with Errai 2.0.0.Final
          htfv

          Here's a similar exception for another class:

           

          [INFO] INFO [RpcProxyLoaderGenerator] generating rpc proxy loader class.
          [INFO]    [ERROR] An internal compiler exception occurred
          [INFO] com.google.gwt.dev.jjs.InternalCompilerException: Failed to get JNode
          [INFO]     at com.google.gwt.dev.jjs.impl.TypeMap.get(TypeMap.java:140)
          [INFO]     at com.google.gwt.dev.jjs.impl.TypeMap.get(TypeMap.java:71)
          [INFO]     at com.google.gwt.dev.jjs.impl.BuildTypeMap.getType(BuildTypeMap.java:730)
          [INFO]     at com.google.gwt.dev.jjs.impl.BuildTypeMap.processMethodBinding(BuildTypeMap.java:951)
          [INFO]     at com.google.gwt.dev.jjs.impl.BuildTypeMap.access$400(BuildTypeMap.java:99)
          [INFO]     at com.google.gwt.dev.jjs.impl.BuildTypeMap$BuildDeclMapVisitor.visit(BuildTypeMap.java:222)
          [INFO]     at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.traverse(MethodDeclaration.java:209)
          [INFO]     at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1294)
          [INFO]     at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.traverse(QualifiedAllocationExpression.java:478)
          [INFO]     at org.eclipse.jdt.internal.compiler.ast.Assignment.traverse(Assignment.java:255)
          [INFO]     at org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration.traverse(ConstructorDeclaration.java:505)
          [INFO]     at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1239)
          [INFO]     at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:687)
          [INFO]     at com.google.gwt.dev.jjs.impl.BuildTypeMap.createPeersForNonTypeDecls(BuildTypeMap.java:637)
          [INFO]     at com.google.gwt.dev.jjs.impl.BuildTypeMap.exec(BuildTypeMap.java:514)
          [INFO]     at com.google.gwt.dev.jjs.impl.BuildTypeMap.exec(BuildTypeMap.java:523)
          [INFO]     at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:599)
          [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]       [ERROR] <no source info>: public class com.brandmaker.research.ng.gwt.widgets.shared.mp.MediaInfo
          [INFO]     extends java.lang.Object
          [INFO] /*   fields   */
          [INFO] private [unresolved] java.lang.String normalPreviewName
          [INFO] /*   methods   */
          [INFO] public void <init>() 
          [INFO] public java.lang.String getNormalPreviewName() 
          [INFO] public void setNormalPreviewName(java.lang.String) 
          [INFO] 
          [INFO] 
          [INFO] 
          [INFO]          org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding
          [INFO]       [ERROR] at MarshallerFactoryImpl.java(699): public MediaInfo demarshall(EJValue a0, MarshallingSession a1) {
          [INFO]   try 
          [INFO]     {
          [INFO]       if (a0.isNull())
          [INFO]           {
          [INFO]             return null;
          [INFO]           }
          [INFO]       EJObject obj = a0.isObject();
          [INFO]       String objId = obj.get("^ObjectID").isString().stringValue();
          [INFO]       if (a1.hasObjectHash(objId))
          [INFO]           {
          [INFO]             return a1.getObject(MediaInfo.class, objId);
          [INFO]           }
          [INFO]       MediaInfo entity = new MediaInfo();
          [INFO]       a1.recordObjectHash(objId, entity);
          [INFO]       if ((obj.containsKey("normalPreviewName") && (! obj.get("normalPreviewName").isNull())))
          [INFO]           {
          [INFO]             entity.setNormalPreviewName(java_lang_String.demarshall(obj.get("normalPreviewName"), a1));
          [INFO]           }
          [INFO]       return entity;
          [INFO]     }
          [INFO]   catch (Throwable t)     {
          [INFO]       t.printStackTrace();
          [INFO]       throw new RuntimeException("error demarshalling entity: com.brandmaker.research.ng.gwt.widgets.shared.mp.MediaInfo", t);
          [INFO]     }
          [INFO] }
          [INFO]          org.eclipse.jdt.internal.compiler.ast.MethodDeclaration
          

           

          package com.brandmaker.research.ng.gwt.widgets.shared.mp;
          
          import org.jboss.errai.common.client.api.annotations.Portable;
          
          @Portable
          public class MediaInfo
          {
              private String normalPreviewName;
          
              public MediaInfo()
              {
              }
          
              public String getNormalPreviewName()
              {
                  return normalPreviewName;
              }
          
              public void setNormalPreviewName(String normalPreviewName)
              {
                  this.normalPreviewName = normalPreviewName;
              }
          }
          
          • 2. Re: Compilation problems with Errai 2.0.0.Final
            htfv

            I have 3 GWT modules in my project, but only one of them has an  entry point. The problem disappeared when I excluded modules without entry points from compilation.

             

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>${dependencies.gwt.version}</version>
                <configuration>
                    ...
                    <modules>
                        <!--module>com.brandmaker.research.ng.gwt.layout.Layout</module-->
                        <module>com.brandmaker.research.ng.gwt.shop.Shop</module>
                        <!--module>com.brandmaker.research.ng.gwt.widgets.Widgets</module-->
                    </modules>
                    ...
                </configuration>
                ...
            </plugin>
            

             

            Regards

            1 of 1 people found this helpful
            • 3. Re: Compilation problems with Errai 2.0.0.Final
              csa

              Hi,

               

              These errors mean that the GWT compiler couldn't find the sources of the classes MediaInfo and MediaSearchRequest. When you package your modules, make sure you include the source files in your jars.

               

              Cheers,

              Christian

              • 4. Re: Compilation problems with Errai 2.0.0.Final
                htfv

                It's all in the same Maven module, I cannot understand why it cannot find sources.

                • 5. Re: Compilation problems with Errai 2.0.0.Final
                  csa

                  GWT by default assumes that client-side classes reside in the .client package or below. This doesn't seem to be the case in your app. Did you specify an alternative source path in your gwt.xmls? If not, then that's what's missing:

                   

                  <source path='shared'>

                   

                  All our demos use client.local, client.shared, so that this configuration is not neccessary.

                  • 6. Re: Compilation problems with Errai 2.0.0.Final
                    cbrock

                    unzip the jar or war that your Maven module creates and make sure that the sources and gwt.xml files are there. if not you may need to add this to your <build> configuration for your Maven Module:

                     

                            <resources>

                                <resource>

                                    <directory>src/main/java</directory>

                                    <includes>

                                        <include>**/*.java</include>

                                        <include>**/*.gwt.xml</include>

                                        <include>**/*.xml</include>

                                    </includes>

                                </resource>

                                <resource>

                                    <directory>src/main/resources</directory>

                                    <includes>

                                        <include>**/*</include>

                                    </includes>

                                </resource>

                            </resources>

                    • 7. Re: Compilation problems with Errai 2.0.0.Final
                      htfv

                      I specified the source paths, see below. I don't know if it relates, but there were no problem in dev mode.

                       

                      Shop.gwt.xml

                       

                      <module rename-to="shop">
                      
                          <inherits name="com.brandmaker.research.ng.gwt.layout.Layout" />
                          <inherits name="com.brandmaker.research.ng.gwt.widgets.Widgets" />
                      
                          <inherits name="com.google.gwt.activity.Activity" />
                          <inherits name="com.google.gwt.place.Place" />
                      
                          <inherits name="org.jboss.errai.bus.ErraiBus" />
                          <inherits name="org.jboss.errai.enterprise.CDI" />
                          <inherits name="org.jboss.errai.ioc.Container" />
                      
                          <source path="client" />
                          <source path="shared" />
                      
                      </module>
                      

                       

                      Widgets.gwt.xml

                       

                      <module rename-to="widgets">
                      
                          <inherits name="com.google.gwt.user.User" />
                          <inherits name="com.google.gwt.user.theme.standard.Standard" />
                      
                          <source path="client" />
                          <source path="shared" />
                      
                      </module>