1. RenderJSON activity converting empty string(”) to null

I have faced this issue on my recent project. while trying to convert an empty blank value(”) for EndDate field in XML data to JSON with the activity Render JSON, I got “EndDate” : [null] as a result instead of “EndDate“:[].

Below is the response I got from TIBCO when I reported this issue.

if you are using REST plugin version 2.0.0, then you need to install REST JSON plugin HF-06 or higher version, after applying the Hotfix, you need to set the below property in your application TRA and restart the application. Please not that you need to add the property to your designer.tra if you want to run the project locally.

java.property.com.tibco.plugin.restjson.xml2json.empty2null=false

If you are using higher version of REST JSON plugin (2.0.1 or 2.1.0), Please add the above property in the application TRA and restart it.

Like other property you can add this to bwengine.tra to make it default to the future deployments.

2. NoSuchMethodError error after upgrading to REST JSON Plugin 2.1.0

javax.ws.rs.core.MultivaluedMap.addAll(Ljava/lang/Object;[Ljava/lang/Object;)Vjava.lang.NoSuchMethodError error after upgrading from REST JSON plugin 2.0.0 to REST JSON Plugin v2.1.0. This issue is due to incorrect installation of REST JSON plugin 2.1.0. If we install v2.1.0 on top of v2.0.0. the libraries for v2.0.0 will present along with new added v2.1.0 libraries and will create issues.

To resolve this issue, need to follow the below steps:

Unistall v2.1.0 and then unistall v2.0.0
Re-install v2.1.0 again
Re-create the EAR in the new environment which install the v2.1.0 only.
3. Invalid JSON error when passing JSON data to Parse JSON activity.

When passing JSON data to Parse JSON activity, if the element length limit in the type exceeds 512, The parse JSON activity will fail to parse the JSON to XML with following error:

An error occurred while converting json to xml:  Invalid JSON .
    at com.tibco.plugin.json.activities.JSONParserActivity.eval(JSONParserActivity.java:244)
    at com.tibco.pe.plugin.Activity.eval(Unknown Source)
    at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
    at com.tibco.pe.core.Job.a(Unknown Source)
    at com.tibco.pe.core.Job.k(Unknown Source)
    at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
    at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
caused by: cn.techlab.datar.exception.ParserException: Invalid JSON

Sample Data:

{
"name":"John", 
"age":30,
"cars":[ "Ford", "BMW", "Fiat", "Benz", "Ferrari", "Tesla", "Jeep", "Bentley", "Aston Martin", "Audi", "Bugatti", "Corvette", "Maserati", "Lamborghini", "Land Rover", "Ford", "BMW", "Fiat", "Benz", "Ferrari", "Tesla", "Jeep", "Bentley", "Aston Martin", "Audi", "Bugatti", "Corvette", "Maserati", "Lamborghini", "Land Rover", "Ford", "BMW", "Fiat", "Benz", "Ferrari", "Tesla", "Jeep", "Bentley", "Aston Martin", "Audi", "Bugatti", "Corvette", "Maserati", "Lamborghini", "Land Rover", "Ford", "BMW", "Fiat", "Benz", "Ferrari", "Tesla", "Jeep", "Bentley", "Aston Martin", "Audi", "Bugatti", "Corvette", "Maserati", "Lamborghini", "Land Rover" ]
}

In the above example, cars element has an array of values which exceeds 512 length limit. Hence, you will get the An error occurred while converting JSON to XML:  Invalid JSON error.

In REST Plugin 2.0.0, ParseJSON Activity has element length limit in the type. Starting from the second element of the array, to the end of the array, the total length can not exceed 512.

To resolve this issue, follow the below steps:

Add below property in Application.tra and restart the integration.

java.property.com.tibco.plugin.restjson.json.111CompatibleMode=true

This will allow element with exceeding the limit of length allow to parse without any error.

Alternatively, this issue has been resolved in REST and JSON plugin 2.0.0 HF 8. After installing the HF-8, there is no need to add above property. This HotFix removes the 512 element limit of length for parsing.

4. Invoke REST API error “Activity invocation failed caused by: com.sun.jersey.api.client.ClientHandlerException: java.net.SocketException: Connection reset Caused by: java.net.SocketException: Connection reset”

We got this while giving a call to REST service on Tibco ActiveMatrix BusinessWorks 5.12 and REST and JSON plug-in 2.0.0.

Activity invocation failed
caused by: com.sun.jersey.api.client.ClientHandlerException:
java.net.SocketException: Connection reset
Caused by: java.net.SocketException: Connection reset"

To Resolve this add following two properties inside designer.tra for design time connection and inside application.tra for runtime connection.

java.property.https.protocols=TLSv1.2
java.property.com.tibco.security.EntrustLast=true
java.property.TIBCO_SECURITY_VENDOR=j2se

Hope this information will help some one. Please comment if you have any other issues for this plug-in. I ll get back to you as soon as possible.

One thought on “Issues with TIBCO ActiveMatrix BusinessWorks REST and JSON plug-in”

Leave a Reply

Your email address will not be published. Required fields are marked *