Giter Site home page Giter Site logo

Issues when Compiling about gwt-jackson HOT 12 CLOSED

nmorel avatar nmorel commented on July 29, 2024
Issues when Compiling

from gwt-jackson.

Comments (12)

nmorel avatar nmorel commented on July 29, 2024

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.

from gwt-jackson.

BenDol avatar BenDol commented on July 29, 2024

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.

from gwt-jackson.

BenDol avatar BenDol commented on July 29, 2024
     [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

from gwt-jackson.

nmorel avatar nmorel commented on July 29, 2024

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.

from gwt-jackson.

BenDol avatar BenDol commented on July 29, 2024

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?

from gwt-jackson.

nmorel avatar nmorel commented on July 29, 2024

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

from gwt-jackson.

BenDol avatar BenDol commented on July 29, 2024

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

from gwt-jackson.

nmorel avatar nmorel commented on July 29, 2024

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.

from gwt-jackson.

BenDol avatar BenDol commented on July 29, 2024

Kk thanks for the help, I have contacted them and will hopefully get this sorted out :D

from gwt-jackson.

BenDol avatar BenDol commented on July 29, 2024

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.

from gwt-jackson.

nmorel avatar nmorel commented on July 29, 2024

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 :)

from gwt-jackson.

BenDol avatar BenDol commented on July 29, 2024

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!

from gwt-jackson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.