David Borja 4 Years Ago - Edited Hi Roselaine, I am trying to follow step by step this blog, however i am getting some issues when i run the job in talend. Something related with unexpected character: (the job is called ProductExporterJob Doing a debug in talend, i can catch the message that is going to send to liferay output: ------------------------------------ {"active": true, "attachments": null, "catalogId": 36306, "categories": null, "configuration_allowBackOrder": null, "configuration_allowedOrderQuantities": null, "configuration_displayAvailability": null, "configuration_displayStockQuantity": null, "configuration_inventoryEngine": null, "configuration_lowStockAction": null, "configuration_maxOrderQuantity": null, "configuration_minOrderQuantity": null, "configuration_minStockQuantity": null, "configuration_multipleOrderQuantity": null, "createDate": null, "defaultSku": null, "description": "{\"pt_BR\":\"Minian e um anticoncepcional, ou seja, e usado para impedir que voce fique gravida. Quando usado corretamente, (sem esquecimento), a possibilidade de engravidar e muito baixa. MINIAN E UM MEDICAMENTO. SEU USO PODE TRAZER RISCOS. PROCURE UM MEDICO OU UM FARMACEUTICO. LEIA A BULA. \"}", "displayDate": null, "expando": null, "expirationDate": null, "externalReferenceCode": null, "id": null, "images": "[{\"attachment\":\"ATTACHMENT\",\"title\":{\"pt_BR\":\"Minian\"},\"externalReferenceCode\":\"10880138915\",\"neverExpire\":true}]", "metaDescription": null, "metaKeyword": null, "metaTitle": null, "modifiedDate": null, "name": "Minian", "neverExpire": null, "options": null, "productId": null, "productSpecifications": null, "productType": "simple", "relatedProducts": null, "shippingConfiguration_depth": null, "shippingConfiguration_freeShipping": null, "shippingConfiguration_height": null, "shippingConfiguration_shippable": null, "shippingConfiguration_shippingExtraPrice": null, "shippingConfiguration_shippingSeparately": null, "shippingConfiguration_weight": null, "shippingConfiguration_width": null, "shortDescription": "{\"pt_BR\":\"Minian\"}", "skus": "[{\"promoPrice\":25.59,\"manufacturerPartNumber\":\"88102\",\"gtin\":\"10880138915\",\"purchasable\":true,\"price\":32.16,\"sku\":\"10880138915\",\"externalReferenceCode\":\"1003300980019\"}]", "subscriptionConfiguration_enable": null, "subscriptionConfiguration_length": null, "subscriptionConfiguration_numberOfLength": null, "subscriptionConfiguration_subscriptionType": null, "subscriptionConfiguration_subscriptionTypeSettings": null, "tags": null, "taxConfiguration_id": null, "taxConfiguration_taxCategory": null, "taxConfiguration_taxable": null, "urls": null} ------------------------------------ And here is the exception thrown: Exception in component tLiferayOutput_1 (ProductExporterJob) java.io.IOException: javax.json.stream.JsonParsingException: Unexpected char 77 at (line no=1, column no=1, offset=0) at com.liferay.talend.avro.RejectHandler.reject(RejectHandler.java:60) at com.liferay.talend.runtime.writer.LiferayWriter.write(LiferayWriter.java:188) at commerce_products_poc.productexporterjob_0_1.ProductExporterJob.tDBInput_1Process(ProductExporterJob.java:3511) at commerce_products_poc.productexporterjob_0_1.ProductExporterJob.runJobInTOS(ProductExporterJob.java:4709) at commerce_products_poc.productexporterjob_0_1.ProductExporterJob.main(ProductExporterJob.java:4531) Caused by: javax.json.stream.JsonParsingException: Unexpected char 77 at (line no=1, column no=1, offset=0) at org.glassfish.json.JsonTokenizer.unexpectedChar(JsonTokenizer.java:601) at org.glassfish.json.JsonTokenizer.nextToken(JsonTokenizer.java:418) at org.glassfish.json.JsonParserImpl$NoneContext.getNextEvent(JsonParserImpl.java:426) at org.glassfish.json.JsonParserImpl.next(JsonParserImpl.java:376) at org.glassfish.json.JsonReaderImpl.readValue(JsonReaderImpl.java:145) at com.liferay.talend.avro.IndexedRecordJsonObjectConverter.toJsonObject(IndexedRecordJsonObjectConverter.java:165) at com.liferay.talend.runtime.writer.LiferayWriter.doInsert(LiferayWriter.java:107) at com.liferay.talend.runtime.writer.LiferayWriter.write(LiferayWriter.java:173) ... 3 more Thanks in advance for your response. Please sign in to reply. Reply as... Cancel Roselaine Marques Montero David Borja 4 Years Ago - Edited Hi David, The problem is on field "name" that do you are sending like a simple string without pass for the method "setLocalizedField". To correct it, do the same process that you have on "shortDescription". Regards. Please sign in to reply. Reply as... Cancel
Roselaine Marques Montero David Borja 4 Years Ago - Edited Hi David, The problem is on field "name" that do you are sending like a simple string without pass for the method "setLocalizedField". To correct it, do the same process that you have on "shortDescription". Regards. Please sign in to reply. Reply as... Cancel
Vy Bui 4 Years Ago - Edited Hi Roselaine, Thank you for a very informative article. After a few days, I am able to follow all of your articles and got the demonstration working. However, following the 4th articles there is an error I think everybody should be aware of: I do not know if everybody has this issue but there are 2 parameters from the Liferay columns that have similar NAME: catalogId and catalog_id. the context.CATALOG_ID coming from Talend context parameters should be mapped with Liferay's catalogId. If you map context.CATALOG_ID with catalog_id you will be getting an error: java.lang.NullPointerException. Please sign in to reply. Reply as... Cancel