nmorel / gwt-jackson

gwt-jackson is a JSON parser for GWT. It uses Jackson 2.x annotations to customize the serialization/deserialization process.
Apache License 2.0
111 stars 55 forks source link

No source code is available for type com.fasterxml.jackson.databind.ObjectMapper; did you forget to inherit a required module? #136

Open ravi473 opened 6 years ago

ravi473 commented 6 years ago

Happy New Year !!!!

I am new to GWT and I have been trying to figure out the solution for this issue but none of them are worked. I am using gwt:2.0.4 java - 8 tried with various jackson versions - 2.0.0 to latest one

issue: [ERROR] Errors in 'file:/C:/Users/ravi/Development/testing/ui/common/client/RestService.java' [INFO] [ERROR] Line 14: No source code is available for type com.fasterxml.jackson.databind.ObjectMapper; did you forget to inherit a required module? [INFO] [ERROR] Line 34: No source code is available for type ca.ontario.health.hns.ui.common.server.util.RestUtil; did you forget to inherit a required mod ule? [INFO] [ERROR] Errors in 'file:/C:/Users/ravi/Development/testing/ui/common/client/RestService.java' [INFO] [ERROR] Line 16: No source code is available for type org.springframework.web.client.RestTemplate; did you forget to inherit a required module? [INFO] [ERROR] Line 43: No source code is available for type org.springframework.web.client.HttpClientErrorException; did you forget to inherit a required

my POM.xml: `

com.fasterxml.jackson.core jackson-databind 2.0.0
    <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>2.0.0</version>
    </dependency>

` and I am inheriting anything in gwt.xml.

Please advice how can I use Jackson in my GWT project to use the ObjectMapper to read json string(from REST API) and convert as Java Object and List's.

Thanks in advance.

johnwyz88 commented 6 years ago

+1

I am facing the same issue.

gwt-compile: [java] Compiling module xxx [java] Tracing compile failure path for type 'com.xxx.xxx.xxx.xxx.xxx.xxx.xxx' [java] [ERROR] Errors in 'file:/Users/xxx/xxx.java' [java] [ERROR] Line 20: No source code is available for type com.fasterxml.jackson.databind.ObjectMapper; did you forget to inherit a required module? [java] [ERROR] Aborting compile due to errors in some input files

@nmorel can you comment whether this is an expected defect or we are doing something wrong?

nmorel commented 6 years ago

Are you trying to use com.fasterxml.jackson.databind.ObjectMapper instead of com.github.nmorel.gwtjackson.client.ObjectMapper ?
You should not depend on jackson databind package in your client code, only the annotations.

johnwyz88 commented 6 years ago

I am trying to transpile com.fasterxml.jackson.databind.ObjectMapper (on server side) to com.github.nmorel.gwtjackson.client.ObjectMapper (on client side).

On Feb 18, 2018 12:15 AM, "Nicolas Morel" notifications@github.com wrote:

Are you trying to use com.fasterxml.jackson.databind.ObjectMapper instead of com.github.nmorel.gwtjackson.client.ObjectMapper ? You should not depend on jackson databind package in your client code, only the annotations.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nmorel/gwt-jackson/issues/136#issuecomment-366499708, or mute the thread https://github.com/notifications/unsubscribe-auth/ADcccL6GxsAbaN2cK9Ou94oKJaEPb2XEks5tV9w_gaJpZM4RQ4-v .