Hi Shavindri,

There was a problem with the add-network-partition CLI command. I have
fixed  it now and sent the PR [1].

[1] - https://github.com/apache/stratos/pull/272

Thanks.

On Wed, Mar 11, 2015 at 9:11 PM, Udara Liyanage <ud...@wso2.com> wrote:

> Hi Shavindri,
>
> Seems there is an issue with the JSON you pass. Do you see any error in
> Backend carbon log when you try with CLI.
> Better to paste backend error message since it has more details.
> On 11 Mar 2015 18:57, "Shavindri Dissanayake" <shavin...@wso2.com> wrote:
>
>> Hi Devs,
>>
>> When trying to add a network partition via the CLI tool, the command
>> gives no out put nor is an error message displayed in the terminal [1].
>>
>> When trying to add a network partition via RESP API, the error given was
>> as follows [2].
>>
>> Is there a specific reason for the displayed error?
>>
>> [1] CLI
>> stratos> add-network-partition --resource-path
>> /Users/shavindridissanayake/Documents/stratos/Latest/Master-branch/stratos/samples/network-partitions/mock/network-partition-2.json
>> stratos>
>>
>> [2] REST API
>> Command: Shavindris-MacBook-Air:samples shavindridissanayake$ curl -X
>> POST -H "Content-Type: application/json" -d
>> "/network-partitions/mock/network-partition-2.json " -k -v -u admin:admin
>> https://localhost:9443/api/networkPartitions
>>
>> error:
>>
>> * Hostname was NOT found in DNS cache
>>
>> *   Trying ::1...
>>
>> * Connected to localhost (::1) port 9443 (#0)
>>
>> * TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
>>
>> * Server certificate: localhost
>>
>> * Server auth using Basic with user 'admin'
>>
>> > POST /api/networkPartitions HTTP/1.1
>>
>> > Authorization: Basic YWRtaW46YWRtaW4=
>>
>> > User-Agent: curl/7.37.1
>>
>> > Host: localhost:9443
>>
>> > Accept: */*
>>
>> > Content-Type: application/json
>>
>> > Content-Length: 50
>>
>> >
>>
>> * upload completely sent off: 50 out of 50 bytes
>>
>> < HTTP/1.1 400 Bad Request
>>
>> < Date: Wed, 11 Mar 2015 13:18:11 GMT
>>
>> < Content-Type: application/json
>>
>> < Transfer-Encoding: chunked
>>
>> < Connection: close
>>
>> * Server WSO2 Carbon Server is not blacklisted
>>
>> < Server: WSO2 Carbon Server
>>
>> <
>>
>> * Closing connection 0
>>
>> {"errorCode":400,"errorMessage":"javax.xml.stream.XMLStreamException:
>> ParseError at [row,col]:[0,24]\nMessage: Missing value. at character 24 of
>> {\"networkPartitionBean\":\/network-partitions\/mock\/network-partition-2.json
>> }"}Shavindris-MacBook-Air:samples shavindridissanayake$
>>
>>
>> Terminal output:
>>
>> [2015-03-11 18:50:12,302]  WARN
>> {org.apache.cxf.jaxrs.provider.AbstractJAXBProvider} -
>> javax.xml.stream.XMLStreamException: ParseError at [row,col]:[0,24]
>>
>> Message: Missing value. at character 24 of
>> {"networkPartitionBean":/network-partitions/mock/network-partition-2.json }
>>
>> at
>> org.codehaus.jettison.mapped.MappedXMLInputFactory.createXMLStreamReader(MappedXMLInputFactory.java:51)
>>
>> at
>> org.codehaus.jettison.AbstractXMLInputFactory.createXMLStreamReader(AbstractXMLInputFactory.java:116)
>>
>> at
>> org.codehaus.jettison.AbstractXMLInputFactory.createXMLStreamReader(AbstractXMLInputFactory.java:103)
>>
>> at
>> org.apache.cxf.jaxrs.provider.json.utils.JSONUtils.createStreamReader(JSONUtils.java:159)
>>
>> at
>> org.apache.cxf.jaxrs.provider.json.JSONProvider.createReader(JSONProvider.java:278)
>>
>> at
>> org.apache.cxf.jaxrs.provider.json.JSONProvider.createReader(JSONProvider.java:268)
>>
>> at
>> org.apache.cxf.jaxrs.provider.json.JSONProvider.readFrom(JSONProvider.java:226)
>>
>> at
>> org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBodyReader(JAXRSUtils.java:1288)
>>
>> at
>> org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:1239)
>>
>> at
>> org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:790)
>>
>> at
>> org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:749)
>>
>> at
>> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:236)
>>
>> at
>> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:101)
>>
>> at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
>>
>> at
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>>
>> at
>> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239)
>>
>> at
>> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
>>
>> at
>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:203)
>>
>> at
>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137)
>>
>> at
>> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:159)
>>
>> at
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286)
>>
>> at
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206)
>>
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
>>
>> at
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262)
>>
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
>>
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>
>> at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
>>
>> at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
>>
>> at
>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
>>
>> at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
>>
>> at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>>
>> at
>> org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178)
>>
>> at
>> org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47)
>>
>> at
>> org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:56)
>>
>> at
>> org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)
>>
>> at
>> org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141)
>>
>> at
>> org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)
>>
>> at
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
>>
>> at
>> org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52)
>>
>> at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>>
>> at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
>>
>> at
>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
>>
>> at
>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
>>
>> at
>> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
>>
>> at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>
>>  at java.lang.Thread.run(Thread.java:745)
>>
>>
>> Thanks & Regards
>> Shavindri Dissanayake
>> Technical Writer
>> LinkedIn Profile
>> <https://www.linkedin.com/profile/view?id=112227277&trk=nav_responsive_tab_profile>
>> Mob: 0779966739
>>
>> WSO2 Inc.
>> lean.enterprise.middleware
>>
>


-- 
*Dinithi De Silva*
Associate Software Engineer, WSO2 Inc.
m:+94716667655 | e:dinit...@wso2.com | w: www.wso2.com
| a: #20, Palm Grove, Colombo 03

Reply via email to