错误数据源Postgres与WSO2 DAS

时间:2016-05-03 21:40:55

标签: postgresql wso2

我正在尝试将WSO2 DAS数据源从H2更改为postgres。

我已在master-datasource.xml,user-mgt.xml和registry.xml中配置了所有数据库更改

创建事件表

时会抛出以下异常
conditional fields

我尝试使用此代码:

Caused by: java.lang.NullPointerException
        at org.wso2.siddhi.extension.eventtable.rdbms.DBHandler.initializeDatabaseExecutionInfo(DBHandler.java:392)
        at org.wso2.siddhi.extension.eventtable.rdbms.DBHandler.<init>(DBHandler.java:73)
        at org.wso2.siddhi.extension.eventtable.RDBMSEventTable.init(RDBMSEventTable.java:112)
        at org.wso2.siddhi.core.util.parser.helper.DefinitionParserHelper.addEventTable(DefinitionParserHelper.java:99)
        at org.wso2.siddhi.core.util.ExecutionPlanRuntimeBuilder.defineTable(ExecutionPlanRuntimeBuilder.java:74)
        at org.wso2.siddhi.core.util.parser.ExecutionPlanParser.defineTableDefinitions(ExecutionPlanParser.java:162)
        at org.wso2.siddhi.core.util.parser.ExecutionPlanParser.parse(ExecutionPlanParser.java:115)
        at org.wso2.siddhi.core.SiddhiManager.validateExecutionPlan(SiddhiManager.java:68)
        at org.wso2.siddhi.core.SiddhiManager.validateExecutionPlan(SiddhiManager.java:74)
        at org.wso2.carbon.event.processor.core.internal.util.helper.EventProcessorHelper.validateExecutionPlan(EventProcessorHelper.java:191)

我也尝试使用此代码:

@From(eventtable='rdbms', jdbc.url='jdbc:postgresql://localhost:5432/pruebabg', username='postgres', password='postgres', driver.name='org.postgresql.Driver', table.name='pharming')
define table pharming (phi_id_pharming_incident long, phi_id_license int, phi_machine_user_id string, phi_date string, phi_machine_user_date string, phi_protected_site string, phi_pharming_glp string, 
                                phi_user_ip string, phi_dsb_version string, phi_os string, phi_os_version string, user_id int);

我该如何解决这个问题?

2 个答案:

答案 0 :(得分:0)

首先检查以下内容。

  1. 确保您已运行位于的相关数据库脚本 针对数据库的/dbscripts/postgresql.sql。
  2. 确保放置相关的数据库驱动程序 / repository / components / lib文件夹。
  3. 我怀疑master-datasources.xml中存在一些不正确的配置。如果你可以在master-datasources.xml中共享你的配置,那么跟踪确切的问题会更容易。请在此链接[1]中找到有关如何使用WSO2 DAS设置PostgreSQL数据库的说明(适用于DAS 3.0.0)。希望您对此信息有所帮助。

    [1] https://docs.wso2.com/display/DAS300/Setting+up+PostgreSQL

答案 1 :(得分:0)

感谢你的回复。

仅在某些数据库中测试了事件表:

https://docs.wso2.com/display/DAS301/Siddhi+Query+Language#SiddhiQueryLanguage-RDBMSEventTable

“已使用以下数据库测试了RDBMS事件表: MySQL的 H2 甲骨文“

无论如何,我尝试更新/repository/components/plugins/siddhi-extension-event-table_3.x.x.jar中的rdbms-table-config.xml:  https://github.com/wso2/siddhi/blob/master/modules/siddhi-extensions/event-table/src/main/resources/rdbms-table-config.xml

 </mapping>
        <mapping db='postgresql'>
            <elements>
               	<element key="bool">SMALLINT</element>
				<element key="integer">INTEGER</element>
            </elements>
        </mapping>

相关问题