Suddenly getting exceptions during compile in TypeOracle annotation processing

10 views
Skip to first unread message

martijn...@gmail.com

unread,
Aug 17, 2009, 1:01:26 PM8/17/09
to Google Web Toolkit
I'm suddenly getting strange exceptions when compiling my application
that uses EJB3 objects with annotations and Gilead. The exceptions
seems to happen for different annotation objects each time, however
it's always for the same reason: NPE in the TypeOracleMediator.

I've tried this with the old version of Gilead (Hibernate4gwt 1.1.1)
and with the new version. I've also tried this with GWT 1.6.4, and
1.7.0. In every case it's giving me the same NPE.

Nothing significant has changed in my code, I've just made some
general improvements over the last few days which are working find in
hosted mode. However compile seems to be screwed up.

Does anyone have any idea what is going on here?

==== The following is my compile script:
#!/bin/sh
APPDIR=`dirname $0`;
java -Xmx768M -XstartOnFirstThread -cp "\
$APPDIR/src:\
$APPDIR/war/WEB-INF/lib/adapter-core-1.2.3.823.jar:\
$APPDIR/war/WEB-INF/lib/adapter4gwt-1.2.3.823.jar:\
$APPDIR/war/WEB-INF/lib/hibernate-util-1.2.3.823.jar:\
$APPDIR/../OrangeMountain_GWT_Codelib/src:\
/Users/spronk/Documents/JavaLibraries/gwtx-1.5.2.jar:\
/Users/spronk/Documents/JavaLibraries/gwt-mac-1.7.0/gwt-user.jar:\
/Users/spronk/Documents/JavaLibraries/gwt-mac-1.7.0/gwt-dev-mac.jar:\
/Users/spronk/Documents/JavaLibraries/gwt-dnd-2.6.2.jar:\
/Users/spronk/Documents/JavaLibraries/gwtext-2.0.6/gwtext.jar:\
" com.google.gwt.dev.Compiler -war "$APPDIR/war" "$@"
com.ycp.YCPClient


=== This is the stacktrace produced by the compiler:
Compiling module com.ycp.YCPClient
Refreshing module from source
Refreshing TypeOracle
Processing types in compilation unit: jar:file:/Users/spronk/
Documents/workspace_ycp/YCPClient/war/WEB-INF/lib/
adapter4gwt-1.2.3.823.jar!/net/sf/gilead/emul/java5/ejb3/javax/
persistence/EntityResult.java
Found type 'EntityResult'
[ERROR]
java.lang.ClassNotFoundException: javax.persistence.FieldResult
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at com.google.gwt.dev.javac.TypeOracleMediator.getClassLiteral
(TypeOracleMediator.java:763)
at
com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationElementValueArray
(TypeOracleMediator.java:726)
at
com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationElementValue
(TypeOracleMediator.java:676)
at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod
(TypeOracleMediator.java:986)
at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethods
(TypeOracleMediator.java:1054)
at com.google.gwt.dev.javac.TypeOracleMediator.resolveTypeDeclaration
(TypeOracleMediator.java:1444)
at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits
(TypeOracleMediator.java:389)
at com.google.gwt.dev.javac.TypeOracleMediator.refresh
(TypeOracleMediator.java:417)
at com.google.gwt.dev.javac.CompilationState.refresh
(CompilationState.java:179)
at com.google.gwt.dev.javac.CompilationState.<init>
(CompilationState.java:93)
at com.google.gwt.dev.cfg.ModuleDef.getCompilationState
(ModuleDef.java:264)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:283)
at com.google.gwt.dev.Compiler.run(Compiler.java:170)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:124)
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:131)
[ERROR] Unexpected
java.lang.NullPointerException
at
com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationElementValue
(TypeOracleMediator.java:704)
at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod
(TypeOracleMediator.java:986)
at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethods
(TypeOracleMediator.java:1054)
at com.google.gwt.dev.javac.TypeOracleMediator.resolveTypeDeclaration
(TypeOracleMediator.java:1444)
at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits
(TypeOracleMediator.java:389)
at com.google.gwt.dev.javac.TypeOracleMediator.refresh
(TypeOracleMediator.java:417)
at com.google.gwt.dev.javac.CompilationState.refresh
(CompilationState.java:179)
at com.google.gwt.dev.javac.CompilationState.<init>
(CompilationState.java:93)
at com.google.gwt.dev.cfg.ModuleDef.getCompilationState
(ModuleDef.java:264)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:283)
at com.google.gwt.dev.Compiler.run(Compiler.java:170)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:124)
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:131)

Youlian

unread,
Sep 6, 2009, 8:56:13 AM9/6/09
to Google Web Toolkit
Hello martijn!

I have the exact same problem. Were you able to solve it?


stacktrace:

GWT Compiling client-side code.
Compiling module yln.javaprogquiz.Main
Refreshing module from source
Refreshing TypeOracle
Processing types in compilation unit: jar:file:/C:/Programme/
Java/gilead-1.2.3.823/dist/adapter4gwt-1.2.3.823.jar!/net/sf/gilead/
emul/java5/ejb3/javax/persistence/ManyToMany.java
Found type 'ManyToMany'
[ERROR]
java.lang.ClassNotFoundException: javax.persistence.CascadeType
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
(CompileTaskRunner.java:88)
(CompileTaskRunner.java:88)
at
com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger
(CompileTaskRunner.java:82)
at com.google.gwt.dev.Compiler.main(Compiler.java:131)


On Aug 17, 7:01 pm, "martijn.spr...@gmail.com"

martijn...@gmail.com

unread,
Sep 21, 2009, 11:00:56 PM9/21/09
to Google Web Toolkit
I actually were not able to solve it.

I'm starting work on this again, and am tempted to switch back to
using Hibernate xml instead of annotations, since that seemed to be
the thing that caused these sudden issues for me to happen.

Have you been able to find a solution?

Cheers,
Martijn

Youlian

unread,
Sep 22, 2009, 9:44:34 AM9/22/09
to Google Web Toolkit
Hi Martijn!

Finally it works. I forgot to include "ejb3-persistence.jar" in the
classpath.
The reason for this - byside me beeing a dullard - was that I am using
NetBeans, which comes with two Hibernate library templates. One which
includes ejb3-persistence.jar and one which does not.

Cheers,
Julian

On Sep 22, 5:00 am, "martijn.spr...@gmail.com"
Reply all
Reply to author
Forward
0 new messages