Closed doggie1989 closed 8 years ago
Also not that the class literal requirement in the forked gwt sdk is relaxed.
A public static final Class MY_CLASS = MyClass.class; field reference will work. Also, a final method that has a single return statement will also work:
public static final Class myClass() {
// do stuff
return MyClass.class;
}
This is because my fork will traverse the reference tree to see if the source of the supplied node is a constant.
I use this a lot, especially for Class[]{} as they can get nasty to keep repeating.
com.google.gwt.reflect.Reflect can not be found in version 0.5
Ahh, it is in net.wetheinter:gwt-user:2.7.0
I moved it into the Gwt fork as it already depends on the enhancements in the Gwt fork for all of the efficient implementations to work.
I might consider making an inefficient version that does not depend on the fork, but that is beyond my means at this time.
I am here and waiting for u James.
what dependency should I add?
now likes below providedCompile "net.wetheinter:xapi-jre:0.5" providedCompile "net.wetheinter:xapi-gwt:0.5"
you mean that I should add net.wetheinter:gwt-user:2.7.0 ?
Yes, net.wetheinter:gwt-user:2.7.0 is the one.
providedCompile "net.wetheinter:xapi-gwt:0.5"
providedCompile "net.wetheinter:gwt-user:2.7.0"
providedCompile "net.wetheinter:gwt-dev:2.7.0"
Now I added this in build.gradle. but when I do compile,it shows:
:processResources UP-TO-DATE
:classes
:gwtc
Compiling module com.doggie.run.App
Tracing compile failure path for type 'java.io.Closeable'
[ERROR] Errors in 'com/google/gwt/emul/java/io/Closeable.java'
[ERROR] Line 10: Default methods are allowed only at source level 1.8 or above
Tracing compile failure path for type 'java.lang.reflect.Parameter'
[ERROR] Errors in 'com/google/gwt/emul/java/lang/reflect/Parameter.java'
[ERROR] Line 58: The method getTypeName() is undefined for the type Type
[ERROR] Errors in 'com/google/gwt/emul/java/lang/reflect/AnnotatedElement.java'
[ERROR] Line 27: Default methods are allowed only at source level 1.8 or above
[ERROR] Line 50: Default methods are allowed only at source level 1.8 or above
[ERROR] Line 54: Default methods are allowed only at source level 1.8 or above
[ERROR] Line 64: Default methods are allowed only at source level 1.8 or above
Tracing compile failure path for type 'java.lang.reflect.Int_Field'
[ERROR] Errors in 'com/google/gwt/emul/java/lang/reflect/Int_Field.java'
[ERROR] Line 40: The method isAssignableFrom(Class<capture#3-of ?>) is undefined for the type Class
You will definitely want to be compiling with a java 8 jdk. You don't have to compile your shared code with java 8, but in order for Gwt to support java 8 language features, requires jdk 8 to compile.
Hi James
I will take a look, I have only installed jdk8 on my machine...
Ahh, yes.
Well, just a reminder is that you do not need to run JDK 8 on your server. Just your gwt compilation needs access to java 8, so you don't have to worry about server runtimes.
If you need to share classes with your server, you will likely want to compile your classes with jdk 7, and then just run gwtc with java 8. Setting the compiler source/target to 1.7 can allow you to produce 1.7 class files from a 1.8 compiler.
The Structure of my project is that DoggieClient Project,DoggieServer Project,DoggieSDK, There are 3 projects,the DoggieSDK Contains all Request and Response Model,shared between DoggieClient and DoggieServer. DoggieClient(Gwt Side) call DoggieServer via restful apis(CORS support)
...
:compileJava警告: 来自注释处理程序 'xapi.dev.processor.InjectionAnnotationProcessor' 的受支持 source 版本 'RELEASE_7' 低于 -source '1.8' 1 个警告
:processResources UP-TO-DATE
:classes
:gwtc
Compiling module com.doggie.run.App
Tracing compile failure path for type 'java.util.function.LongUnaryOperator'
[ERROR] Errors in 'jar:file:/Users/yangdoggie/Desktop/sts-bundle/gradleUserHome/caches/modules-2/files-2.1/net.wetheinter/gwt-user/2.7.0/878d5326630e24e406dabb3ef72db367330b135f/gwt-user-2.7.0.jar!/com/google/gwt/emul/java/util/function/LongUnaryOperator.java'
[ERROR] Line 10: Cannot refer to the non-final local variable before defined in an enclosing scope
[ERROR] Line 13: Default methods are allowed only at source level 1.8 or above
[ERROR] Line 15: Cannot refer to the non-final local variable after defined in an enclosing scope
[ERROR] Line 19: Lambda expressions are allowed only at source level 1.8 or above
[ERROR] Line 10: Lambda expressions are allowed only at source level 1.8 or above
[ERROR] Line 18: Static methods are allowed in interfaces only at source level 1.8 or above
[ERROR] Line 15: Lambda expressions are allowed only at source level 1.8 or above
[ERROR] Line 8: Default methods are allowed only at source level 1.8 or above
[ERROR] Line 18: Illegal modifier for the interface method identity; only public & abstract are permitted
Tracing compile failure path for type 'java.util.function.LongPredicate'
[ERROR] Errors in 'jar:file:/Users/yangdoggie/Desktop/sts-bundle/gradleUserHome/caches/modules-2/files-2.1/net.wetheinter/gwt-user/2.7.0/878d5326630e24e406dabb3ef72db367330b135f/gwt-user-2.7.0.jar!/com/google/gwt/emul/java/util/function/LongPredicate.java'
[ERROR] Line 13: Default methods are allowed only at source level 1.8 or above
[ERROR] Line 19: Cannot refer to the non-final local variable other defined in an enclosing scope
[ERROR] Line 10: Cannot refer to the non-final local variable other defined in an enclosing scope
[ERROR] Line 19: Lambda expressions are allowed only at source level 1.8 or above
[ERROR] Line 10: Lambda expressions are allowed only at source level 1.8 or above
[ERROR] Line 17: Default methods are allowed only at source level 1.8 or above
[ERROR] Line 14: Lambda expressions are allowed only at source level 1.8 or above
[ERROR] Line 8: Default methods are allowed only at source level 1.8 or above
Tracing compile failure path for type 'java.util.concurrent.CountdownLatch'
[ERROR] Errors in 'jar:file:/Users/yangdoggie/Desktop/sts-bundle/gradleUserHome/caches/modules-2/files-2.1/net.wetheinter/xapi-gwt/0.5/d72ac1d1ee0d093e5551ca8f7a81e93e6e9084f3/xapi-gwt-0.5.jar!/com/google/gwt/emul/java/util/concurrent/CountdownLatch.java'
[ERROR] Line 14: No source code is available for type xapi.log.X_Log; did you forget to inherit a required module?
Tracing compile failure path for type 'java.io.Closeable'
[ERROR] Errors in 'jar:file:/Users/yangdoggie/Desktop/sts-bundle/gradleUserHome/caches/modules-2/files-2.1/net.wetheinter/gwt-user/2.7.0/878d5326630e24e406dabb3ef72db367330b135f/gwt-user-2.7.0.jar!/com/google/gwt/emul/java/io/Closeable.java'
[ERROR] Line 10: Default methods are allowed only at source level 1.8 or above
Tracing compile failure path for type 'java.util.function.IntUnaryOperator'
[ERROR] Errors in 'jar:file:/Users/yangdoggie/Desktop/sts-bundle/gradleUserHome/caches/modules-2/files-2.1/net.wetheinter/gwt-user/2.7.0/878d5326630e24e406dabb3ef72db367330b135f/gwt-user-2.7.0.jar!/com/google/gwt/emul/java/util/function/IntUnaryOperator.java'
[ERROR] Line 10: Cannot refer to the non-final local variable before defined in an enclosing scope
[ERROR] Line 13: Default methods are allowed only at source level 1.8 or above
[ERROR] Line 15: Cannot refer to the non-final local variable after defined in an enclosing scope
[ERROR] Line 19: Lambda expressions are allowed only at source level 1.8 or above
[ERROR] Line 10: Lambda expressions are allowed only at source level 1.8 or above
[ERROR] Line 18: Static methods are allowed in interfaces only at source level 1.8 or above
[ERROR] Line 15: Lambda expressions are allowed only at source level 1.8 or above
[ERROR] Line 8: Default methods are allowed only at source level 1.8 or above
[ERROR] Line 18: Illegal modifier for the interface method identity; only public & abstract are permitted
Tracing compile failure path for type 'java.util.ServiceLoader'
[ERROR] Errors in 'jar:file:/Users/yangdoggie/Desktop/sts-bundle/gradleUserHome/caches/modules-2/files-2.1/net.wetheinter/xapi-gwt/0.5/d72ac1d1ee0d093e5551ca8f7a81e93e6e9084f3/xapi-gwt-0.5.jar!/com/google/gwt/emul/java/util/ServiceLoader.java'
[ERROR] Line 12: No source code is available for type xapi.util.api.ReceivesValue
I only have jdk8 installed...but it still happens this error when compiling...
Looks like you still have the old gwt sdk on your classpath. My fork replaces the old one, and it seems the older one is still on top in the classpath.
There are dependency replacement tools you can write for gradle... I can't remember how to do it off the top of my head, but you should be able to rewrite all com.google.gwt dependencies to net.wetheinter.
@JamesXNelson
Sorry for the delay due to many projects at same time...
Many thanks to this project.
Finally I got this running!!!!Very good...and I remove strict param of compile option to get it compiled.!!!!
I have tested 3 weights of reflections in my project and they are working properly.
hey doggie1989 - could you share some details on how you got it working?
Also is there some way to get a Class from its Name? GwtReflect seems to want me to pass a Class everywhere I saw, but I need a way to get stuff by just knowing the classname (and package path)
Or can I simply use the JRE way --> Class.forName(myClassName);
?
Ah, by browsing the code, I've found this:
ConstPool.getConstPool().getClassByName(myClassName);
I guess I can use this.
UPDATE: My current problem is that I use the maven build plugin org.codehaus.mojo.gwt-maven-plugin for a lot of it's features like Interface generation for css, i18n & async RPC - but sadly this plugin won't allow me to set the sourceLevel to 1.8 --> [ERROR] Source level must be one of [auto, 1.6, 1.7]
and with it set to 1.7 I get a lot of these of course: Default methods are allowed only at source level 1.8 or above
Class.forName("com.foo.ClassLiteral") is actually correct.
The const pool thing is what is filling in a big map of name->class objects, and the scope in which that method is invoked determines when that classpool will get filled in.
Also, I overhauled the gwt-maven-plugin as well. Just set your groupId to net.wetheinter, and it should take all the same arguments, plus a couple more. I haven't rebased in a little while, but the source of my changes is here: https://github.com/JamesXNelson/gwt-maven-plugin/tree/allow-changing-groupId-for-bundled-Gwt-dependencies
I should have actually noted that, if you are using the forked plugin, you get complete support for overriding gwt-user and gwt-dev jars with the reflection-enabled one. Whereas before I had to get my jars on the top of the classpath (usually through hideous <excludes/>
statements), the updated plugin actually swaps the internal artifact id to use the groupId of your choice.
hey guys
I am using Gradle not Maven... I just put these lines:
//xapi gwt providedCompile "net.wetheinter:xapi-gwt:0.5" providedCompile "net.wetheinter:gwt-user:2.7.0" providedCompile "net.wetheinter:gwt-dev:2.7.0"
//gwt
// providedCompile "com.google.gwt:gwt-user:${gwtVersion}" // providedCompile "com.google.gwt:gwt-dev:${gwtVersion}" // providedRuntime "com.google.gwt:gwt-servlet:${gwtVersion}"
@JamesXNelson
Hi Nelson
I have also found some type of class which I could not make it magic...like a uibinder view class...
okey, so now I switched the gwt-maven-plugin to your groupid also, and with this my current problems are:
[INFO] Compiling module at.ac.fhcampuswien.atom.App
[INFO] Tracing compile failure path for type 'com.sencha.gxt.data.client.loader.XmlReader'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/com/sencha/gxt/gxt/3.1.1/gxt-3.1.1.jar!/com/sencha/gxt/data/client/loader/XmlReader.java'
[INFO] [ERROR] Line 52: The type XmlReader<M,Base>.XmlSplittable must implement the inherited abstract method Splittable.removeReified(String)
[INFO] Tracing compile failure path for type 'java.util.concurrent.CountdownLatch'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/com/google/gwt/emul/java/util/concurrent/CountdownLatch.java'
[INFO] [ERROR] Line 14: No source code is available for type xapi.log.X_Log; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'java.util.ServiceLoader'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/com/google/gwt/emul/java/util/ServiceLoader.java'
[INFO] [ERROR] Line 12: No source code is available for type xapi.util.api.ReceivesValue<T>; did you forget to inherit a required module?
[INFO] [ERROR] Aborting compile due to errors in some input files
Ok, those two lines with xapi interfaces will need to be removed. If you want to, you should be able to patch those two emul classes on your own local copy. Either checkout the https://github.com/WeTheInternet/gwt-sandbox repo and mod the actual files, or just put them in com/google/gwt/emul/java/util/* in your own codebase on top of the jar.
As for the XmlReader one, it looks like the version of gxt you are using, 3.1.1 has not been updated against the Gwt master copy. It looks like the new methods are used by SplittableList... Brandon says it was fixed in 3.1.2: https://plus.googleapis.com/+BrandonDonnelson/posts/eEZtaTPuNzw
I will definitely remove those two extra dependencies. If you don't want to bother with them, you should be able to get rid of the warnings by just inheriting "xapi.X_Core" gwt module. The sources are in the gwt uber jar you are using, you just need to tell the compiler to use them. :-)
@doggie1989 -> Please describe what you want to do with that UI binder view class and how you want to make it magic, and I will try to help you.
Hey there James, I tried your suggestion to also add <inherits name='xapi.X_Core' />
to my *.gwt.xml file where I previously only had <inherits name='com.google.gwt.reflect.Reflect' />
, but with this I get tons of new errors:
[INFO] Tracing compile failure path for type 'xapi.collect.impl.LazyList'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/collect/impl/LazyList.java'
[INFO] [ERROR] Line 14: No source code is available for type xapi.inject.impl.SingletonProvider<X>; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.collect.impl.LazyTreeMap'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/collect/impl/LazyTreeMap.java'
[INFO] [ERROR] Line 7: No source code is available for type xapi.inject.impl.SingletonProvider<X>; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.util.impl.LazyInstance'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/util/impl/LazyInstance.java'
[INFO] [ERROR] Line 13: No source code is available for type xapi.inject.X_Inject; did you forget to inherit a required module?
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/util/impl/LazyProvider.java'
[INFO] [ERROR] Line 7: No source code is available for type xapi.inject.impl.SingletonProvider<X>; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.log.X_Log'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/log/X_Log.java'
[INFO] [ERROR] Line 57: No source code is available for type xapi.inject.X_Inject; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.collect.impl.LazySet'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/collect/impl/LazySet.java'
[INFO] [ERROR] Line 14: No source code is available for type xapi.inject.impl.SingletonProvider<X>; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.collect.impl.LazyLinkedList'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/collect/impl/LazyLinkedList.java'
[INFO] [ERROR] Line 7: No source code is available for type xapi.inject.impl.SingletonProvider<X>; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.gwt.ui.autoui.client.SafeHtmlUserInterface'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/gwt/ui/autoui/client/SafeHtmlUserInterface.java'
[INFO] [ERROR] Line 10: No source code is available for type xapi.ui.autoui.impl.AbstractUserInterface<T>; did you forget to inherit a required module?
[INFO] [ERROR] Line 15: No source code is available for type xapi.ui.autoui.api.UiRenderingContext; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.util.impl.LazySingleton'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/util/impl/LazySingleton.java'
[INFO] [ERROR] Line 8: No source code is available for type xapi.inject.X_Inject; did you forget to inherit a required module?
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/util/impl/LazyProvider.java'
[INFO] [ERROR] Line 7: No source code is available for type xapi.inject.impl.SingletonProvider<X>; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.collect.impl.LazyLinkedMap'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/collect/impl/LazyLinkedMap.java'
[INFO] [ERROR] Line 14: No source code is available for type xapi.inject.impl.SingletonProvider<X>; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.gwt.process.ConcurrencyServiceGwt'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/gwt/process/ConcurrencyServiceGwt.java'
[INFO] [ERROR] Line 31: No source code is available for type xapi.process.api.ConcurrentEnvironment; did you forget to inherit a required module?
[INFO] [ERROR] Line 144: No source code is available for type xapi.process.api.AsyncCondition; did you forget to inherit a required module?
[INFO] [ERROR] Line 29: No source code is available for type xapi.process.api.AsyncLock; did you forget to inherit a required module?
[INFO] [ERROR] Line 27: No source code is available for type xapi.process.impl.ConcurrencyServiceAbstract; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.util.impl.LazyProvider'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/util/impl/LazyProvider.java'
[INFO] [ERROR] Line 7: No source code is available for type xapi.inject.impl.SingletonProvider<X>; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.gwt.ui.autoui.client.UserInterfaceFactoryGwt'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/gwt/ui/autoui/client/UserInterfaceFactoryGwt.java'
[INFO] [ERROR] Line 62: No source code is available for type xapi.ui.autoui.api.UiRendererOptions; did you forget to inherit a required module?
[INFO] [ERROR] Line 32: No source code is available for type xapi.ui.autoui.api.BeanValueProvider; did you forget to inherit a required module?
[INFO] [ERROR] Line 35: No source code is available for type xapi.ui.autoui.api.UiOptions; did you forget to inherit a required module?
[INFO] [ERROR] Line 85: No source code is available for type xapi.ui.autoui.api.DoNotIndex; did you forget to inherit a required module?
[INFO] [ERROR] Line 24: No source code is available for type xapi.ui.autoui.impl.AbstractUserInterfaceFactory; did you forget to inherit a required module?
[INFO] [ERROR] Line 29: No source code is available for type xapi.ui.autoui.api.UiRenderingContext; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.gwt.model.ModelGwt'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/gwt/model/ModelGwt.java'
[INFO] [ERROR] Line 10: No source code is available for type xapi.model.impl.AbstractModel; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.gwt.ui.autoui.client.ToHtmlUiRenderer'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/gwt/ui/autoui/client/ToHtmlUiRenderer.java'
[INFO] [ERROR] Line 12: No source code is available for type xapi.ui.autoui.api.UiRendererSelector; did you forget to inherit a required module?
[INFO] [ERROR] Line 15: No source code is available for type xapi.ui.autoui.api.UserInterface<T>; did you forget to inherit a required module?
[INFO] [ERROR] Line 15: No source code is available for type xapi.ui.autoui.api.UiRenderingContext; did you forget to inherit a required module?
[INFO] [ERROR] Line 12: No source code is available for type xapi.ui.autoui.api.UiRenderer<T>; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.util.X_Properties'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/util/X_Properties.java'
[INFO] [ERROR] Line 55: No source code is available for type xapi.inject.impl.SingletonProvider<X>; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.collect.X_Collect'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/collect/X_Collect.java'
[INFO] [ERROR] Line 127: No source code is available for type xapi.inject.X_Inject; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.gwt.model.service.ModelServiceGwt'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/gwt/model/service/ModelServiceGwt.java'
[INFO] [ERROR] Line 45: No source code is available for type xapi.model.X_Model; did you forget to inherit a required module?
[INFO] [ERROR] Line 76: No source code is available for type xapi.model.api.ModelSerializer<M>; did you forget to inherit a required module?
[INFO] [ERROR] Line 35: No source code is available for type xapi.model.api.Model; did you forget to inherit a required module?
[INFO] [ERROR] Line 103: No source code is available for type xapi.dev.source.CharBuffer; did you forget to inherit a required module?
[INFO] [ERROR] Line 104: No source code is available for type xapi.io.X_IO; did you forget to inherit a required module?
[INFO] [ERROR] Line 104: No source code is available for type xapi.io.api.DelegatingIOCallback<V>; did you forget to inherit a required module?
[INFO] [ERROR] Line 30: No source code is available for type xapi.model.impl.AbstractModelService; did you forget to inherit a required module?
[INFO] [ERROR] Line 45: No source code is available for type xapi.model.service.ModelService; did you forget to inherit a required module?
[INFO] [ERROR] Line 78: No source code is available for type xapi.model.impl.ModelSerializerDefault<M>; did you forget to inherit a required module?
[INFO] [ERROR] Line 105: No source code is available for type xapi.source.impl.StringCharIterator; did you forget to inherit a required module?
[INFO] [ERROR] Line 120: No source code is available for type xapi.model.api.PrimitiveSerializer; did you forget to inherit a required module?
[INFO] [ERROR] Line 115: No source code is available for type xapi.model.api.ModelKey; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.gwt.io.IOServiceGwt'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/gwt/io/IOServiceGwt.java'
[INFO] [ERROR] Line 44: No source code is available for type xapi.io.impl.AbstractIOService<Transport>; did you forget to inherit a required module?
[INFO] [ERROR] Line 164: No source code is available for type xapi.inject.impl.SingletonProvider<X>; did you forget to inherit a required module?
[INFO] [ERROR] Line 78: No source code is available for type xapi.io.api.IOCallback<V>; did you forget to inherit a required module?
[INFO] [ERROR] Line 78: No source code is available for type xapi.io.api.IORequest<V>; did you forget to inherit a required module?
[INFO] [ERROR] Line 160: No source code is available for type xapi.io.api.CancelledException; did you forget to inherit a required module?
[INFO] [ERROR] Line 78: No source code is available for type xapi.io.api.IOMessage<B>; did you forget to inherit a required module?
[INFO] [ERROR] Line 50: No source code is available for type xapi.io.impl.AbstractIOService<Transport>.AbstractIORequest; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.collect.impl.LazyHashMap'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/collect/impl/LazyHashMap.java'
[INFO] [ERROR] Line 7: No source code is available for type xapi.inject.impl.SingletonProvider<X>; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.time.X_Time'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/time/X_Time.java'
[INFO] [ERROR] Line 15: No source code is available for type xapi.inject.X_Inject; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.util.X_String'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/util/X_String.java'
[INFO] [ERROR] Line 17: No source code is available for type xapi.inject.X_Inject; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.gwt.time.TimeServiceGwt'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/gwt/time/TimeServiceGwt.java'
[INFO] [ERROR] Line 23: No source code is available for type xapi.inject.impl.SingletonProvider<X>; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'xapi.collect.impl.LazyLinkedSet'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/collect/impl/LazyLinkedSet.java'
[INFO] [ERROR] Line 12: No source code is available for type xapi.inject.impl.SingletonProvider<X>; did you forget to inherit a required module?
About gxt: 3.1.1 is the last GPL version sencha released, so I guess I'm stuck with it until either they release a new version or I replace the gxt grid in my app with something else. But if its really just one method in one class I guess I can try to patch it myself.
UPDATE: the gxt problem seems to have been a VERY easy fix:
public void removeReified(String key) {
reifiedData.remove(key);
}
(I've copied the file into my codebase and added the above method, the error messages concerning gxt are now gone from the gwt compiler output)
@doggie1989 I wonder why you did not run in the same problems I do now - what xapi gwt modules are you inheriting in your *.gwt.xml file?
okey, another update: Using this list of inherits:
<inherits name='com.google.gwt.reflect.Reflect' />
<inherits name='xapi.X_Core' />
<inherits name='xapi.X_Inject' />
<inherits name='xapi.X_Model' />
<inherits name='xapi.X_AutoUi' />
<inherits name='xapi.X_Process' />
I've been able to reduce the gwt compiler errors down to this one:
[INFO] Compiling module at.ac.fhcampuswien.atom.App
[INFO] Tracing compile failure path for type 'xapi.process.impl.ProcessQueueAbstract'
[INFO] [ERROR] Errors in 'jar:file:/home/kaefert/.m2/repository/net/wetheinter/xapi-gwt/0.5/xapi-gwt-0.5.jar!/xapi/process/impl/ProcessQueueAbstract.java'
[INFO] [ERROR] Line 23: No source code is available for type xapi.reflect.X_Reflect; did you forget to inherit a required module?
[INFO] [ERROR] Aborting compile due to errors in some input files
adding the suspected module <inherits name='xapi.X_Reflect' />
does produce this error for me:
[ERROR] Failed to execute goal net.wetheinter:gwt-maven-plugin:2.7.0:compile (gwt-compile) on project atom-client: GWT Module xapi.X_Reflect not found in project sources or resources. -> [Help 1]
Ah. I had intended to full remove and deprecate X_Reflect since I moved 95% of its functionality to GwtReflect when I merged into the Gwt fork. Unfortunately, X_Process still has a reference to that class, and that reference is in core code, so no Gwt references allowed. So, looks like I need to update that on my end!
Either you remove X_Process or you create xapi.X_Reflect.gwt.xml with <source path="reflect" />
and inherit that as well. The source should be in the jar, just have to tell Gwt to use it.
Finally, I'm curious which apis you are using. If you need to, email source and I can give you better aide there.
Or, you can override ProcessQueueAbstract to just call Array.newInstance(), which is what I did on my end. It will work in Gwt if the component type has been enhanced with array reflection support (calling Array.newInstance(ComponentLiteral.class, 0) is enough to have the generator fill in support).
What do you mean with what APIs I'm using? You mean from xapi? I plan to use the reflection, nothing else planed as of yet. I just added all those inherit statements to get rid of the errors that the GWT compiler comes up with when I inherit only <inherits name='com.google.gwt.reflect.Reflect' />
and <inherits name='xapi.X_Core' />
as a workaround of the errors that came before that.
@kaefert
Ok. Sorry, just trying to figure out what configuration and jars you need to get the minimum viable product working. :-/ I will make some integration tests for reflection that do not depend on anything else.
If you want to meet for a half hour or so to debug, just drop me an email and I will try to find a time when we are both awake; I work for people in Washington DC and Tokyo, so I already have a very strange schedule. :-)
Okey, so I've now tried the other way round, instead of inheriting all the xapi modules that seemed to require each other, I've gone back to only inherit <inherits name='com.google.gwt.reflect.Reflect' />
in my *.gwt.xml and fixed the errors by replacing the xapi.log.X_Log reference in CountdownLatch.java
with java.util.logging
(so gwt logging, see http://www.gwtproject.org/doc/latest/DevGuideLogging.html ) and commented out the implements ReceivesValue<Class<S>>
from ServiceLoader.java
Now I think I'm back to an error caused by GXT 3.1.1
[ERROR] An internal compiler exception occurred
com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
at com.google.gwt.dev.jjs.ast.JVisitor.translateException(JVisitor.java:111)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:276)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:118)
at com.google.gwt.dev.jjs.ast.JCastOperation.traverse(JCastOperation.java:67)
at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
at com.google.gwt.dev.jjs.ast.JModVisitor.acceptImmutable(JModVisitor.java:305)
at com.google.gwt.dev.jjs.ast.JMethodCall.visitChildren(JMethodCall.java:258)
at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:249)
at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:118)
at com.google.gwt.dev.jjs.ast.JExpressionStatement.traverse(JExpressionStatement.java:42)
at com.google.gwt.dev.jjs.ast.JModVisitor$ListContext.traverse(JModVisitor.java:88)
at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemove(JModVisitor.java:331)
at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:92)
at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:139)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:135)
at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:83)
at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:692)
at com.google.gwt.dev.jjs.ast.JConstructor.traverse(JConstructor.java:148)
at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
at com.google.gwt.dev.jjs.impl.UnifyAst.mainLoop(UnifyAst.java:1474)
at com.google.gwt.dev.jjs.impl.UnifyAst.exec(UnifyAst.java:948)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.unifyJavaAst(JavaToJavaScriptCompiler.java:1417)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.constructJavaAst(JavaToJavaScriptCompiler.java:1227)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:1147)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:252)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:255)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:202)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:143)
at com.google.gwt.dev.Compiler.run(Compiler.java:216)
at com.google.gwt.dev.Compiler.run(Compiler.java:170)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:127)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
at com.google.gwt.dev.Compiler.main(Compiler.java:134)
Caused by: java.lang.NoSuchMethodError: com.google.gwt.dev.resource.ResourceOracle.getResourceMap()Ljava/util/Map;
at com.sencha.gxt.core.rebind.XTemplatesGenerator.getTemplateResource(XTemplatesGenerator.java:171)
at com.sencha.gxt.core.rebind.XTemplatesGenerator.generate(XTemplatesGenerator.java:110)
at com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40)
at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:745)
at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:103)
at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:78)
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:262)
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:251)
at com.google.gwt.dev.PrecompilationContextCreator$1.getAllPossibleRebindAnswers(PrecompilationContextCreator.java:87)
at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createStaticRebindExpression(UnifyAst.java:518)
at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createRebindExpression(UnifyAst.java:488)
at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleMagicMethodCall(UnifyAst.java:616)
at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.endVisit(UnifyAst.java:308)
at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:251)
at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
[ERROR] at BlueMenuAppearance.java(39): GWT.create(MenuBaseAppearance$BaseMenuTemplate.class)
com.google.gwt.dev.jjs.ast.JMethodCall
[ERROR] at BlueMenuAppearance.java(39): (MenuBaseAppearance$BaseMenuTemplate)
GWT.create(MenuBaseAppearance$BaseMenuTemplate.class)
com.google.gwt.dev.jjs.ast.JCastOperation
[ERROR] at BlueMenuAppearance.java(39): this((BlueMenuAppearance$BlueMenuResources) GWT.create(com.sencha.gxt.theme.blue.client.menu.BlueMenuAppearance.BlueMenuResources.class), (MenuBaseAppearance$BaseMenuTemplate) GWT.create(MenuBaseAppearance$BaseMenuTemplate.class))
com.google.gwt.dev.jjs.ast.JMethodCall
[ERROR] at BlueMenuAppearance.java(39): this((BlueMenuAppearance$BlueMenuResources) GWT.create(com.sencha.gxt.theme.blue.client.menu.BlueMenuAppearance.BlueMenuResources.class), (MenuBaseAppearance$BaseMenuTemplate) GWT.create(MenuBaseAppearance$BaseMenuTemplate.class))
com.google.gwt.dev.jjs.ast.JExpressionStatement
[ERROR] at BlueMenuAppearance.java(38): {
this((BlueMenuAppearance$BlueMenuResources) GWT.create(com.sencha.gxt.theme.blue.client.menu.BlueMenuAppearance.BlueMenuResources.class), (MenuBaseAppearance$BaseMenuTemplate) GWT.create(MenuBaseAppearance$BaseMenuTemplate.class));
}
com.google.gwt.dev.jjs.ast.JBlock
[ERROR] at BlueMenuAppearance.java(38): {
this((BlueMenuAppearance$BlueMenuResources) GWT.create(com.sencha.gxt.theme.blue.client.menu.BlueMenuAppearance.BlueMenuResources.class), (MenuBaseAppearance$BaseMenuTemplate) GWT.create(MenuBaseAppearance$BaseMenuTemplate.class));
}
com.google.gwt.dev.jjs.ast.JMethodBody
[ERROR] at BlueMenuAppearance.java(38): public BlueMenuAppearance();
com.google.gwt.dev.jjs.ast.JConstructor
UPDATE: okey, so it seems GXT is using the in gwt2.7 depricated method Map<String, Resource> getResourceMap();
from the interface gwt/dev/core/src/com/google/gwt/dev/resource/ResourceOracle.java
which has been removed in the current master branch and therefore in your fork also. I'm gonna try to readd it to your gwt fork and see if it will work that simple.
UPDATE2: okey so I had to readd that method to that interface and at two implementations of it:
modified: dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java
modified: dev/core/src/com/google/gwt/dev/resource/ResourceOracle.java
modified: dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java
QUESTION: how can I deploy your modified gwt fork to my local maven repository?
UPDATE3: Ahh, found that you have a script for that under maven/push-gwt.sh
UPDATE4: yeayy! made it build, lets see if I can make it work also ;)
UPDATE5: okey, so I need to enhance classes but need xapi to not enhance their annotations, since for them there are no sources available (javax.persistence.* annotations) This page: https://github.com/WeTheInternet/xapi/tree/master/gwt/gwt-reflect says there is some way to control what is beeing enhanced, but doesn't go into specifics.. could you help me with that?
[INFO] Tracing compile failure path for type 'javax.persistence.GeneratedValueProxy'
[INFO] [ERROR] Errors in '/tmp/gwt-codeserver-8300531248848360435.tmp/at.ac.fhcampuswien.atom.App/compile-2/gen/javax/persistence/GeneratedValueProxy.java'
[INFO] [ERROR] Line 14: No source code is available for type javax.persistence.GenerationType; did you forget to inherit a required module?
[INFO] [ERROR] Line 10: No source code is available for type javax.persistence.GeneratedValue; did you forget to inherit a required module?
So if it where Christmas and I was allowed to wish for something, then I would ask for a way to enhance all methods of a class and of all it's subclasses. I don't care for fields, annotations or anything else that could be made accessible through reflection. Ah and also the zero argument constructor of each of my subclasses.
UPDATE6: I think I have found how @doggie1989 was able to not run into the same inherits problems as I did - simply not using any xapi library, but only your modified gwt sdk - it seems everything required for reflection is contained therein.
@kaefert
The gwt version I am using is @JamesXNelson 's. After I did this action, I got it running....
@kaefert -> I'm pretty sure the missing source warning is due to the annotation mirror being generated for GeneratedValue (GeneratedValueProxy). Did you try adding the source for those two classes as super-source? That should make all the problems go away.
Also, regarding cascading inclusions, I would recommend:
@ReflectionStrategy(
memberRetention = @GwtRetention(privacy = 0), // retains nothing
methodRetention = @GwtRetention() // default is all members
magicSupertypes = true // keep supertypes
)
I did not do extensive testing on this, though I should. If you run into anything, lemme know.
Also, if you want to, you could open a PR for your changes to the Gwt sdk to remove those dependencies, and I can merge it so the next release you won't have to maintain any workarounds.
Hey there @JamesXNelson I've added all the annotations my entity classes use as super sources, the compile runs through now, but in deployed mode the reflection does not work and the codeserver does not succeed compiling. these are the errors printed:
Tracing compile failure path for type 'javax.persistence.OneToManyProxy'
[ERROR] Errors in 'generated://300382BA10A15C99CF8931DE871AA31C/javax/persistence/OneToManyProxy.java'
[ERROR] Line 33: Return type for the method is missing
[ERROR] Line 34: targetEntity cannot be resolved to a variable
[ERROR] Line 28: Type mismatch: cannot convert from FetchType to CascadeType[]
[ERROR] Line 25: T cannot be resolved to a type
[ERROR] Line 33: Syntax error, insert "VariableDeclarators" to complete LocalVariableDeclaration
[ERROR] Line 25: Syntax error on token "extends", , expected
[ERROR] Line 33: Syntax error, insert ";" to complete LocalVariableDeclarationStatement
[ERROR] Line 25: Syntax error on token(s), misplaced construct(s)
[ERROR] Line 15: Syntax error on token "extends", , expected
[ERROR] Line 26: targetEntity cannot be resolved or is not a field
[ERROR] Line 25: Incorrect number of arguments for type Class<T>; it cannot be parameterized with arguments <T, Object>
[ERROR] Line 25: Syntax error on token ",", ; expected
[ERROR] Line 25: Syntax error on token ")", ; expected
[ERROR] Line 33: Syntax error on token "extends", , expected
[ERROR] Line 13: The type OneToManyProxy must implement the inherited abstract method OneToMany.targetEntity()
See snapshot: /tmp/javax.persistence.OneToManyProxy477461326539176518.java
Tracing compile failure path for type 'constants.Const0_41'
[ERROR] Errors in 'generated://34D622366C22E44428D2BB5B58416422/constants/Const0_41.java'
[ERROR] Line 15: The constructor OneToManyProxy(Class<Void>, FetchType, CascadeType[], boolean, String) is undefined
See snapshot: /tmp/constants.Const0_411810881476730787807.java
Tracing compile failure path for type 'constants.Const0_44'
[ERROR] Errors in 'generated://9A211D1C3B8E42C90EA9E15672611E7C/constants/Const0_44.java'
[ERROR] Line 11: The constructor OneToManyProxy(Class<Void>, FetchType, CascadeType[], boolean, String) is undefined
See snapshot: /tmp/constants.Const0_445372256371829720658.java
And this is the generated code that seems to make the GWT compiler throw these errors:
package javax.persistence;
import static com.google.gwt.reflect.shared.ReflectUtil.nativeToString;
import static java.lang.reflect.Array.clone;
import java.lang.annotation.Annotation;
import javax.persistence.CascadeType;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
public class OneToManyProxy implements Annotation, OneToMany {
private final boolean orphanRemoval;
private final String mappedBy;
private final FetchType fetch;
private final CascadeType[] cascade;
private final Class<T extends Object> targetEntity;
public OneToManyProxy (boolean orphanRemoval, String mappedBy, FetchType fetch, CascadeType[] cascade, Class<T extends Object> targetEntity) {
this.orphanRemoval = orphanRemoval;
this.mappedBy = mappedBy;
this.fetch = fetch;
this.cascade = cascade;
this.targetEntity = targetEntity;
}
public final boolean orphanRemoval () {
return orphanRemoval;
}
public final String mappedBy () {
return mappedBy;
}
public final FetchType fetch () {
return fetch;
}
public final CascadeType[] cascade () {
return clone(cascade);
}
public final Class<T extends Object> targetEntity () {
return targetEntity;
}
public final Class<? extends Annotation> annotationType () {
return OneToMany.class;
}
public final boolean equals (Object other) {
return other == this;
}
public final String toString () {
return "@javax.persistence.OneToMany(" +
nativeToString(this) + ")";
}
}
Hmm, I would need kind of the opposite of @ReflectionStrategy(magicSupertypes = true)
something like @ReflectionStrategy(magicSubtypes = true)
to enhance all subclasses.
gwt-ent had an annotation with those properties:
@Reflectable(superClasses = false, assignableClasses = true, relationTypes = false, fields = false, methods = true, constructors = true, classAnnotations = false, fieldAnnotations = false)
where the assignableClasses = true
would be the important one for me.
I don't have (or don't want to make) a list of all subclasses of my DomainObject - They only need to be on the classpath during gwt compile time and in the servlets runtime. I detect what is really there on the service side (with a quite complicated walk over all the contents in the jar files I can find - see https://github.com/fhcampuswien/atom/blob/master/atom-server/src/main/java/at/ac/fhcampuswien/atom/server/DomainAnalyzer.java ) and send the metadata to the client, which uses this metadata to build the userinterface and use reflection to get and set values of my DomainObjects.
UPDATE: I've created pullrequests for the changes I did on xapi - I don't know if they brake anything else, I don't have any idea what that code does, I've simply removed the dependencies that where creating a problem with the gwt compiler. Also I'm sorry that its two seperate pull requests, I did this with the web UI here on github.com and I couldn't see how to put two files in a single pull request.
UPDATE2: with the annotation
@ReflectionStrategy(annotationRetention = ReflectionStrategy.NONE, magicSupertypes = true )
on my DomainObject class (which is a subclass of Object) the line
GwtReflect.magicClass(DomainObject.class);
causes the GWT compiler to hang forever on
[INFO] Compiling module at.ac.fhcampuswien.atom.App
and never finishes (I've let it sit for 15 minutes, normally a compile of my app takes less than 1 minute). Removing the annotation from DomainObject makes it compile again and give the (non fatal info) errors seen in my comment from 3 days ago.
Many thanks for the pull request. I will review and merge.
As for the magic subtypes, that sounds like a pretty reasonable use case. I will take a look at it sometime this week; it is much more expensive to look at subtypes, since I must walk the whole application every time. However, better to make the machine do it than you. :-)
As for the compile hang, that is definitely sad. Is it possible for me to check out and run the code locally to see if I can replicate?
PS -> I also do some classpath scanning and lookups. I'm not sure how your DomainAnalyzer works internally, but I do have some nice multi-threaded code for selectively scanning the classpath. :-)
I'm sorry I haven't committed the xapi reflection using version to the public repository yet, but I'll make and commit a branch for you to GitHub next time I'm at the office so you can try to replicate the problem.
The more pressing issue for me looks to be the one I've described in this comment: https://github.com/WeTheInternet/xapi/issues/4#issuecomment-150784865 (since I can't work around this by not using the annotation)
About my DomainAnalyzer - it walks resources gained from the classloader - and it handles all my annotations that I use to tell my UI how to handle which attributes and permissions and all that stuff.
@JamesXNelson hey there! sorry it took me so long. I've updated the public version of my project @ https://github.com/fhcampuswien/atom and added a branch "using-xapi".
You should be able to see the gwt compiler hanging when you check out that branch and run
mvn clean install
For making it actually run (if you revert the last commit of that branch or comment out the @ReflectionStrategy
annotation in the class at.ac.fhcampuswien.atom.shared.domain.DomainObject
or change magicSupertypes to false) you would need to configure a database connection in the file atom-server/src/main/resources/META-INF/persistence.xml
ok, great. I will pull that down and take it for a spin probably tomorrow night.
If I don't post back by Thursday, ping me in case I forget. Feel free to reach me on gchat as well; if I am in a meeting or sleeping I simply won't respond until later. :-)
I have some documentation locally that I will upload to the gwt-sandbox repo... hopefully this weekend, however I am doubly busy at work at the moment.
The quick 'n dirty version:
There are a bunch of unit tests (here:)[https://github.com/WeTheInternet/xapi/blob/master/gwt/gwt-reflect/src/test/java/com/google/gwt/reflect/test/FieldTests.java] that you can also use as an example.
I will complete the proper documentation as soon as I find some time.