0
votes

I exported an API package(in .zip format) from wso2 am 1.9.0, later I used this package to import the API to a wso2 1.10.0 installation. It failed with the following error messages, notably "java.lang.NoSuchMethodError: org.wso2.carbon.context.CarbonContext.getCurrentContext()Lorg/wso2/carbon/context/CarbonContext;":

==> .../repository/logs/wso2-apigw-errors.log <==

2016-07-12 04:51:59,823 [-] [http-nio-9443-exec-44] ERROR AbstractFaultChainInitiatorObserver Error occurred during error handling, give up!

org.apache.cxf.interceptor.Fault: org.wso2.carbon.context.CarbonContext.getCurrentContext()Lorg/wso2/carbon/context/CarbonContext;

at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:170) ...

at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) ...

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.NoSuchMethodError: org.wso2.carbon.context.CarbonContext.getCurrentContext()Lorg/wso2/carbon/context/CarbonContext;

at apim.restful.importexport.utils.AuthenticatorUtil.authorizeUser(AuthenticatorUtil.java:88)

at apim.restful.importexport.APIService.importAPI(APIService.java:171)

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.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:188)

at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:104)

... 43 more

I am using api-import-export-v0.9.1 to import/export APIs from wso2 am 1.9.0 to 1.10.0.

What is wrong here? Why "NoSuchMethodError: org.wso2.carbon.context.CarbonContext.getCurrentContext()"? Did I use the right import/export tool/version? Any WIKI/documentations about it other than the one in WSO2 web site? Thanks for any tips in advance.

Did anyone get API import working? I also exported APIs from wso2 am 1.10.0 and import to the same 1.10.0 am server, it failed with the same "java.lang.NoSuchMethodError: org.wso2.carbon.context.CarbonContext.getCurrentContext()Lorg/wso2/carbon/context/CarbonContext".

1

1 Answers

0
votes

We use this tool with WSO2 API Cloud successfully. You can refer the doc in Cloud documentation. https://docs.wso2.com/display/APICloud/Migrate+your+APIs+between+Environments

AFAIK, this tool cannot be used to import export APIs between two different versions of WSO2 API Manager. I didn't see this mentioned in the doc though. i.e. If you export from 1.9.1, you cannot import it to 1.10.0. I think the reasons are the api changes etc.

I looked for some evidence showing the version incompatibility thing. But, I couldn't find any.