1
votes

Features:

  • API manager version 3.0.0
  • Analytics version 3.1.0

The scenario:

In API Manager

  1. Change the username and password of API Manager. [API_M]/reporsitory/conf/deployment.toml

    deployment.toml

    [super_admin]
    username = "administracion.demomatic.com"
    password = "123456789"
    create_admin_account = true
    
  2. Change the database of API Manager, this a steps I follow WSO2-Api Manager Database MySQL

In Analytics

  1. In [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. In [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
    

Finally STARTS to servers in this orden:

  • sh worker.sh, Analytics Worker
  • sh wso2server.sh, API Manager In this step is possible to view in terminal INFO {org.wso2.carbon.databridge.core.DataBridge} - user administracion.demomatic.com connected
  • sh dashboard.sh, Analytics Dashboard

All servers is OK, but when enter to Dashboard Page, stays loading enter image description here

Terminal sends

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)

How fixed this error, because I try with username, administracion.demomatic,administracion and nothing?

Also I tried to use of [API_M]/reporsitory/conf/deployment.toml

deployment.toml

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

But sends the same error, How used this part?

EDIT Change to version 3.0.0 of Analytics but I have to same error:

enter image description here

The errors sends terminal are:

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)

Also after some time, aprox 10 min, terminal of dashboard sends this error:

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.

EDIT 2

After to use Analytics without database, I did tests changed to user, email, etc.

when change to user and not the password, all OK.

The errros sends when I change to password, 123456789, in API Manager or Analytics.

Try with other password similar to, admin_1+!!! and OK, so I think to don't accept numbers to start of password. Thanks all

1
APIM Analytics 3.1.0 is not released yet. Did you mean 3.0.0?Bee
I change the version Analytics to 3.0.0 also I have the same error.carlos-silva

1 Answers

0
votes

API Manager 3.0.0 is not compatible with API Manager Analytics 3.1.0. To fix this issue, you need to use both API Manager 3.1.0 beta and API Manager Analytics 3.1.0 beta versions.

PS: API Manager 3.1.0 GA is not yet released.