Problem with MessageBodyWriter when send json post

Andrew5 years ago

Hello im trying to forward an event to an external api but i get the following error:

2020-03-26 16:24:28  INFO: [d75eeaa3: teltonika > 191.125.17.239] HEX: 00000001
2020-03-26 16:24:28 ERROR: MessageBodyWriter not found for media type=application/json, type=class java.util.HashMap, genericType=class java.util.HashMap.
2020-03-26 16:24:28  INFO: [d75eeaa3] id: 864403045746733, time: 2020-03-26 16:24:22, lat: -33.41973, lon: -70.59939, course: 0.0

my configuration xml file is this:

    <entry key='forward.enable'>true</entry>
    <entry key='forward.json'>true</entry>
    <entry key='forward.url'>http://127.0.0.1:9901/api/v1/posicionamiento</entry>

any ideas for what is going on?

Thanks!

Anton Tananaev5 years ago

Are you using latest official release?

Andrew5 years ago

this is what i have in my pom xml file

 <modelVersion>4.0.0</modelVersion>
    <groupId>org.traccar</groupId>
    <artifactId>traccar</artifactId>
    <version>4.6-SNAPSHOT</version>

and was downloaded from the oficial website.

Anton Tananaev5 years ago

Sounds like you are building from source? Are you using a file JAR with dependencies?

Andrew5 years ago

Sorry for the late response, and yes im using a JAR file with dependencies.

Anton Tananaev5 years ago

That's the problem.

Andrew5 years ago

Any suggestion how to fix it please?. The server is being installed in a vps with centos 7 and compiled with this command :

mvn -B clean
mvn -B -Pjar-with-dependencies -Dmaven.test.skip=true package

Thanks in advance.

Anton Tananaev5 years ago

Use regular build. The one with dependencies won't work.