Strange gwt compile error: JPrimitiveType JReferenceType

69 views
Skip to first unread message

Raphael André Bauer

unread,
May 20, 2011, 4:29:53 AM5/20/11
to google-web-toolkit
Hi GWTlist,


we are getting a strange compile exception and we are not sure where
it comes from. The project is
up and running for months now, but "out of a sudden" stopped working...
Maybe somebody knows something like that (there is an issue [1] here,
but I am not sure if it's related).

Does anybody have a good starting point to get to the root of the
problem? At the end it seems we or
any 3rd party library we are using is causing the problem. But the
stacktrace does not give any
exact information on that. Stacktrace is attached below.

Any help appreciated...

Thanks,


Raphael

[1] http://code.google.com/p/google-web-toolkit/issues/detail?id=2478


[INFO] Compiling 18 permutations
[INFO] Compiling permutation 0...
[INFO] Process output
[INFO] Compiling
[INFO] Compiling permutation 1...
[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:108)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:277)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:266)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:115)
[INFO] at com.google.gwt.dev.jjs.ast.JBinaryOperation.traverse(JBinaryOperation.java:82)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:362)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:274)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:266)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:115)
[INFO] at com.google.gwt.dev.jjs.ast.JWhileStatement.traverse(JWhileStatement.java:44)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor$ListContextImmutable.traverse(JModVisitor.java:170)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemoveImmutable(JModVisitor.java:337)
[INFO] at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:83)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:362)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:274)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:136)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:132)
[INFO] at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:82)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:362)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:274)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:266)
[INFO] at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:329)
[INFO] at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:297)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor$ListContextImmutable.traverse(JModVisitor.java:170)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemoveImmutable(JModVisitor.java:337)
[INFO] at com.google.gwt.dev.jjs.ast.JClassType.traverse(JClassType.java:80)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:362)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:288)
[INFO] at com.google.gwt.dev.jjs.ast.JProgram.traverse(JProgram.java:1124)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:362)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:274)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:266)
[INFO] at com.google.gwt.dev.jjs.impl.EqualityNormalizer.execImpl(EqualityNormalizer.java:223)
[INFO] at com.google.gwt.dev.jjs.impl.EqualityNormalizer.exec(EqualityNormalizer.java:208)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compilePermutation(JavaToJavaScriptCompiler.java:302)
[INFO] at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:136)
[INFO] at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:192)
[INFO] at com.google.gwt.dev.ThreadedPermutationWorkerFactory$ThreadedPermutationWorker.compile(ThreadedPermutationWorkerFactory.java:49)
[INFO] at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:73)
[INFO] at java.lang.Thread.run(Thread.java:680)
[INFO] Caused by: java.lang.ClassCastException:
com.google.gwt.dev.jjs.ast.JPrimitiveType cannot be cast to
com.google.gwt.dev.jjs.ast.JReferenceType
[INFO] at com.google.gwt.dev.jjs.impl.EqualityNormalizer$BreakupAssignOpsVisitor.endVisit(EqualityNormalizer.java:85)
[INFO] at com.google.gwt.dev.jjs.ast.JBinaryOperation.traverse(JBinaryOperation.java:84)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:362)
[INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:274)
[INFO] ... 38 more
[INFO] [ERROR] at Base64Coder.java(73): in[iLen - 1] == '='
[INFO] com.google.gwt.dev.jjs.ast.JBinaryOperation
[INFO] [ERROR] at Base64Coder.java(73): iLen > 0 && in[iLen - 1] == '='
[INFO] com.google.gwt.dev.jjs.ast.JBinaryOperation
[INFO] [ERROR] at Base64Coder.java(73): while (iLen > 0 &&
in[iLen - 1] == '=') {
[INFO] --iLen;
[INFO] }
[INFO] com.google.gwt.dev.jjs.ast.JWhileStatement
[INFO] [ERROR] at Base64Coder.java(68): {
[INFO] int iLen = in.length;
[INFO] if (iLen % 4 != 0) {
[INFO] throw new IllegalArgumentException("Length of Base64
encoded input string is not a multiple of 4.");
[INFO] }
[INFO] while (iLen > 0 && in[iLen - 1] == '=') {
[INFO] --iLen;
[INFO] }
[INFO] final int oLen = Cast.narrow_int(iLen * 3 / 4);
[INFO] final byte[] out = Array.initDim(byte[].class, {27:1}, -1, oLen, 1);
[INFO] int ip = 0;
[INFO] int op = 0;
[INFO] while (ip < iLen) {
[INFO] final int i0 = in[ip++];
[INFO] final int i1 = in[ip++];
[INFO] final int i2 = ip < iLen ? in[ip++] : 'A';
[INFO] final int i3 = ip < iLen ? in[ip++] : 'A';
[INFO] if (i0 > 127 || i1 > 127 || i2 > 127 || i3 > 127) {
[INFO] throw new IllegalArgumentException("Illegal character in
Base64 encoded data.");
[INFO] }
[INFO] final int b0 = Base64Coder.map2[i0];
[INFO] final int b1 = Base64Coder.map2[i1];
[INFO] final int b2 = Base64Coder.map2[i2];
[INFO] final int b3 = Base64Coder.map2[i3];
[INFO] if (b0 < 0 || b1 < 0 || b2 < 0 || b3 < 0) {
[INFO] throw new IllegalArgumentException("Illegal character in
Base64 encoded data.");
[INFO] }
[INFO] final int o0 = b0 << 2 | b1 >>> 4;
[INFO] final int o1 = (b1 & 15) << 4 | b2 >>> 2;
[INFO] final int o2 = (b2 & 3) << 6 | b3;
[INFO] out[op++] = Cast.narrow_byte(o0);
[INFO] op < oLen && (out[op++] = Cast.narrow_byte(o1));
[INFO] op < oLen && (out[op++] = Cast.narrow_byte(o2));
[INFO] }
[INFO] return out;
[INFO] }
[INFO] com.google.gwt.dev.jjs.ast.JBlock
[INFO] [ERROR] at Base64Coder.java(68): {
[INFO] int iLen = in.length;
[INFO] if (iLen % 4 != 0) {
[INFO] throw new IllegalArgumentException("Length of Base64
encoded input string is not a multiple of 4.");
[INFO] }
[INFO] while (iLen > 0 && in[iLen - 1] == '=') {
[INFO] --iLen;
[INFO] }
[INFO] final int oLen = Cast.narrow_int(iLen * 3 / 4);
[INFO] final byte[] out = Array.initDim(byte[].class, {27:1}, -1, oLen, 1);
[INFO] int ip = 0;
[INFO] int op = 0;
[INFO] while (ip < iLen) {
[INFO] final int i0 = in[ip++];
[INFO] final int i1 = in[ip++];
[INFO] final int i2 = ip < iLen ? in[ip++] : 'A';
[INFO] final int i3 = ip < iLen ? in[ip++] : 'A';
[INFO] if (i0 > 127 || i1 > 127 || i2 > 127 || i3 > 127) {
[INFO] throw new IllegalArgumentException("Illegal character in
Base64 encoded data.");
[INFO] }
[INFO] final int b0 = Base64Coder.map2[i0];
[INFO] final int b1 = Base64Coder.map2[i1];
[INFO] final int b2 = Base64Coder.map2[i2];
[INFO] final int b3 = Base64Coder.map2[i3];
[INFO] if (b0 < 0 || b1 < 0 || b2 < 0 || b3 < 0) {
[INFO] throw new IllegalArgumentException("Illegal character in
Base64 encoded data.");
[INFO] }
[INFO] final int o0 = b0 << 2 | b1 >>> 4;
[INFO] final int o1 = (b1 & 15) << 4 | b2 >>> 2;
[INFO] final int o2 = (b2 & 3) << 6 | b3;
[INFO] out[op++] = Cast.narrow_byte(o0);
[INFO] op < oLen && (out[op++] = Cast.narrow_byte(o1));
[INFO] op < oLen && (out[op++] = Cast.narrow_byte(o2));
[INFO] }
[INFO] return out;
[INFO] }
[INFO] com.google.gwt.dev.jjs.ast.JMethodBody
[INFO] [ERROR] at Base64Coder.java(68): public static final
byte[] decode(null in);
[INFO]
[INFO] com.google.gwt.dev.jjs.ast.JMethod
[INFO] [ERROR] at Base64Coder.java(28): final class
Base64Coder extends Object
[INFO] com.google.gwt.dev.jjs.ast.JClassType
[INFO] [ERROR] at com.google.gwt.dev.jjs.ast.JProgram(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.jjs.JavaToJavaScriptCompiler.logAndTranslateException(JavaToJavaScriptCompiler.java:1149)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compilePermutation(JavaToJavaScriptCompiler.java:460)
[INFO] at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:136)
[INFO] at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:192)
[INFO] at com.google.gwt.dev.ThreadedPermutationWorkerFactory$ThreadedPermutationWorker.compile(ThreadedPermutationWorkerFactory.java:49)
[INFO] at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:73)
[INFO] at java.lang.Thread.run(Thread.java:680)
[INFO] [ERROR] Not all permutation were compiled , completed (0/18)
[INFO] [WARN] Lost communication with remote process
[INFO] java.net.SocketException: Socket closed
[INFO] at java.net.SocketInputStream.socketRead0(Native Method)
[INFO] at java.net.SocketInputStream.read(SocketInputStream.java:129)
[INFO] at java.net.SocketInputStream.read(SocketInputStream.java:182)
[INFO] at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2248)
[INFO] at java.io.ObjectInputStream$BlockDataInputStream.peek(ObjectInputStream.java:2541)
[INFO] at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2551)
[INFO] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1296)
[INFO] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
[INFO] at com.google.gwt.dev.ExternalPermutationWorkerFactory$ExternalPermutationWorker.compile(ExternalPermutationWorkerFactory.java:150)
[INFO] at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:73)
[INFO] at java.lang.Thread.run(Thread.java:680)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------

Raphael André Bauer

unread,
May 20, 2011, 4:49:59 AM5/20/11
to google-web-toolkit
On Fri, May 20, 2011 at 10:29 AM, Raphael André Bauer
<raphael.a...@gmail.com> wrote:
> Hi GWTlist,
>
>
> we are getting a strange compile exception and we are not sure where
> it comes from. The project is
> up and running for months now, but "out of a sudden" stopped working...
> Maybe somebody knows something like that (there is an issue [1] here,
> but I am not sure if it's related).

I added '-Dgwt.draftCompile=true' and it works again. But that's not
really an option for us...

Any ideas?


Thanks :)

Raphael

Raphael André Bauer

unread,
May 20, 2011, 6:19:20 AM5/20/11
to google-web-toolkit
On Fri, May 20, 2011 at 10:49 AM, Raphael André Bauer

<raphael.a...@gmail.com> wrote:
> On Fri, May 20, 2011 at 10:29 AM, Raphael André Bauer
> <raphael.a...@gmail.com> wrote:
>> Hi GWTlist,
>>
>>
>> we are getting a strange compile exception and we are not sure where
>> it comes from. The project is
>> up and running for months now, but "out of a sudden" stopped working...
>> Maybe somebody knows something like that (there is an issue [1] here,
>> but I am not sure if it's related).
>
> I added '-Dgwt.draftCompile=true' and it works again. But that's not
> really an option for us...

<optimizationLevel>0</optimizationLevel>
also fixes the issue, but again - not an option as the generated files
are approx. 6 times the size.

Again - any hints regarding debugging the issue are appreciated.


Thanks :)


Raphael

Brian Reilly

unread,
May 20, 2011, 9:15:28 AM5/20/11
to google-we...@googlegroups.com
Have you recently moved to a newer version of GWT? The errors look
vaguely like the kinds of errors that 3rd party libraries ran into
when GWT 2.2 was released. However, I don't see any 3rd party packages
listed in the stack trace. My best guess is that you may have multiple
versions of the GWT jars on your classpath during compilation.

It might help if you can provide the versions of GWT and any 3rd party
libraries you're using.

-- Brian


On Fri, May 20, 2011 at 6:19 AM, Raphael André Bauer

> --
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

Raphael André Bauer

unread,
May 20, 2011, 9:34:12 AM5/20/11
to google-we...@googlegroups.com
On Fri, May 20, 2011 at 3:15 PM, Brian Reilly <brian....@gmail.com> wrote:
> Have you recently moved to a newer version of GWT? The errors look
> vaguely like the kinds of errors that 3rd party libraries ran into
> when GWT 2.2 was released. However, I don't see any 3rd party packages
> listed in the stack trace. My best guess is that you may have multiple
> versions of the GWT jars on your classpath during compilation.
>
> It might help if you can provide the versions of GWT and any 3rd party
> libraries you're using.
>
> -- Brian

Hi Brian,


thanks for the reply :)
We had 2.1.0 / 2.2.0 probs as well, but afaik the symptom was
something like: java.lang.IncompatibleClassChangeError: Found
interface com.google.gwt.core.ext.typeinfo.JClassType, but class was
expected . So I guess it's yet another problem...

After some debugging I found out that Base64Coder.java [1] might refer
to a 3rd party lib we are using: Emite (An excellent jabber / xmpp GWT
library).

I am currently asking on their list if they know anything [2]...

Any help still appreciated...

I'll keep you updated,


Best,

Raphael


[1] https://github.com/EmiteGWT/emite/blob/master/src/main/java/com/calclab/emite/core/client/xmpp/sasl/Base64Coder.java
[2] http://groups.google.com/group/emite/browse_thread/thread/eb6c469c9593fbb2

Raphael André Bauer

unread,
May 25, 2011, 4:51:59 AM5/25/11
to google-we...@googlegroups.com
On Fri, May 20, 2011 at 3:34 PM, Raphael André Bauer
<raphael.a...@gmail.com> wrote:
> On Fri, May 20, 2011 at 3:15 PM, Brian Reilly <brian....@gmail.com> wrote:
...
Just a quick follow-up:
- Bug 2478 seems to be related and I added a description of our
problem (http://code.google.com/p/google-web-toolkit/issues/detail?id=2478#c11)
- Hotfix: If you run into the error you can change the char[] to
Character[] in Base64Coder.java - and the error goes away magically.

So far,

Raphael

Reply all
Reply to author
Forward
0 new messages