1

I have configured all the datasources and created the required tables too. But I am not able to access to the devicemgt. While accessing the devicemgt I just keep getting below errors

[2017-05-30 15:58:29,300] [IoT-Core]  INFO - OAuthServerConfiguration The default OAuth token issuer will be used. No custom token generator is set.
[2017-05-30 15:58:29,301] [IoT-Core]  INFO - OAuthServerConfiguration The default Identity OAuth token issuer will be used. No custom token generator is set.
[2017-05-30 15:58:30,414] [IoT-Core]  INFO - DefaultKeyValidationHandler org.wso2.carbon.apimgt.keymgt.handlers.DefaultKeyValidationHandler Initialised
[2017-05-30 15:58:30,415] [IoT-Core]  INFO - APIKeyValidationService Initialised KeyValidationHandler instance successfully
[2017-05-30 15:58:30,437] [IoT-Core]  WARN - APIAuthenticationHandler API authentication failure due to Unclassified Authentication Failure
[2017-05-30 15:58:30,683] [IoT-Core]  WARN - APIAuthenticationHandler API authentication failure due to Unclassified Authentication Failure
[2017-05-30 15:58:30,799] [IoT-Core]  WARN - APIAuthenticationHandler API authentication failure due to Unclassified Authentication Failure
[2017-05-30 15:58:30,928] [IoT-Core]  WARN - APIAuthenticationHandler API authentication failure due to Unclassified Authentication Failure
[2017-05-30 15:58:31,026] [IoT-Core]  WARN - APIAuthenticationHandler API authentication failure due to Unclassified Authentication Failure
[2017-05-30 15:58:33,648] [IoT-Core]  WARN - APIAuthenticationHandler API authentication failure due to Unclassified Authentication Failure
[2017-05-30 15:58:33,836] [IoT-Core]  WARN - APIAuthenticationHandler API authentication failure due to Unclassified Authentication Failure
[2017-05-30 15:58:38,764] [IoT-Core]  WARN - APIAuthenticationHandler API authentication failure due to Unclassified Authentication Failure
[2017-05-30 15:58:38,769] [IoT-Core] ERROR - js Unable to fetch device types data
[2017-05-30 15:58:38,772] [IoT-Core] ERROR - handlebars-module An exception thrown when executing the script '/app/units/cdmf.unit.device.types.listing/listing.js'.
[2017-05-30 15:58:38,772] [IoT-Core] ERROR - dynamic-files-renderer Unable to fetch device types!
[2017-05-30 15:58:40,611] [IoT-Core]  WARN - APIAuthenticationHandler API authentication failure due to Unclassified Authentication Failure
[2017-05-30 15:58:40,702] [IoT-Core]  WARN - APIAuthenticationHandler API authentication failure due to Unclassified Authentication Failure

enter image description here enter image description here

Please any one help me on this, I have been working on this for about a week.

Community
  • 1
  • 1
Thomson Ignesious
  • 689
  • 1
  • 8
  • 25

1 Answers1

0

WSO2 IoT 3.1.0 is released and we have fixed many issues in that including some authentication issues. If you need to configure the WSO2 IoT Server with the MySQL server, please follow these steps.

Required Databases and available. (Please note CDM database includes Android, iOS and Windows schemas, as well as APP manager database, includes Store and Social DB. Therefore 5 schemes would suffice)

  1. Registry Database - /dbscripts/
  2. User Manager Database - /dbscripts/
  3. APIM Database - /dbscripts/apimgt/
  4. CDM Database - /dbscripts/cdm/
  5. Certificate Mgt Database - /dbscripts/certMgt/
  6. Android Database - /dbscripts/cdm/plugins/android
  7. iOS Database - /dbscripts/cdm/plugins/ios
  8. Windows Database - /dbscripts/cdm/windows
  9. APP Manager Database - /dbscripts/appmgt/
  10. Store Database - /dbscripts/storage/
  11. Social Database - /dbscripts/social/

Databases are configured as following. Please note : make sure that you add the relevant jdbc library to /lib directory. In this case, it would be mysql-connector-java-{version}.jar

  1. [PRODUCT_HOME]/conf/datasources/master-datasources.xml
    • Registry Database
    • User Manager Database
    • APIM Database
    • APP Manager Database
    • Store Database
    • Social Database
  2. [PRODUCT_HOME]/conf/datasources/cdm-datasources.xml
    • CDM Database (Please add the certMgt tables to CDM schema)
  3. [PRODUCT_HOME]/conf/datasources/android-datasources.xml Android Database
  4. [PRODUCT_HOME]/conf/datasources/ios-datasources.xml iOS Database
  5. [PRODUCT_HOME]/conf/datasources/windows-datasources.xml Windows Database

Database configs. Sample DB config for User manager, Registry and App manager databases in master-datasources.xml

 <datasource>
        <name>WSO2UM_DB</name>
        <description>The datasource used for User Manager database</description>
        <jndiConfig>
            <name>jdbc/WSO2UM_DB</name>
        </jndiConfig>
        <definition type="RDBMS">
            <configuration>
                <url>jdbc:mysql://{hostname}:{port}/userdb?autoReconnect=true&amp;relaxAutoCommit=true</url>
                <username>root</username>
                <password>root</password>
                <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                <maxActive>50</maxActive>
                <maxWait>60000</maxWait>
                <testOnBorrow>true</testOnBorrow>
                <validationQuery>SELECT 1</validationQuery>
                <validationInterval>30000</validationInterval>
            </configuration>
        </definition>
    </datasource>

Sample DB config for APIM in mysql (Please note zeroDateTimeBehavior=convertToNull Parameter for mysql)

    <datasource>
        <name>WSO2AM_DB</name>
        <description>The datasource used for API Manager database</description>
        <jndiConfig>
            <name>jdbc/WSO2AM_DB</name>
        </jndiConfig>
        <definition type="RDBMS">
            <configuration>
                <url>jdbc:mysql://{hostname}:{port}/apim?autoReconnect=true&amp;relaxAutoCommit=true&amp;zeroDateTimeBehavior=convertToNull</url>
                <username>root</username>
                <password>root</password>
                <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                <maxActive>50</maxActive>
                <maxWait>60000</maxWait>
                <testOnBorrow>true</testOnBorrow>
                <validationQuery>SELECT 1</validationQuery>
                <validationInterval>30000</validationInterval>
            </configuration>
        </definition>
    </datasource>

Sample DB config for CDM, Android, Windows and iOS databases.

<datasources>
    <datasource>
        <name>DM_DS</name>
        <description>The datasource used for CDM</description>
        <jndiConfig>
            <name>jdbc/DM_DS</name>
        </jndiConfig>
        <definition type="RDBMS">
            <configuration>
                <url>jdbc:mysql://{localhost}:3306/cdm?autoReconnect=true&amp;relaxAutoCommit=true</url>
                <username>root</username>
                <password>root</password>
                <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                <maxActive>50</maxActive>
                <maxWait>60000</maxWait>
                <testOnBorrow>true</testOnBorrow>
                <validationQuery>SELECT 1</validationQuery>
                <validationInterval>30000</validationInterval>
            </configuration>
        </definition>
    </datasource>
</datasources>