Hi Udara,

You need to append the version to your API context as mentioned below.

API1 context - /test/1.0.0

API2 context - /test/1.0.1

Here is a sample configuration.

    <api context="/test/1.0.1" name="API2">
        <resource methods="POST GET">
            <inSequence>
                <respond/>
            </inSequence>
        </resource>
    </api>
    <api context="/test/1.0.0" name="API1">
        <resource methods="POST GET">
            <inSequence>
                <log/>
            </inSequence>
        </resource>
    </api>



On Thu, Mar 17, 2016 at 12:47 AM, Udara Rathnayake <[email protected]> wrote:

> Hi,
>
> I tried creating a new version of an existing API, just by updating the
> context as explained here[1]. API name untouched. Seems this is not
> possible[2].
>
> Is there any other way to overcome this while preserving the previous
> version?
>
> [1]  https://docs.wso2.com/display/ESB481/Creating+APIs
> [2]
> *​TID: [0] [ESB] [2016-03-16 15:01:01,309] ERROR
> {org.wso2.carbon.rest.api.service.RestApiAdmin} -  Error trying to add the
> API to the ESB configuration : notificationAPI:: Duplicate resource
> definition by the name: *
>
>
>
>
>
>
>
>
>
>
>
> *notificationAPI{org.wso2.carbon.rest.api.service.RestApiAdmin}org.apache.synapse.SynapseException:
> Duplicate resource definition by the name: CNEADHOCESB2QAPI2        at
> org.apache.synapse.config.SynapseConfiguration.handleException(SynapseConfiguration.java:1515)
> at
> org.apache.synapse.config.SynapseConfiguration.addAPI(SynapseConfiguration.java:351)
> at
> org.wso2.carbon.rest.api.service.RestApiAdmin.addApi(RestApiAdmin.java:640)
> at
> org.wso2.carbon.rest.api.service.RestApiAdmin.addApiFromString(RestApiAdmin.java:77)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)        at
> org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:212)
> at
> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
> at
> org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver*
> .java:40)​
>
> --
> Regards,
> UdaraR
>



-- 
Thank you and Best Regards,
Chanaka Fernando
Senior Technical Lead
WSO2, Inc.; http://wso2.com
lean.enterprise.middleware

mobile: +94 773337238
Blog : http://soatutorials.blogspot.com
LinkedIn:http://www.linkedin.com/pub/chanaka-fernando/19/a20/5b0
Twitter:https://twitter.com/chanakaudaya
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to