在WSO2 API Manager 1.10.0的分布式部署中生成OAuth密钥

时间:2016-06-02 18:30:58

标签: api distributed wso2-am

我们的设置:

  • WSO2 API Manager: 1.10.0
  • MySQL: 5.7.12
  • WSO2 API DAS: 3.0.1
  • 操作系统: Ubuntu 14.04 LTS

我们正在使用api管理器的分布式设置,没有负载均衡器(暂时),基于此GitHub站点的配置和文件:

https://github.com/nuwanbando/wso2-apim-distributed-deployment

但是每当我们尝试从订阅的API生成应用程序密钥时,我们都会收到以下错误:

API Store Error

从我们获得的Gateway的日志中(我已经组织了日志以显示最重要的方面):

ERROR - AMDefaultKeyManagerImpl Can not create OAuth application  : coreApp_PRODUCTION
org.wso2.carbon.apimgt.keymgt.stub.subscriber.APIKeyMgtSubscriberServiceAPIManagementException: APIKeyMgtSubscriberServiceAPIManagementException


ERROR - APIUtil Error occurred while executing SubscriberKeyMgtClient.
org.wso2.carbon.apimgt.api.APIManagementException: Can not create OAuth application  : coreApp_PRODUCTION

        Caused by: org.wso2.carbon.apimgt.keymgt.stub.subscriber.APIKeyMgtSubscriberServiceAPIManagementException: APIKeyMgtSubscriberServiceAPIManagementException


ERROR - ApplicationRegistrationSimpleWorkflowExecutor Error occured when updating the status of the Application creation process
org.wso2.carbon.apimgt.api.APIManagementException: Error occurred while executing SubscriberKeyMgtClient.

        Caused by: org.wso2.carbon.apimgt.api.APIManagementException: Can not create OAuth application  : coreApp_PRODUCTION

        Caused by: org.wso2.carbon.apimgt.keymgt.stub.subscriber.APIKeyMgtSubscriberServiceAPIManagementException: APIKeyMgtSubscriberServiceAPIManagementException


ERROR - APIConsumerImpl Could not execute Workflow      
org.wso2.carbon.apimgt.impl.workflow.WorkflowException: Error occured when updating the status of the Application creation process

        Caused by: org.wso2.carbon.apimgt.api.APIManagementException: Error occurred while executing SubscriberKeyMgtClient.

        Caused by: org.wso2.carbon.apimgt.api.APIManagementException: Can not create OAuth application  : coreApp_PRODUCTION

        Caused by: org.wso2.carbon.apimgt.keymgt.stub.subscriber.APIKeyMgtSubscriberServiceAPIManagementException: APIKeyMgtSubscriberServiceAPIManagementException


ERROR - APIStoreHostObject Error while obtaining the application access token for the application:coreApp
org.wso2.carbon.apimgt.api.APIManagementException: Could not execute Workflow       

        Caused by: org.wso2.carbon.apimgt.impl.workflow.WorkflowException: Error occured when updating the status of the Application creation process

        Caused by: org.wso2.carbon.apimgt.api.APIManagementException: Error occurred while executing SubscriberKeyMgtClient.

        Caused by: org.wso2.carbon.apimgt.api.APIManagementException: Can not create OAuth application  : coreApp_PRODUCTION

        Caused by: org.wso2.carbon.apimgt.keymgt.stub.subscriber.APIKeyMgtSubscriberServiceAPIManagementException: APIKeyMgtSubscriberServiceAPIManagementException


ERROR - subscription-add:jag org.jaggeryjs.scriptengine.exceptions.ScriptException: Error while obtaining the application access token for the application:coreApp  

密钥管理器的日志(我也组织了它们):

ERROR - CarbonContextDataHolder Cannot retrieve UserRealm for tenant -1 
org.wso2.carbon.user.core.UserStoreException: Error occurred while getting tenant user realm for tenant id : -1

        Caused by: java.lang.IllegalStateException: Tenant ID cannot be -1

ERROR - APIUtil Error occurred while creating OAuthApp admin_coreApp_PRODUCTION
java.lang.NullPointerException
    at org.wso2.carbon.identity.application.mgt.ApplicationMgtUtil.createAppRole(ApplicationMgtUtil.java:142)
    at org.wso2.carbon.identity.application.mgt.ApplicationManagementServiceImpl.createApplication(ApplicationManagementServiceImpl.java:129)
    at org.wso2.carbon.apimgt.keymgt.service.APIKeyMgtSubscriberService.createOAuthApplicationByApplicationInfo(APIKeyMgtSubscriberService.java:137)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...

我们该怎么做才能解决这个问题?

1 个答案:

答案 0 :(得分:2)

我们需要在以下位置配置Keymanager主机和端口

/库/部署/服务器/突触CONFIGS /默认/ API

AuthorizeAPI .XML

RevokeAPI .XML

TokenAPI .XML