wso2am API manager 2.1 publisher change-lifecycle 问题
wso2am API manager 2.1 publisher change-lifecycle issue
我部署了 API Manager 2.1.0 并设置了 api-import-export-2.1.0 war 文件 described here。通过上传 zip 文件导入我的 API 端点后,status=CREATED。
要实际发布 API 我正在调用发布者的 change-lifecycle API 但我收到此异常:
TID: [-1234] [] [2017-07-06 11:11:57,289] ERROR
{org.wso2.carbon.apimgt.rest.api.util.exception.GlobalThrowableMapper}
- An Unknown exception has been captured by global exception mapper.
{org.wso2.carbon.apimgt.rest.api.util.exception.GlobalThrowableMapper}
java.lang.NoSuchMethodError:
org.wso2.carbon.apimgt.api.APIProvider.changeLifeCycleStatus(Lorg/wso2/carbon/apimgt/api/model/APIIdentifier;Ljava/lang/String;)Z
有什么想法吗?
我可以获得一个访问令牌(范围apim:api_view)并调用它
:9443/api/am/publisher/v0.10/apis
能列出api的就好了。
我得到一个不同的 acces_token(范围:apim:api_publish)然后调用
:9443/api/am/publisher/v0.10/apis/change-lifecycle
却得到上面的Exception。这是示例:
[root@localhost] ./publish.sh
View APIs (token dc0c1497-6c27-3a10-87d7-b2abc7190da5 scope: apim:api_view)
curl -k -s -H "Authorization: Bearer dc0c1497-6c27-3a10-87d7-b2abc7190da5" https://gw-node:9443/api/am/publisher/v0.10/apis
{
"count": 1,
"next": "",
"previous": "",
"list": [
{
"id": "d214f784-ee16-4067-9588-0898a948bb17",
"name": "Health",
"description": "health check",
"context": "/api",
"version": "v1",
"provider": "admin",
"status": "CREATED"
}
] }
Publish API (token b9a31369-8ea3-3bf2-ba3c-7f2a4883de7d scope: apim:api_publish)
curl -k -H "Authorization: Bearer b9a31369-8ea3-3bf2-ba3c-7f2a4883de7d" -X POST https://gw-node:9443/api/am/publisher/v0.10/apis/change-lifecycle?apiId=d214f784-ee16-4067-9588-0898a948bb17&action=Publish
{
"code":500,
"message":"Internal server error",
"description":"The server encountered an internal error. Please contact administrator.",
"moreInfo":"",
"error":[]
}
问题已解决。在 apim 2.1 中,发布者和商店 API 版本发生了变化。
我在 apim 2.0 中使用:
:9443/api/am/publisher/v0.10/apis
:9443/api/am/store/v0.10/apis
但在 apim 2.1 中它们是:
:9443/api/am/publisher/v0.11/apis
:9443/api/am/store/v0.11/apis
我部署了 API Manager 2.1.0 并设置了 api-import-export-2.1.0 war 文件 described here。通过上传 zip 文件导入我的 API 端点后,status=CREATED。
要实际发布 API 我正在调用发布者的 change-lifecycle API 但我收到此异常:
TID: [-1234] [] [2017-07-06 11:11:57,289] ERROR {org.wso2.carbon.apimgt.rest.api.util.exception.GlobalThrowableMapper} - An Unknown exception has been captured by global exception mapper. {org.wso2.carbon.apimgt.rest.api.util.exception.GlobalThrowableMapper} java.lang.NoSuchMethodError: org.wso2.carbon.apimgt.api.APIProvider.changeLifeCycleStatus(Lorg/wso2/carbon/apimgt/api/model/APIIdentifier;Ljava/lang/String;)Z
有什么想法吗?
我可以获得一个访问令牌(范围apim:api_view)并调用它
:9443/api/am/publisher/v0.10/apis
能列出api的就好了。
我得到一个不同的 acces_token(范围:apim:api_publish)然后调用
:9443/api/am/publisher/v0.10/apis/change-lifecycle
却得到上面的Exception。这是示例:
[root@localhost] ./publish.sh
View APIs (token dc0c1497-6c27-3a10-87d7-b2abc7190da5 scope: apim:api_view)
curl -k -s -H "Authorization: Bearer dc0c1497-6c27-3a10-87d7-b2abc7190da5" https://gw-node:9443/api/am/publisher/v0.10/apis
{
"count": 1,
"next": "",
"previous": "",
"list": [
{
"id": "d214f784-ee16-4067-9588-0898a948bb17",
"name": "Health",
"description": "health check",
"context": "/api",
"version": "v1",
"provider": "admin",
"status": "CREATED"
}
] }
Publish API (token b9a31369-8ea3-3bf2-ba3c-7f2a4883de7d scope: apim:api_publish)
curl -k -H "Authorization: Bearer b9a31369-8ea3-3bf2-ba3c-7f2a4883de7d" -X POST https://gw-node:9443/api/am/publisher/v0.10/apis/change-lifecycle?apiId=d214f784-ee16-4067-9588-0898a948bb17&action=Publish
{
"code":500,
"message":"Internal server error",
"description":"The server encountered an internal error. Please contact administrator.",
"moreInfo":"",
"error":[]
}
问题已解决。在 apim 2.1 中,发布者和商店 API 版本发生了变化。
我在 apim 2.0 中使用:
:9443/api/am/publisher/v0.10/apis :9443/api/am/store/v0.10/apis 但在 apim 2.1 中它们是: :9443/api/am/publisher/v0.11/apis :9443/api/am/store/v0.11/apis