wso2wso2-micro-integrator

Deploying CApp to Service Catalog fails on malformed JSON error


I tried using both VS Code MI extension and Integration Studio for creating and deploying a service to the service catalog on the remote MI server. In both cases I faced the same error:

INFO {ServiceCatalogDeployer} - Executing Service Catalog deployer for CApp : hello_1.0.0.car
Exception in thread "pool-16-thread-2" com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 22 path $
    at com.google.gson.JsonParser.parseReader(JsonParser.java:76)
    at com.google.gson.JsonParser.parseString(JsonParser.java:51)
    at com.google.gson.JsonParser.parse(JsonParser.java:115)
    at org.wso2.micro.integrator.initializer.utils.ServiceCatalogUtils.getAllServices(ServiceCatalogUtils.java:314)
    at org.wso2.micro.integrator.initializer.serviceCatalog.ServiceCatalogDeployer.run(ServiceCatalogDeployer.java:61)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1623)
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 22 path $
    at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1659)
    at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1465)
    at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:551)
    at com.google.gson.stream.JsonReader.peek(JsonReader.java:433)
    at com.google.gson.JsonParser.parseReader(JsonParser.java:71)

My only guess is that the remote MI server of my corporation is version 4.0.0 but the VS Code MI extension and Integration Studio are version 4.3.0 (and I use local MI server 4.3.0 for the IDEs), but I don't actually know if this is the reason for the issue.


Solution

  • After using local MI 4.0.0 - the same version as the remote MI Server of my organization, the issue is resolved. It seems that using the later IDE versions are fine (at least in this case) as long as you add a local MI Server with the same version as the MI server version of the Service Catalog.