2017-07-06 56 views
0

我部署API管理器2.1.0和設置API-進出口-2.1.0 war文件described here。通過上傳zip文件導入我的API端點後,status = CREATED。wso2am API管理器2.1出版商變化,生命週期的問題

要實際發佈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

,但得到上述異常。舉例如下:

[[email protected]] ./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":[] 
} 
+0

我也嘗試從發佈者UI頁面發佈API並獲得此錯誤: TID:[-1234] [] [2017年7月6日16:13:22741] ERROR {JAGGERY.site.blocks.item-design.ajax.add:JAG} - org.mozilla.javascript.WrappedException :包裝jav a.lang.ClassCastException:或g.mozilla.javascript.UniqueTag不能轉換爲java.lang.String(/publisher/modules/api/add.jag#134) – user2725960

回答

0

問題已解決。在apim 2.1中,發佈商&商店API版本已更改。

在APIM 2.0我使用:

:9443/API/AM /發行人/ v0.10/API的 :9443/API/AM /存儲/ v0.10/API的 但在APIM 2.1它們是: :9443/api/am/publisher/v0.11/apis :9443/api/am/store/v0.11/apis