Saturday, November 7, 2015

JsInterop compile error

Hello community:

I'm using GWT 2.8-SNAPSHOT and new annotations JsInterop.
I have a very simple class, but gives the error in compilation time.

@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL)
public class JsObject {
   
   
public static native List getOwnPropertyNames(Object obj);
   
}

public class gwt_sample implements EntryPoint {
   
   
@Override
   
public void onModuleLoad() {
       
JsObject.getOwnPropertyNames(new String());
   
}
}

 Compiling 1 permutation
[INFO]             Compiling permutation 0...
[INFO]             [ERROR] An internal compiler exception occurred
[INFO] com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.translateException(JVisitor.java:111)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:130)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:122)
[INFO] at com.google.gwt.dev.jjs.ast.JTransformer.transform(JTransformer.java:1056)
[INFO] at com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST$GenerateJavaScriptTransformer.emitStaticMethods(GenerateJavaScriptAST.java:1751)
[INFO] at com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST$GenerateJavaScriptTransformer.transformDeclaredType(GenerateJavaScriptAST.java:639)
[INFO] at com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST$GenerateJavaScriptTransformer.transformDeclaredType(GenerateJavaScriptAST.java:514)
[INFO] at com.google.gwt.dev.jjs.ast.JTransformer.transformClassType(JTransformer.java:95)
[INFO] at com.google.gwt.dev.jjs.ast.JTransformer$JRewriterVisitor.visit(JTransformer.java:670)
[INFO] at com.google.gwt.dev.jjs.ast.JClassType.traverse(JClassType.java:140)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:127)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:122)
[INFO] at com.google.gwt.dev.jjs.ast.JTransformer.transform(JTransformer.java:1056)
[INFO] at com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST$GenerateJavaScriptTransformer.transformProgram(GenerateJavaScriptAST.java:1202)
[INFO] at com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST$GenerateJavaScriptTransformer.transformProgram(GenerateJavaScriptAST.java:514)
[INFO] at com.google.gwt.dev.jjs.ast.JTransformer$JRewriterVisitor.visit(JTransformer.java:918)
[INFO] at com.google.gwt.dev.jjs.ast.JProgram.traverse(JProgram.java:1252)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:127)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:122)
[INFO] at com.google.gwt.dev.jjs.ast.JTransformer.transform(JTransformer.java:1056)
[INFO] at com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST.execImpl(GenerateJavaScriptAST.java:3001)
[INFO] at com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST.exec(GenerateJavaScriptAST.java:2782)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compilePermutation(JavaToJavaScriptCompiler.java:377)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compilePermutation(JavaToJavaScriptCompiler.java:272)
[INFO] at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:198)
[INFO] at com.google.gwt.dev.ThreadedPermutationWorkerFactory$ThreadedPermutationWorker.compile(ThreadedPermutationWorkerFactory.java:50)
[INFO] at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:74)
[INFO] at java.lang.Thread.run(Thread.java:745)
[INFO] Caused by: java.lang.NullPointerException
[INFO] at com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST$GenerateJavaScriptTransformer.transformMethod(GenerateJavaScriptAST.java:788)
[INFO] at com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST$GenerateJavaScriptTransformer.transformMethod(GenerateJavaScriptAST.java:514)
[INFO] at com.google.gwt.dev.jjs.ast.JTransformer$JRewriterVisitor.visit(JTransformer.java:823)
[INFO] at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:715)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:127)
[INFO] ... 26 more
[INFO]                [ERROR] at JsObject.java(19): com.logikas.gwt.sample.client.JsObject.getOwnPropertyNames(Ljava/lang/Object;)Ljava/util/List;
[INFO]                   com.google.gwt.dev.jjs.ast.JMethod
[INFO]                [ERROR] at JsObject.java(17): com.logikas.gwt.sample.client.JsObject (extends Object)
[INFO]                   com.google.gwt.dev.jjs.ast.JClassType
[INFO]                [ERROR] at Unknown(0): <JProgram>
[INFO]                   com.google.gwt.dev.jjs.ast.JProgram
[INFO]             [ERROR] Unrecoverable exception, shutting down
[INFO] com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
[INFO] at com.google.gwt.dev.javac.CompilationProblemReporter.logAndTranslateException(CompilationProblemReporter.java:106)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compilePermutation(JavaToJavaScriptCompiler.java:459)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compilePermutation(JavaToJavaScriptCompiler.java:272)
[INFO] at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:198)
[INFO] at com.google.gwt.dev.ThreadedPermutationWorkerFactory$ThreadedPermutationWorker.compile(ThreadedPermutationWorkerFactory.java:50)
[INFO] at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:74)
[INFO] at java.lang.Thread.run(Thread.java:745)
[INFO]             [ERROR] Not all permutation were compiled , completed (0/1)
[INFO]       [WARN] recompile failed
[INFO]       [WARN] continuing to serve previous version

Any idea?


--
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 http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment