【问题标题】:WSO2 Analytics with Username and Password带有用户名和密码的 WSO2 分析
【发布时间】:2020-03-03 22:22:56
【问题描述】:

特点:

  • API 管理器版本 3.0.0
  • 分析版本 3.1.0

场景:

在 API 管理器中

  1. 更改 API Manager 的用户名和密码。 [API_M]/reporsitory/conf/deployment.toml

    deployment.toml

    [super_admin]
    username = "administracion.demomatic.com"
    password = "123456789"
    create_admin_account = true
    
  2. 更改 API Manager 的数据库,这是我遵循的步骤WSO2-Api Manager Database MySQL

在分析中

  1. 在 [API-Analytics]/conf/worker/deployment.yaml 中

    deployment.yaml

    #Main datasource used in API Manager
    - name: AM_DB
      description: Main datasource used by API Manager
      jndiConfig:
        name: jdbc/AM_DB
      definition:
        type: RDBMS
        configuration:
          jdbcUrl: "jdbc:mysql://localhost:3306/apim_db?useSSL=false"
          username: wso2carbon
          password: wso2carbon
          driverClassName: com.mysql.jdbc.Driver
          maxPoolSize: 10
          idleTimeout: 60000
          connectionTestQuery: SELECT 1
          validationTimeout: 30000
          isAutoCommit: false
    
    # Authentication configuration
    auth.configs:
    type: 'local'        # Type of the IdP client used
    userManager:
    adminRole: admin   # Admin role which is granted all permissions
    userStore:         # User store
      users:
       -
         user:
           username: administracion.demomatic.com
           password: MTIzNDU2Nzg5
           roles: 1
      roles:
       -
         role:
           id: 1
           displayName: admin
    
  2. 在 [API-Analytics]/conf/dashboard/deployment.yaml 中

    deployment.yaml

    #Main datasource used in API Manager
    - name: AM_DB
    description: Main datasource used by API Manager
    jndiConfig:
      name: jdbc/AM_DB
    definition:
      type: RDBMS
      configuration:
        jdbcUrl: "jdbc:mysql://localhost:3306/apim_db?useSSL=false"
        username: wso2carbon
        password: wso2carbon
        driverClassName: com.mysql.jdbc.Driver
        maxPoolSize: 10
        idleTimeout: 60000
        connectionTestQuery: SELECT 1
        validationTimeout: 30000
        isAutoCommit: false
    
    # credentials for worker nodes
    username: administracion.demomamtic.com
    password: 123456789
    
    ## Authentication configuration
    auth.configs:
    type: apim
    ssoEnabled: true
    properties:
    adminScope: apim_analytics:admin_carbon.super
    allScopes: apim_analytics:admin apim_analytics:product_manager apim_analytics:api_developer apim_analytics:app_developer apim_analytics:devops_engineer apim_analytics:analytics_viewer apim_analytics:$
    adminServiceBaseUrl: https://localhost:9443
    adminUsername: administracion.demomatic.com
    adminPassword: 123456789
    kmDcrUrl: https://localhost:9443/client-registration/v0.15/register
    kmTokenUrlForRedirection: https://localhost:9443/oauth2
    kmTokenUrl: https://localhost:9443/oauth2
    kmUsername: administracion.demomatic.com
    kmPassword: 123456789
    portalAppContext: analytics-dashboard
    businessRulesAppContext : business-rules
    cacheTimeout: 900
    baseUrl: https://localhost:9643
    grantType: authorization_code
    publisherUrl: https://localhost:9443
    #storeUrl: https://localhost:9443
    

终于开始到这个顺序的服务器了:

  • sh worker.sh,分析工作者
  • sh wso2server.sh,API 经理 在此步骤中可以在终端INFO {org.wso2.carbon.databridge.core.DataBridge} - user administracion.demomatic.com connected 中查看
  • sh dashboard.sh,分析仪表板

所有服务器都OK,但是当进入仪表板页面时,一直在加载

终端发送

ERROR {org.wso2.carbon.data.provider.endpoint.DataProviderEndPoint} - Error occurred while authorizing the access to data provider. RDBMSStreamingDataProvider. class java.lang.Integer cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String are in module java.base of loader 'bootstrap') java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String are in module java.base of loader 'bootstrap')
    at org.wso2.carbon.dashboards.core.DashboardDataProviderAuthorizer.getPropertyValueFromParentMap(DashboardDataProviderAuthorizer.java:408)
    at org.wso2.carbon.dashboards.core.DashboardDataProviderAuthorizer.getTenantId(DashboardDataProviderAuthorizer.java:344)
    at org.wso2.carbon.dashboards.core.DashboardDataProviderAuthorizer.assembleQuery(DashboardDataProviderAuthorizer.java:306)
    at org.wso2.carbon.dashboards.core.DashboardDataProviderAuthorizer.authorize(DashboardDataProviderAuthorizer.java:216)
    at org.wso2.carbon.data.provider.endpoint.DataProviderEndPoint.onMessage(DataProviderEndPoint.java:152)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.wso2.msf4j.internal.MSF4JWSConnectorListener.executeMethod(MSF4JWSConnectorListener.java:360)
    at org.wso2.msf4j.internal.MSF4JWSConnectorListener.lambda$handleTextWebSocketMessage$61(MSF4JWSConnectorListener.java:196)
    at java.base/java.util.Optional.ifPresent(Optional.java:183)
    at org.wso2.msf4j.internal.MSF4JWSConnectorListener.handleTextWebSocketMessage(MSF4JWSConnectorListener.java:177)
    at org.wso2.msf4j.internal.MSF4JWSConnectorListener.onMessage(MSF4JWSConnectorListener.java:85)
    at org.wso2.transport.http.netty.contractimpl.websocket.DefaultWebSocketConnectorFuture.notifyWebSocketListener(DefaultWebSocketConnectorFuture.java:52)
    at org.wso2.transport.http.netty.contractimpl.websocket.WebSocketInboundFrameHandler.notifyTextMessage(WebSocketInboundFrameHandler.java:207)
    at org.wso2.transport.http.netty.contractimpl.websocket.WebSocketInboundFrameHandler.channelRead(WebSocketInboundFrameHandler.java:157)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
    at org.wso2.transport.http.netty.contractimpl.listener.UriAndHeaderLengthValidator.channelRead(UriAndHeaderLengthValidator.java:68)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
    at io.netty.handler.codec.http.websocketx.Utf8FrameValidator.channelRead(Utf8FrameValidator.java:77)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1380)
    at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1159)
    at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1194)
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:141)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:834)

如何解决此错误,因为我尝试使用用户名、administracion.demomatic、administracion 而什么都没有?

我也尝试使用 [API_M]/reporsitory/conf/deployment.toml

deployment.toml

[apim.analytics]
username = "$ref{super_admin.username}"
password = "$ref{super_admin.password}"

但是发送同样的错误,这部分是怎么用的?

编辑 更改为 Analytics 3.0.0 版,但我必须遇到同样的错误:

错误发送终端是:

ERROR {org.wso2.carbon.data.provider.endpoint.DataProviderEndPoint} - Error found in method : java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String are in module java.base of loader 'bootstrap')
ERROR {org.wso2.carbon.data.provider.endpoint.DataProviderEndPoint} - Error occurred while authorizing the access to data provider. RDBMSStreamingDataProvider. class java.lang.Integer cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String are in module java.base of loader 'bootstrap') java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String are in module java.base of loader 'bootstrap')
    at org.wso2.carbon.dashboards.core.DashboardDataProviderAuthorizer.getPropertyValueFromParentMap(DashboardDataProviderAuthorizer.java:408)
    at org.wso2.carbon.dashboards.core.DashboardDataProviderAuthorizer.getTenantId(DashboardDataProviderAuthorizer.java:344)
    at org.wso2.carbon.dashboards.core.DashboardDataProviderAuthorizer.assembleQuery(DashboardDataProviderAuthorizer.java:306)
    at org.wso2.carbon.dashboards.core.DashboardDataProviderAuthorizer.authorize(DashboardDataProviderAuthorizer.java:216)
    at org.wso2.carbon.data.provider.endpoint.DataProviderEndPoint.onMessage(DataProviderEndPoint.java:152)
    at jdk.internal.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.wso2.msf4j.internal.MSF4JWSConnectorListener.executeMethod(MSF4JWSConnectorListener.java:360)
    at org.wso2.msf4j.internal.MSF4JWSConnectorListener.lambda$handleTextWebSocketMessage$61(MSF4JWSConnectorListener.java:196)
    at java.base/java.util.Optional.ifPresent(Optional.java:183)
    at org.wso2.msf4j.internal.MSF4JWSConnectorListener.handleTextWebSocketMessage(MSF4JWSConnectorListener.java:177)
    at org.wso2.msf4j.internal.MSF4JWSConnectorListener.onMessage(MSF4JWSConnectorListener.java:85)
    at org.wso2.transport.http.netty.contractimpl.websocket.DefaultWebSocketConnectorFuture.notifyWebSocketListener(DefaultWebSocketConnectorFuture.java:52)
    at org.wso2.transport.http.netty.contractimpl.websocket.WebSocketInboundFrameHandler.notifyTextMessage(WebSocketInboundFrameHandler.java:207)
    at org.wso2.transport.http.netty.contractimpl.websocket.WebSocketInboundFrameHandler.channelRead(WebSocketInboundFrameHandler.java:157)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
    at org.wso2.transport.http.netty.contractimpl.listener.UriAndHeaderLengthValidator.channelRead(UriAndHeaderLengthValidator.java:68)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
    at io.netty.handler.codec.http.websocketx.Utf8FrameValidator.channelRead(Utf8FrameValidator.java:77)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1380)
    at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1159)
    at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1194)
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:141)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:834)

一段时间后,大约 10 分钟,仪表板终端发送此错误:

ERROR {org.wso2.carbon.data.provider.endpoint.DataProviderEndPoint} - Error found in method : org.wso2.carbon.analytics.permissions.exceptions.PermissionException: Failed getting roles of the user. Unable to check permissions.

编辑 2

在没有数据库的情况下使用 Analytics 后,我做了更改为用户、电子邮件等的测试。

当更改为用户而不是密码时,一切OK。

当我在 API Manager 或 Analytics 中更改密码 123456789 时发送错误。

尝试使用类似于 admin_1+!!! 的其他密码即可,所以我认为不接受数字开头的密码。 谢谢大家

【问题讨论】:

  • APIM Analytics 3.1.0 尚未发布。你是说 3.0.0 吗?
  • 我将版本 Analytics 更改为 3.0.0 也有同样的错误。

标签: wso2 wso2-am


【解决方案1】:

API Manager 3.0.0 与 API Manager Analytics 3.1.0 不兼容。要解决此问题,您需要同时使用API Manager 3.1.0 beta 和API Manager Analytics 3.1.0 beta 版本。

PS:API Manager 3.1.0 GA 尚未发布。

【讨论】:

  • 我更改为 Analytics 3.0.0 版,但我必须遇到同样的错误。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-05-18
  • 2011-02-05
  • 2019-07-30
  • 2013-08-26
  • 2019-08-21
相关资源
最近更新 更多