简体   繁体   English

错误数据源Postgres与WSO2 DAS

[英]Error Datasource Postgres with WSO2 DAS

I am trying to change the WSO2 DAS data source from H2 to postgres. 我正在尝试将WSO2 DAS数据源从H2更改为postgres。

I have configured all the database changes in master-datasource.xml, user-mgt.xml, and registry.xml 我已在master-datasource.xml,user-mgt.xml和registry.xml中配置了所有数据库更改

The below exception is being thrown while creating an event Table 创建事件表时会抛出以下异常

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)

I try with this code: 我尝试使用此代码:

@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);

I try with this code too: 我也尝试使用这个代码:

@From(eventtable='rdbms', datasource.name='WSO2_CARBON_DB', table.name='pharming_incident')
define table pharming_incident (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);

How can I solve this? 我怎么解决这个问题?

First check following. 首先检查以下内容

  1. Make sure that you have run the relevant database script located at /dbscripts/postgresql.sql against your database. 确保已针对数据库运行位于/dbscripts/postgresql.sql的相关数据库脚本。
  2. Make sure the relevant database driver is placeed in /repository/components/lib folder. 确保将相关的数据库驱动程序放在/ repository / components / lib文件夹中。

I suspect that there is some incorrect configuration in your master-datasources.xml. 我怀疑master-datasources.xml中存在一些不正确的配置。 If you could share your config in master-datasources.xml it would be easier to track down the exact issue. 如果你可以在master-datasources.xml中共享你的配置,那么跟踪确切的问题会更容易。 Please find the instructions(for DAS 3.0.0) on how to set up the PostgreSQL database with WSO2 DAS in this link [1]. 请在此链接[1]中找到有关如何使用WSO2 DAS设置PostgreSQL数据库的说明(适用于DAS 3.0.0)。 Hope you find this information helpful. 希望您发现此信息有用。

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

Thanks for your answear. 谢谢你的穿着。

The Event table is only tested with some databases: 事件表仅使用某些数据库进行测试:

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

"RDBMS event table has been tested with the following databases: MySQL H2 Oracle" “已使用以下数据库测试了RDBMS事件表:MySQL H2 Oracle”

Anyway, I try updating the rdbms-table-config.xml which is there in /repository/components/plugins/siddhi-extension-event-table_3.xxjar a per : https://github.com/wso2/siddhi/blob/master/modules/siddhi-extensions/event-table/src/main/resources/rdbms-table-config.xml . 无论如何,我尝试更新rdbms-table-config.xml,它位于/repository/components/plugins/siddhi-extension-event-table_3.xxjar a per: 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> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM