GWT Internal Compiler Exception

353 views
Skip to first unread message

Magnus

unread,
Aug 27, 2012, 2:10:45 AM8/27/12
to google-we...@googlegroups.com
Hello,

when compiling a GWT project in Eclipse, an internal compiler exception is reported. See the console output below.

(Compiling with log level debug produced too much output.)

What is going on there?

GWT 2.4, Eclipse Juno, using eclipse plugin

Magnus



Compiling module bcs.bcs
   Validating newly compiled units
      Ignored 1 unit with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
   [ERROR] An internal compiler exception occurred
com.google.gwt.dev.jjs.InternalCompilerException: Failed to get JNode
	at com.google.gwt.dev.jjs.impl.TypeMap.get(TypeMap.java:140)
	at com.google.gwt.dev.jjs.impl.TypeMap.get(TypeMap.java:71)
	at com.google.gwt.dev.jjs.impl.BuildTypeMap.getType(BuildTypeMap.java:730)
	at com.google.gwt.dev.jjs.impl.BuildTypeMap.access$000(BuildTypeMap.java:99)
	at com.google.gwt.dev.jjs.impl.BuildTypeMap$BuildDeclMapVisitor.visit(BuildTypeMap.java:145)
	at org.eclipse.jdt.internal.compiler.ast.Argument.traverse(Argument.java:154)
	at org.eclipse.jdt.internal.compiler.ast.TryStatement.traverse(TryStatement.java:856)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.traverse(MethodDeclaration.java:239)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1239)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:687)
	at com.google.gwt.dev.jjs.impl.BuildTypeMap.createPeersForNonTypeDecls(BuildTypeMap.java:637)
	at com.google.gwt.dev.jjs.impl.BuildTypeMap.exec(BuildTypeMap.java:514)
	at com.google.gwt.dev.jjs.impl.BuildTypeMap.exec(BuildTypeMap.java:523)
	at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:599)
	at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:33)
	at com.google.gwt.dev.Precompile.precompile(Precompile.java:284)
	at com.google.gwt.dev.Precompile.precompile(Precompile.java:233)
	at com.google.gwt.dev.Precompile.precompile(Precompile.java:145)
	at com.google.gwt.dev.Compiler.run(Compiler.java:232)
	at com.google.gwt.dev.Compiler.run(Compiler.java:198)
	at com.google.gwt.dev.Compiler$1.run(Compiler.java:170)
	at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88)
	at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82)
	at com.google.gwt.dev.Compiler.main(Compiler.java:177)
      [ERROR] <no source info>: public class java.lang.InterruptedException
	extends java.lang.Exception
/*   methods   */
[unresolved] public void <init>() 
[unresolved] public void <init>(java.lang.String) 



         org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding
      [ERROR] at Supervisor.java(262): InterruptedException e
         org.eclipse.jdt.internal.compiler.ast.Argument

Magnus

unread,
Aug 27, 2012, 11:58:37 AM8/27/12
to google-we...@googlegroups.com
Hi,

for your interest:

The source file and line number above (Supervisor.java, 262) pointed to an unused method. I commented it out and the compiler exception disappeared.

Here is the method:

 private static void sleepLocal (long ms)
 {
  try
  {
   Thread.sleep (ms);
  }
  catch (InterruptedException e)
  {
   e.printStackTrace ();
  }
 }

The compiler error message pointed at the line with the InterupptedException.

The method was untouched for more than a year. I wonder why it now caused this problem, and also why the compiler behaves like this.

Magnus 


Brian Slesinsky

unread,
Aug 27, 2012, 8:28:06 PM8/27/12
to google-we...@googlegroups.com
Thread and InterruptedException aren't available in JavaScript. Possibly some change in a different file caused the compiler to reach this file when it was never reached before (because it's unused). You could confirm this by rolling back to a previous version of your source code and recompiling.

An internal compiler error is a bug, but the fix would probably just be to report a nicer error.

- Brian
Reply all
Reply to author
Forward
0 new messages