WSO2 APIM Analytics:获取错误:激活分析数据服务时出错:查找数据库时出错

时间:2018-11-26 13:24:43

标签: wso2 wso2-am

我已经安装了APIM Analytics 2.5.0快照并将数据库指向MS SQL。

现在,我已经创建了两个数据库ANALYTICS_EVENT_STORE和ANALYTICS_PROCESS_DATA_STORE。

启动启动脚本时。我遇到以下错误:

激活分析数据服务时出错:查找数据库类型时出错:Driver:SQLServerDriver:2为URL返回空值:sqlserver://testdb.net; databaseName = ANALYTICS_EVENT_STORE; SendStringParametersAsUnicode = false {org.wso2.carbon.analytics .dataservice.core.AnalyticsDataServiceComponent} org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException:查找数据库类型时出错:Driver:SQLServerDriver:2为URL返回了空值:sqlserver://testdb.net; databaseName = ANALYTICS_EVENT_STORE; SendStringParametersAsUnicode = false

我已将SQL jar放在lib目录以及dropin目录中。

有人可以帮我找出我在哪里做错了。

下面是我的analytics.datasources.xml文件

<providers>
    <provider>org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader</provider>
    <!--<provider>org.wso2.carbon.datasource.reader.hadoop.HBaseDataSourceReader</provider>-->
    <!--<provider>org.wso2.carbon.datasource.reader.cassandra.CassandraDataSourceReader</provider>-->
</providers>

<datasources>

    <!--<datasource>
        <name>WSO2_ANALYTICS_EVENT_STORE_DB</name>
        <description>The datasource used for analytics record store</description>
        <definition type="RDBMS">
            <configuration>
                <url>jdbc:h2:repository/database/ANALYTICS_EVENT_STORE;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000</url>
                <username>wso2carbon</username>
                <password>wso2carbon</password>
                <driverClassName>org.h2.Driver</driverClassName>
                <maxActive>50</maxActive>
                <maxWait>60000</maxWait>
                <validationQuery>SELECT 1</validationQuery>
                <defaultAutoCommit>false</defaultAutoCommit>
                <initialSize>0</initialSize>
                <testWhileIdle>true</testWhileIdle>
                <minEvictableIdleTimeMillis>4000</minEvictableIdleTimeMillis>
                <defaultTransactionIsolation>READ_COMMITTED</defaultTransactionIsolation>
            </configuration>
        </definition>
    </datasource>-->


 <datasource>
        <name>WSO2_ANALYTICS_EVENT_STORE_DB</name>
        <description>The datasource used for analytics record store</description>
        <definition type="RDBMS">
            <configuration>
                <url>sqlserver://testdb.net;databaseName=ANALYTICS_EVENT_STORE;SendStringParametersAsUnicode=false</url>
                <username>xxx</username>
                <password>xxxx</password>
                <driverClassName>com.microsoft.sqlserver.jdbc.SQLServerDriver</driverClassName>
                <maxActive>200</maxActive>
                <maxWait>60000</maxWait>
            <minIdle>5</minIdle>
                <testOnBorrow>true</testOnBorrow>
                <validationQuery>SELECT 1</validationQuery>
                <validationInterval>30000</validationInterval>
        <defaultAutoCommit>false</defaultAutoCommit>
        </configuration>
        </definition>
</datasource>


  <!--<datasource>
        <name>WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB</name>
        <description>The datasource used for analytics record store</description>
        <definition type="RDBMS">
            <configuration>
                <url>jdbc:h2:repository/database/ANALYTICS_PROCESSED_DATA_STORE;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000</url>
                <username>wso2carbon</username>
                <password>wso2carbon</password>
                <driverClassName>org.h2.Driver</driverClassName>
                <maxActive>50</maxActive>
                <maxWait>60000</maxWait>
                <validationQuery>SELECT 1</validationQuery>
                <defaultAutoCommit>false</defaultAutoCommit>
                <initialSize>0</initialSize>
                <testWhileIdle>true</testWhileIdle>
                <minEvictableIdleTimeMillis>4000</minEvictableIdleTimeMillis>
                <defaultTransactionIsolation>READ_COMMITTED</defaultTransactionIsolation>
            </configuration>
        </definition>
    </datasource>-->

<datasource>
        <name>WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB</name>
        <description>The datasource used for analytics record store</description>
        <definition type="RDBMS">
            <configuration>
       <url>sqlserver://testdb.net;databaseName=ANALYTICS_PROCESSED_DATA_STORE;SendStringParametersAsUnicode=false</url>
        <username>xxx</username>
                <password>xxxx</password>
                <driverClassName>com.microsoft.sqlserver.jdbc.SQLServerDriver</driverClassName>
                <maxActive>200</maxActive>
                <maxWait>60000</maxWait>
        <minIdle>5</minIdle>
                <testOnBorrow>true</testOnBorrow>
                <validationQuery>SELECT 1</validationQuery>
                <validationInterval>30000</validationInterval>
        <defaultAutoCommit>false</defaultAutoCommit>
    </configuration>
        </definition>
</datasource>

    </datasources>

</datasources-configuration>

谢谢

1 个答案:

答案 0 :(得分:0)

在评论 WSO2_ANALYTICS_EVENT_STORE_DB 的h2 db配置时,您错过了评论标记。您可以纠正它并检查它是否有效