将Microsoft SQL设置为WSO2 EI的默认数据库时出现问题

时间:2018-10-18 09:59:34

标签: sql-server wso2 wso2ei

我已按照本教程中的步骤将MS SQL Server设置为WSO2 EI 6.3的默认数据库提供程序。

Tutorial

以下是我收到的错误日志(wso2error文件):

  

TID:[-1234] [] [2018-10-18 12:50:47,152]错误   {org.wso2.carbon.user.core.util.DatabaseUtil}-数据库错误-空   {org.wso2.carbon.user.core.util.DatabaseUtil} java.sql.SQLException     在   org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254)     在   org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)     在   org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:730)     在   org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:664)     在   org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:482)     在   org.apache.tomcat.jdbc.pool.ConnectionPool。(ConnectionPool.java:156)     在   org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)     在   org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)     在   org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)     在   org.wso2.carbon.user.core.claim.dao.ClaimDAO.getDialectCount(ClaimDAO.java:158)     在   org.wso2.carbon.user.core.common.DefaultRealm.populateProfileAndClaimMaps(DefaultRealm.java:448)     在   org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:124)     在   org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:264)     在   org.wso2.carbon.user.core.common.DefaultRealmService。(DefaultRealmService.java:102)     在   org.wso2.carbon.user.core.common.DefaultRealmService。(DefaultRealmService.java:115)     在   org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:72)     在   org.wso2.carbon.user.core.internal.BundleCheckActivator.start(BundleCheckActivator.java:61)     在   org.eclipse.osgi.framework.internal.core.BundleContextImpl $ 1.run(BundleContextImpl.java:711)     在java.security.AccessController.doPrivileged(本机方法)在   org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)     在   org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)     在   org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)     在   org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)     在   org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)     在   org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)     在   org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)     在   org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)     在   org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)     在   org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)     在   org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)     在   org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)     在   org.eclipse.osgi.framework.eventmgr.EventManager $ EventThread.run(EventManager.java:340)   由以下原因引起:java.lang.NullPointerException   java.lang.Class.forName0(本机方法),位于   java.lang.Class.forName(Class.java:348)在   org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:246)     ...还有31个TID:[-1234] [] [2018-10-18 12:50:47,167]错误   {org.wso2.carbon.user.core.internal.Activator}-无法启动用户   Manager Core捆绑包{org.wso2.carbon.user.core.internal.Activator}   org.wso2.carbon.user.core.UserStoreException:无法初始化   领域。在   org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:274)     在   org.wso2.carbon.user.core.common.DefaultRealmService。(DefaultRealmService.java:102)     在   org.wso2.carbon.user.core.common.DefaultRealmService。(DefaultRealmService.java:115)     在   org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:72)     在   org.wso2.carbon.user.core.internal.BundleCheckActivator.start(BundleCheckActivator.java:61)     在   org.eclipse.osgi.framework.internal.core.BundleContextImpl $ 1.run(BundleContextImpl.java:711)     在java.security.AccessController.doPrivileged(本机方法)在   org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)     在   org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)     在   org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)     在   org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)     在   org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)     在   org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)     在   org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)     在   org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)     在   org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)     在   org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)     在   org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)     在   org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)     在   org.eclipse.osgi.framework.eventmgr.EventManager $ EventThread.run(EventManager.java:340)   引起原因:org.wso2.carbon.user.core.UserStoreException:数据库   错误-在处为null   org.wso2.carbon.user.core.claim.dao.ClaimDAO.getDialectCount(ClaimDAO.java:168)     在   org.wso2.carbon.user.core.common.DefaultRealm.populateProfileAndClaimMaps(DefaultRealm.java:448)     在   org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:124)     在   org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:264)     ... 19更多原因于:java.sql.SQLException   org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254)     在   org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)     在   org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:730)     在   org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:664)     在   org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:482)     在   org.apache.tomcat.jdbc.pool.ConnectionPool。(ConnectionPool.java:156)     在   org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)     在   org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)     在   org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)     在   org.wso2.carbon.user.core.claim.dao.ClaimDAO.getDialectCount(ClaimDAO.java:158)     ... 22更多原因于:java.lang.NullPointerException   java.lang.Class.forName0(本机方法),位于   java.lang.Class.forName(Class.java:348)在   org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:246)     ...还有31个

另外,这是master-datasources.xml文件

<datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration">

<providers>
    <provider>org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader</provider>
</providers>

<datasources>


<datasource>
        <name>WSO2_CARBON_DB</name>
        <description>The datasource used for registry and user manager</description>
        <jndiConfig>
            <name>jdbc/wso2carbon</name>
        </jndiConfig>
        <definition type="RDBMS">
            <configuration>
                <url>jdbc:sqlserver://ip:1433; databaseName=wso2carbon;SendStringParametersAsUnicode=false</url>
                <username>root</username>
                <password>P@ssw0rd@123</password>
                <driverClassName>com.microsoft.sqlserver.jdbc.SQLServerDriver</driverClassName>
                <maxActive>80</maxActive>
                <maxWait>60000</maxWait>
                <testOnBorrow>true</testOnBorrow>
                <validationQuery>SELECT 1</validationQuery>
                <validationInterval>30000</validationInterval>
                <defaultAutoCommit>false</defaultAutoCommit>
            </configuration>
        </definition>
    </datasource>


  <!-- Commented by Majd -->
    <!-- <datasource> -->
        <!-- <name>WSO2_CARBON_DB</name> -->
        <!-- <description>The datasource used for registry and user manager</description> -->
        <!-- <jndiConfig> -->
            <!-- <name>jdbc/WSO2CarbonDB</name> -->
        <!-- </jndiConfig> -->
        <!-- <definition type="RDBMS"> -->
            <!-- <configuration> -->
                <!-- <url>jdbc:h2:./repository/database/WSO2CARBON_DB;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> -->
                <!-- <testOnBorrow>true</testOnBorrow> -->
                <!-- <validationQuery>SELECT 1</validationQuery> -->
                <!-- <validationInterval>30000</validationInterval> -->
                <!-- <defaultAutoCommit>false</defaultAutoCommit> -->
            <!-- </configuration> -->
        <!-- </definition> -->
    <!-- </datasource> -->

    <!-- For an explanation of the properties, see: http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html -->
    <!--datasource>
        <name>SAMPLE_DATA_SOURCE</name>
        <jndiConfig>
            <name></name>
            <environment>
                <property name="java.naming.factory.initial"></property>
                <property name="java.naming.provider.url"></property>
            </environment>
        </jndiConfig>
        <definition type="RDBMS">
            <configuration>

                <defaultAutoCommit></defaultAutoCommit>
                <defaultReadOnly></defaultReadOnly>
                <defaultTransactionIsolation>NONE|READ_COMMITTED|READ_UNCOMMITTED|REPEATABLE_READ|SERIALIZABLE</defaultTransactionIsolation>
                <defaultCatalog></defaultCatalog>
                <username></username>
                <password svns:secretAlias="WSO2.DB.Password"></password>
                <maxActive></maxActive>
                <maxIdle></maxIdle>
                <initialSize></initialSize>
                <maxWait></maxWait>

                <dataSourceClassName>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</dataSourceClassName>
                <dataSourceProps>
                    <property name="url">jdbc:mysql://localhost:3306/Test1</property>
                    <property name="user">root</property>
                    <property name="password">123</property>
                </dataSourceProps>

            </configuration>
        </definition>
    </datasource-->

</datasources>

请告知,谢谢。

1 个答案:

答案 0 :(得分:0)

修复

我使用默认的SQL Server实例名称而不是[IP] \实例名称连接到远程服务器

即仅限[IP]。