Tuesday, April 25, 2017

Re: Compiler error with the latest gwt head ?

The issue seems to be with usage of the new Elemental2 libraries. It looks like it has not much to do with my Java code, just the inclusion of Elemental2 breals the compile.

   <inherits name="elemental2.core.Core"/>
   <inherits name="elemental2.dom.Dom"/>

Switching to the old JSNI Console logging works:

@EntryPoint
public class Main {

    @Inject
    private Caller<Ping> ping;

    @Inject 
    private Console console;

    @AfterInitialization
    private void afterInitialization() {
        ping.call((String response) -> {
            console.log(response);
        }).ping();
    }
    
    // If I switch to this, it works
    public static native void log(String message) /*-{
        console.log(message);
    }-*/;
}


On Tuesday, April 25, 2017 at 5:49:10 PM UTC-7, Hristo Stoyanov wrote:


:recres-client:compileJava
:recres-client:compileJava - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:recres-client:processResources NO-SOURCE
:recres-client:classes
:recres-client:gwtCompile
Apr 25, 2017 5:44:22 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Compiling module com.recres.web.MainDev
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
   Computing all possible rebind results for 'org.jboss.errai.marshalling.client.api.MarshallerFactory'
      Rebinding org.jboss.errai.marshalling.client.api.MarshallerFactory
         Invoking generator org.jboss.errai.marshalling.rebind.MarshallersGenerator
            Generating Marshallers Bootstrapper...
            Checking ErraiApp.properties for configured types ...
   Computing all possible rebind results for 'org.jboss.errai.ioc.client.container.IOCEnvironment'
      Rebinding org.jboss.errai.ioc.client.container.IOCEnvironment
         Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCEnvironmentGenerator
            Generating Extensions Bootstrapper...
   Computing all possible rebind results for 'org.jboss.errai.ioc.client.Bootstrapper'
      Rebinding org.jboss.errai.ioc.client.Bootstrapper
         Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator
            generating ioc bootstrapping code...
   Compiling 1 permutation
      Compiling permutation 0...
      [ERROR] An internal compiler exception occurred
com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
        at com.google.gwt.dev.js.ast.JsVisitor.translateException(JsVisitor.java:482)
        at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:469)
        at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:444)
        at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
        at com.google.gwt.dev.js.ast.JsNew.traverse(JsNew.java:71)
        at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
        at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:444)
        at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
        at com.google.gwt.dev.js.ast.JsReturn.traverse(JsReturn.java:51)
        at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
        at com.google.gwt.dev.js.ast.JsVisitor.doAcceptWithInsertRemove(JsVisitor.java:461)
        at com.google.gwt.dev.js.ast.JsVisitor.acceptWithInsertRemove(JsVisitor.java:121)
        at com.google.gwt.dev.js.ast.JsBlock.traverse(JsBlock.java:53)
        at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
        at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:444)
        at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
        at com.google.gwt.dev.js.ast.JsFunction.traverse(JsFunction.java:181)
        at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
        at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:444)
        at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
        at com.google.gwt.dev.js.ast.JsExprStmt.traverse(JsExprStmt.java:42)
        at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
        at com.google.gwt.dev.js.ast.JsVisitor.doAcceptWithInsertRemove(JsVisitor.java:461)
        at com.google.gwt.dev.js.ast.JsVisitor.acceptWithInsertRemove(JsVisitor.java:121)
        at com.google.gwt.dev.js.ast.JsBlock.traverse(JsBlock.java:53)
        at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
        at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:444)
        at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
        at com.google.gwt.dev.js.ast.JsProgramFragment.traverse(JsProgramFragment.java:41)
        at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
        at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:444)
        at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
        at com.google.gwt.dev.js.ast.JsProgram.traverse(JsProgram.java:120)
        at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
        at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:444)
        at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
        at com.google.gwt.dev.js.JsSymbolResolver.execImpl(JsSymbolResolver.java:69)
        at com.google.gwt.dev.js.JsSymbolResolver.exec(JsSymbolResolver.java:58)
        at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compilePermutation(JavaToJavaScriptCompiler.java:391)
        at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compilePermutation(JavaToJavaScriptCompiler.java:272)
        at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:198)
        at com.google.gwt.dev.ThreadedPermutationWorkerFactory$ThreadedPermutationWorker.compile(ThreadedPermutationWorkerFactory.java:50)
        at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:74)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
        at com.google.gwt.thirdparty.guava.common.base.Preconditions.checkNotNull(Preconditions.java:212)
        at com.google.gwt.thirdparty.guava.common.collect.MapMakerInternalMap.putIfAbsent(MapMakerInternalMap.java:3521)
        at com.google.gwt.thirdparty.guava.common.collect.Interners$WeakInterner.intern(Interners.java:88)
        at com.google.gwt.dev.js.ast.JsNormalScope.doCreateName(JsNormalScope.java:49)
        at com.google.gwt.dev.js.ast.JsScope.declareName(JsScope.java:60)
        at com.google.gwt.dev.js.ast.JsScope.declareUnobfuscatableName(JsScope.java:91)
        at com.google.gwt.dev.js.JsSymbolResolver$JsResolveSymbolsVisitor.resolveUnqualifiedName(JsSymbolResolver.java:51)
        at com.google.gwt.dev.js.JsAbstractSymbolResolver.endVisit(JsAbstractSymbolResolver.java:54)
        at com.google.gwt.dev.js.ast.JsNameRef.traverse(JsNameRef.java:113)
        at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
        ... 42 more
         [ERROR] at Type_factory__e_d_MediaStreamTrackEvent__quals__j_e_i_Any_j_e_i_Default.java(23): <source info not available>
            com.google.gwt.dev.js.ast.JsNameRef
         [ERROR] at Type_factory__e_d_MediaStreamTrackEvent__quals__j_e_i_Any_j_e_i_Default.java(23): <source info not available>
            com.google.gwt.dev.js.ast.JsNew
         [ERROR] at Type_factory__e_d_MediaStreamTrackEvent__quals__j_e_i_Any_j_e_i_Default.java(23): <source info not available>
            com.google.gwt.dev.js.ast.JsReturn
         [ERROR] at Type_factory__e_d_MediaStreamTrackEvent__quals__j_e_i_Any_j_e_i_Default.java(22): <source info not available>
            com.google.gwt.dev.js.ast.JsBlock
         [ERROR] at Type_factory__e_d_MediaStreamTrackEvent__quals__j_e_i_Any_j_e_i_Default.java(22): <source info not available>
            com.google.gwt.dev.js.ast.JsFunction
         [ERROR] at Type_factory__e_d_MediaStreamTrackEvent__quals__j_e_i_Any_j_e_i_Default.java(22): <source info not available>
            com.google.gwt.dev.js.ast.JsExprStmt
         [ERROR] at com.google.gwt.dev.js.ast.JsProgram(0): var _, prototypesByTypeId, initFnList, PERMUTATION_NOT_SET = -1, permutationId = -1;
function getPermutationId(){
  return permutationId;
}

function setGwtProperty(propertyName, propertyValue){
  if (typeof window === 'object' && typeof window['$gwt'] === 'object') {
    window['$gwt'][propertyName] = propertyValue;
  }
}

function registerEntry(){
  return registerEntry();
}

[...]

            com.google.gwt.dev.js.ast.JsGlobalBlock
         [ERROR] at com.google.gwt.dev.js.ast.JsProgram(0): <JsProgramFragment>
            com.google.gwt.dev.js.ast.JsProgramFragment
         [ERROR] at com.google.gwt.dev.js.ast.JsProgram(0): <JsProgram>
            com.google.gwt.dev.js.ast.JsProgram
      [ERROR] Unrecoverable exception, shutting down
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
        at com.google.gwt.dev.javac.CompilationProblemReporter.logAndTranslateException(CompilationProblemReporter.java:106)
        at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compilePermutation(JavaToJavaScriptCompiler.java:459)
        at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compilePermutation(JavaToJavaScriptCompiler.java:272)
        at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:198)
        at com.google.gwt.dev.ThreadedPermutationWorkerFactory$ThreadedPermutationWorker.compile(ThreadedPermutationWorkerFactory.java:50)
        at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:74)
        at java.lang.Thread.run(Thread.java:745)
      [ERROR] Not all permutation were compiled , completed (0/1)

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment