Closed BenDol closed 10 years ago
Do you have any ObjectMapper declared ? Or you get this error just when adding the com.gwtplatform.dispatch.rest.DispatchRest
?
Which version of gwtp are you using ? There was a problem with an older version when having both rpc and rest dispatcher.
Using version 1.3.1 I am only declaring com.gwtplatform.dispatch.rest.DispatchRest
module and also created some GWTP rest "services" on the client side (so the generator will pick them up). That is all.
[java] Invoking generator com.google.gwt.inject.rebind.GinjectorGenerator
[java] [ERROR] Error injecting com.gwtplatform.dispatch.rest.client.ActionMetadataProvider: Unable to create or inherit binding: No @Inject or default constructor found for com.gwtplatform.dispatch.rest.client.ActionMetadataProvider
[java] Path to required node:
[java] com.gwtplatform.dispatch.rest.client.RestRequestBuilderFactory [com.gwtplatform.dispatch.rest.client.gin.RestDispatchAsyncModule.configureDispatch(RestDispatchAsyncModule.java:100)]
[java] -> com.gwtplatform.dispatch.rest.client.DefaultRestRequestBuilderFactory [com.gwtplatform.dispatch.rest.client.gin.RestDispatchAsyncModule.configureDispatch(RestDispatchAsyncModule.java:100)]
[java] -> com.gwtplatform.dispatch.rest.client.ActionMetadataProvider [@Inject constructor of com.gwtplatform.dispatch.rest.client.DefaultRestRequestBuilderFactory]
[java] [ERROR] Error injecting com.gwtplatform.dispatch.rest.client.serialization.JacksonMapperProvider: Unable to create or inherit binding: No @Inject or default constructor found for com.gwtplatform.dispatch.rest.client.serialization.JacksonMapperProvider
[java] Path to required node:
[java] com.gwtplatform.dispatch.rest.client.serialization.Serialization [com.gwtplatform.dispatch.rest.client.gin.RestDispatchAsyncModule.configureDispatch(RestDispatchAsyncModule.java:104)]
[java] -> com.gwtplatform.dispatch.rest.client.serialization.JsonSerialization [com.gwtplatform.dispatch.rest.client.gin.RestDispatchAsyncModule.configureDispatch(RestDispatchAsyncModule.java:104)]
[java] -> com.gwtplatform.dispatch.rest.client.serialization.JacksonMapperProvider [@Inject constructor of com.gwtplatform.dispatch.rest.client.serialization.JsonSerialization]
[java] [ERROR] Errors in 'gen/com/gwtplatform/mvp/client/DesktopGinjectorProvider.java'
[java] [ERROR] Line 8: Failed to resolve 'com.gwtplatform.mvp.client.DesktopGinjector' via deferred binding
You also declare com.gwtplatform.dispatch.rpc.DispatchRpc
in your gwt.xml.
Did you try with one simple rest service first ?
It seems like a configuration problem of gwtp. Maybe you should also ask on their forum.
A quick search on your error gives http://stackoverflow.com/questions/22578452/how-do-i-use-gwtp-with-ginjector-extensions.
That stackoverflow isn't quite the same as my issue. But appreciate you taking the time to help me out here. What do you mean by try one simple rest service first?
You said you "created some GWTP rest "services"". Did you try with only one simple rest service ? Like a service with only a get method returning a "Hello World!" ?
I didn't use a lot GWTP so I'm not sure how you should configure it. It's working on my current project and I simply followed their wiki.
i see you have <set-configuration-property name="gin.ginjector.modules" value="nz.co.doltech.ims.client.gin.ClientModule" />
. From their wiki :
If you are using a generated GINjector and have something similar to
<set-configuration-property name="gin.ginjector.modules"
value="com.gwtplatform.carstore.client.gin.SharedModule"/>
You need to change set-configuration-property to extend-configuration-property
I just deleted my services to just get it compiling and it still throws 100s of the same error message above. Same with extend-configuration-property, still not working.
[WARN] Unknown type 'com.github.nmorel.gwtjackson.client.ObjectWriter' specified in deferred binding rule
I don't understand this at all. I have the sources and never had troubles compiling like this before.
.. other tasks ..
<!--
================================
Build Application Binaries
================================
-->
<target name="javac" depends="tests" description="Compile java source">
<mkdir dir="war/WEB-INF/classes" />
<javac srcdir="src" includes="**" encoding="utf-8" destdir="war/WEB-INF/classes" source="1.7" target="1.7"
nowarn="true" debug="true" debuglevel="lines,vars,source" includeantruntime="false">
<classpath refid="project.class.path" />
<classpath refid="tomcat.libs"/>
</javac>
<copy todir="war/WEB-INF/classes">
<fileset dir="src" excludes="**/*.java" />
<fileset dir="resources" excludes="**/*.java" />
<fileset dir="database" excludes="**/*.java" />
</copy>
</target>
<target name="gwtc" depends="javac" description="GWT compile to JavaScript">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler" maxmemory="512m">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
</classpath>
<arg value="-war"/>
<arg value="war"/>
<!--arg value="-strict" /-->
<!-- Logging level arguments -->
<!--arg value="-logLevel" />
<arg value="ERROR" /-->
<!-- Optimization arguments -->
<!--arg value="-XenableClosureCompiler"/>
<arg value="-XdisableClassMetadata"/-->
<!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
<jvmarg value="-Xmx512M"/>
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg value="nz.co.doltech.framework.module.Framework"/>
<arg value="nz.co.doltech.framework.login.Login"/>
<arg value="nz.co.doltech.ims.Ims"/>
</java>
</target>
<target name="build" depends="gwtc" description="Build web application entry point"/>
.. other tasks ..
This is my build command
Were you using GWTP rpc dispatcher and mvp module with success before ? If you remove the rest dispatcher module, your project compile ?
You should definitely ask to gwtp team. It seems you are using their ginjector generation seeing your bootstraper configuration. I only used the rest dispatcher module so I don't really know what's going on.
Kk thanks for the help, I have contacted them and will hopefully get this sorted out :D
Never resolved this in my old environment, but I recently moved to maven and its working fine now. No idea what was going on here.
Maybe you had some dependencies missing if it is resolved with Maven. Did you have jackson-annotations.jar and jackson-annotations-sources.jar in your classpath before ? The later is needed by the GWT compiler.
Thanks for the report :)
Yeah I did have them in my class path, triple checked it when I was trying to resolve the issue. But it is possible that Ivy was messing up the dependencies on the build process. Not really sure though!
Hey I am using 0.6.2 and getting these errors on compile: http://pastebin.com/vKJneM4x Not sure why this is happening. Here is the implementation:
com.gwtplatform.dispatch.rest.DispatchRest
That's it. I use Ivy dependency manager and all the jars are i the classpath and war (webapp) directory. Not sure what is going on here.