无法使用Wso2sp连接到Postgres

时间:2019-08-20 12:53:04

标签: siddhi wso2sp

我正在尝试使用Wso2Sp连接到Postgres Db。

我尝试对SP_Home / conf / worker /中的Deployment.yaml文件进行更改。

documentation中所述,这是我添加到wso2.datasources部分的部分。

# Postgres
    -  name: WSO2_TEST_DB
       description: The datasource used for test database
       jndiConfig: 
         name: jdbc/WSO2_TEST_DB
       definition:
         type: RDBMS
         configuration:
           jdbcUrl: jdbc:postgresql://<host>:<port>/<db>
           username: <user>
           password: <password>
           driverClassName: org.postgresql.Driver
           maxPoolSize: 10
           idleTimeout: 60000
           connectionTestQuery: SELECT 1
           validationTimeout: 30000
           isAutoCommit: false

当我重新启动工作容器并检查日志时,这就是我得到的。

JAVA_HOME environment variable is set to /opt/java/openjdk
CARBON_HOME environment variable is set to /home/wso2carbon/wso2sp-4.4.0
RUNTIME_HOME environment variable is set to /home/wso2carbon/wso2sp-4.4.0/wso2/worker
osgi> [2019-08-20 12:31:20,714]  INFO {org.wso2.msf4j.internal.websocket.WebSocketServerSC} - All required capabilities are available of WebSocket service component is available.
[2019-08-20 12:31:20,757]  INFO {org.wso2.carbon.metrics.core.config.model.JmxReporterConfig} - Creating JMX reporter for Metrics with domain 'org.wso2.carbon.metrics'
[2019-08-20 12:31:20,780]  INFO {org.wso2.msf4j.analytics.metrics.MetricsComponent} - Metrics Component is activated
[2019-08-20 12:31:20,787]  INFO {org.wso2.carbon.databridge.agent.internal.DataAgentDS} - Successfully deployed Agent Server
[2019-08-20 12:31:24,617] ERROR {org.wso2.carbon.kernel.internal.startupresolver.StartupComponentManager} - Runtime Exception occurred while calling onAllRequiredCapabilitiesAvailable of component carbon-datasource-service java.lang.RuntimeException: Unable to get driver instance for jdbcUrl=jdbc:postgresql://<host>:<port>/<db>
        at com.zaxxer.hikari.util.DriverDataSource.<init>(DriverDataSource.java:88)
        at com.zaxxer.hikari.pool.PoolElf.initializeDataSource(PoolElf.java:157)
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:113)
        at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:73)
        at org.wso2.carbon.datasource.rdbms.hikari.HikariRDBMSDataSource.getDataSource(HikariRDBMSDataSource.java:56)
        at org.wso2.carbon.datasource.rdbms.hikari.HikariDataSourceReader.createDataSource(HikariDataSourceReader.java:74)
        at org.wso2.carbon.datasource.core.DataSourceBuilder.buildDataSourceObject(DataSourceBuilder.java:79)
        at org.wso2.carbon.datasource.core.DataSourceBuilder.buildDataSourceObject(DataSourceBuilder.java:60)
        at org.wso2.carbon.datasource.core.DataSourceBuilder.buildCarbonDataSource(DataSourceBuilder.java:44)
        at org.wso2.carbon.datasource.core.DataSourceManager.initDataSources(DataSourceManager.java:153)
        at org.wso2.carbon.datasource.core.internal.DataSourceListenerComponent.onAllRequiredCapabilitiesAvailable(DataSourceListenerComponent.java:125)
        at org.wso2.carbon.kernel.internal.startupresolver.StartupComponentManager.lambda$notifySatisfiableComponents$7(StartupComponentManager.java:266)
        at java.util.ArrayList.forEach(ArrayList.java:1257)
        at org.wso2.carbon.kernel.internal.startupresolver.StartupComponentManager.notifySatisfiableComponents(StartupComponentManager.java:252)
        at org.wso2.carbon.kernel.internal.startupresolver.StartupOrderResolver$1.run(StartupOrderResolver.java:204)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)
Caused by: java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getDriver(DriverManager.java:315)
        at com.zaxxer.hikari.util.DriverDataSource.<init>(DriverDataSource.java:81)
        ... 16 more

[2019-08-20 12:32:20,489]  WARN {org.wso2.carbon.kernel.internal.startupresolver.StartupOrderResolver} - Startup component carbon-deployment-service from bundle(org.wso2.carbon.deployment.engine:5.2.0) is in the pending state until Capability org.wso2.carbon.deployment.engine.Deployer from bundle(org.wso2.carbon.event.simulator.core:2.1.22) is available as an OSGi service. Refer the Startup Order Resolver documentation for information.

我在这里想念什么?

1 个答案:

答案 0 :(得分:1)

您必须将OSGi兼容的postgresql连接器添加到{SP_HOME} / lib文件夹。

有关更多详细信息,请参见https://docs.wso2.com/display/SP4xx/Adding+Third+Party+Non+OSGi+Libraries