Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
smathew2949
Contributor III
Contributor III

org.codehaus.jackson.JsonParseException: Unexpected character ('D' (code 68))

Hi Team,

i have code written in tJavaRow to convert my mongo DB row to LIST so that I can write them to JSON file. code was working on Talend 7.3 version with mongo connector 3.2.X but post upgrade to Talend 8 version which does not have 3.2.X connector i had to upgrade my mongo connector to 3.5.X post i started getting error as below . Please suggest what would be the alternative to this problem. Please the check the screenshot as well

Exception in component tJavaRow_5 (Copy_of_Dynamicsconnectiontest)

org.codehaus.jackson.JsonParseException: Unexpected character ('D' (code 68)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

 at [Source: java.io.StringReader@7dc51783; line: 1, column: 3]

at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1433)

at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:521)

at org.codehaus.jackson.impl.JsonParserMinimalBase._reportUnexpectedChar(JsonParserMinimalBase.java:442)

at org.codehaus.jackson.impl.ReaderBasedParser._handleUnexpectedValue(ReaderBasedParser.java:1198)

at org.codehaus.jackson.impl.ReaderBasedParser.nextToken(ReaderBasedParser.java:485)

at org.codehaus.jackson.map.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:211)

at org.codehaus.jackson.map.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:194)

at org.codehaus.jackson.map.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:30)

at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2732)

at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1863)

at crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest.tMongoDBInput_11Process(Copy_of_Dynamicsconnectiontest.java:2839)

at crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest.tMongoDBConnection_1Process(Copy_of_Dynamicsconnectiontest.java:2033)

at crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest.tJava_2Process(Copy_of_Dynamicsconnectiontest.java:1819)

at crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest.tLibraryLoad_2Process(Copy_of_Dynamicsconnectiontest.java:1682)

at crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest.tLibraryLoad_1Process(Copy_of_Dynamicsconnectiontest.java:1528)

at crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest.tPrejob_1Process(Copy_of_Dynamicsconnectiontest.java:1352)

at crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest.runJobInTOS(Copy_of_Dynamicsconnectiontest.java:

Labels (3)
5 Replies
Anonymous
Not applicable

Hello @sherin mathew​ ,

The possible workaround is to switch back to mongo 3.2.x connector by the below steps:

  1. download the mongo 3.2.x connector mongo-java-driver-2.14.3.jar from https://mvnrepository.com/artifact/org.mongodb/mongo-java-driver/2.14.3
  2. install the downloaded jar by Window-show view ->Talend ->Modules view in the studio
  3. in the job tLibraryLoad component, change back the library to mongo-java-driver-2.14.3.jar
  4. then re-try the job

 

smathew2949
Contributor III
Contributor III
Author

Thanks @Aiming Chen​ post implementing the workaround i am getting below error . since Talend would have written the code based on latest connector it may not be accepting the old jar .

 

022-11-29T02:57:49.844 [DEBUG] crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest- tLibraryLoad_1 - Start to work.

2022-11-29T02:57:49.846 [DEBUG] crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest- tLibraryLoad_1 - Parameters:LIBRARY = mvn:org.codehaus.jackson/jackson-mapper-asl/1.9.13/jar | HOTLIBS = [{LIBPATH=}] | IMPORT = | 

2022-11-29T02:57:49.846 [DEBUG] crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest- tLibraryLoad_1 - Done.

2022-11-29T02:57:49.846 [DEBUG] crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest- tLibraryLoad_2 - Start to work.

2022-11-29T02:57:49.847 [DEBUG] crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest- tLibraryLoad_2 - Parameters:LIBRARY = mvn:org.codehaus.jackson/jackson-core-asl/1.9.14-TALEND/jar | HOTLIBS = [] | IMPORT = //import java.util.List; | 

2022-11-29T02:57:49.847 [DEBUG] crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest- tLibraryLoad_2 - Done.

2022-11-29T02:57:49.847 [DEBUG] crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest- tLibraryLoad_3 - Start to work.

2022-11-29T02:57:49.848 [DEBUG] crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest- tLibraryLoad_3 - Parameters:LIBRARY = "mvn:org.talend.libraries/mongo-java-driver-3.2.2/6.0.0-SNAPSHOT/jar" | HOTLIBS = [] | IMPORT = //import java.util.List; | 

2022-11-29T02:57:49.848 [DEBUG] crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest- tLibraryLoad_3 - Done.

Job Execution started at Tue Nov 29 02:57:49 UTC 2022

Exception in thread "main" java.lang.NoSuchMethodError: com.mongodb.MongoClientOptions$Builder.applicationName(Ljava/lang/String;)Lcom/mongodb/MongoClientOptions$Builder;

at crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest.tMongoDBConnection_1Process(Copy_of_Dynamicsconnectiontest.java:2118)

at crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest.tJava_2Process(Copy_of_Dynamicsconnectiontest.java:1994)

at crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest.tLibraryLoad_3Process(Copy_of_Dynamicsconnectiontest.java:1857)

at crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest.tLibraryLoad_2Process(Copy_of_Dynamicsconnectiontest.java:1703)

at crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest.tLibraryLoad_1Process(Copy_of_Dynamicsconnectiontest.java:1549)

at crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest.tPrejob_1Process(Copy_of_Dynamicsconnectiontest.java:1373)

at crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest.runJobInTOS(Copy_of_Dynamicsconnectiontest.java:11582)

at crm_projects.copy_of_dynamicsconnectiontest_0_1.Copy_of_Dynamicsconnectiontest.main(Copy_of_Dynamicsconnectiontest.java:10776)

Anonymous
Not applicable

@sherin mathew​ , thanks for the feedback, please disable the old jar.

let's come back to the original issue, the problem is that there are invalid characters in the input_row.values string in tJavaRow_5 component, is it possible to output the json string and provide to us to check?

 

smathew2949
Contributor III
Contributor III
Author

 

Team here is the solution that worked for me after a lot of research

 

instead of jackson-mapper-asl library load jackson-databind library 2.11.4 version in your tJavaRow import change the import for datamapper to com.fasterxml.jackson.databind.ObjectMapper and if you are using the tmongodbinput then check the box to ConvertBson document to string.

 

Below is the screenshot

 

 

 

0695b00000aD03eAAC.png0695b00000aD035AAC.png0695b00000aD03AAAS.png0695b00000aD03UAAS.png 

 

Anonymous
Not applicable

 

Thanks for your feedback and share the solution here.

 

Best regards

Aiming​