Adding a new property to the following arrayKeys definition would solve this problem:
<bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.json.JSONProvider"> ... <property name="arrayKeys"> <list> <value>partitions</value> <value>property</value> <value>hostNames</value> <value>memberMap</value> <value>portMap</value> <value>partitionGroup</value> <value>partition</value> <value>member</value> <value>hostNames</value> <value>portMappings</value> <value>volumes</value> <value>domains</value> <value>kubernetesHost</value> <value>cartridges</value> <value>subGroups</value> <value>groups</value> <value>clusters</value> <value>startupOrders</value> <value>childPolicies</value> <value>childLevelNetworkPartition</value> <value>childLevelPartitions</value> <value>networkPartition</value> <value>partitions</value> <value>dependencyAliases</value> <value>groupInstances</value> <value>clusterInstances</value> <value>applicationInstances</value> <value>accessUrls</value> <value>kubernetesServices</value> <value>publicIPs</value> <value>ports</value> </list> </property> </bean> On Mon, Mar 9, 2015 at 12:28 PM, Vishanth Balasubramaniam < vishan...@wso2.com> wrote: > Hi Dinithi, > > The output of the metadataKeys is a string array or an object array? > > Please refer [1] and check if that is the issue > [1] - > http://stackoverflow.com/questions/21374603/com-google-gson-jsonsyntaxexception-java-lang-illegalstateexception-in-android > > Thank you, > Vishanth. > > On Mon, Mar 9, 2015 at 12:09 PM, Imesh Gunaratne <im...@apache.org> wrote: > >> May be "metadataKeys" property is not marked as an array in CXF >> configuration in REST API web application. When there is only one element >> available, CXF does not return an array unless this configuration is there. >> >> On Mon, Mar 9, 2015 at 12:04 PM, Dinithi De Silva <dinit...@wso2.com> >> wrote: >> >>> Hi all, >>> >>> While listing the available cartridges using CLI command >>> "list-cartridges" I got the following exception. >>> >>> com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: >>> Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 112 >>> >>> The response string was as follows. >>> >>> [{"category":"data","description":"php >>> Cartridge","displayName":"php","host":"php.stratos.org >>> ","metadataKeys":{"@xsi.nil":"true"},"multiTenant":false,"provider":"apache","public":false,"type":"php","version":7}] >>> >>> The expected output for metadataKeys is an array. >>> >>> What could be the reason for this? >>> >>> >>> -- >>> *Dinithi De Silva* >>> Associate Software Engineer, WSO2 Inc. >>> m:+94716667655 | e:dinit...@wso2.com | w: www.wso2.com >>> | a: #20, Palm Grove, Colombo 03 >>> >> >> >> >> -- >> Imesh Gunaratne >> >> Technical Lead, WSO2 >> Committer & PMC Member, Apache Stratos >> > > > > -- > *Vishanth Balasubramaniam* > Software Engineer > WSO2 Inc.; http://wso2.com > lean.enterprise.middleware > > mobile: *+94771737718* > about me: *http://about.me/vishanth <http://about.me/vishanth>* > > -- Imesh Gunaratne Technical Lead, WSO2 Committer & PMC Member, Apache Stratos