karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré (JIRA) <j...@apache.org>
Subject [jira] [Assigned] (KARAF-5730) pax jdbc does not create tables in H2 database
Date Thu, 03 May 2018 07:12:00 GMT

     [ https://issues.apache.org/jira/browse/KARAF-5730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jean-Baptiste Onofré reassigned KARAF-5730:
-------------------------------------------

    Assignee: Jean-Baptiste Onofré

> pax jdbc does not create tables in H2 database
> ----------------------------------------------
>
>                 Key: KARAF-5730
>                 URL: https://issues.apache.org/jira/browse/KARAF-5730
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-jdbc
>    Affects Versions: 4.2.0
>            Reporter: Olga Kulikova
>            Assignee: Jean-Baptiste Onofré
>            Priority: Critical
>
> Cannot create tables in H2 database. I tried the following with the freshly downloaded
karaf 4.2.0:
> {{karaf@root()> feature:install transaction jndi jdbc pax-jdbc pax-jdbc-h2 pax-jdbc-config}}
> {{karaf@root()> jdbc:ds-list}}
> {{Name │ Product │ Version │ URL │ Status}}
> {{─────┼─────────┼─────────┼─────┼───────}}
> {{karaf@root()> jdbc:ds-create -dc org.h2.Driver -url "jdbc:h2:mem:~/test" test}}
> {{karaf@root()> jdbc:ds-list}}
> {{Name │ Product │ Version │ URL │ Status}}
> {{─────┼─────────┼──────────────────────┼────────────────────┼───────}}
> {{test │ H2 │ 1.3.172 (2013-05-25) │ jdbc:h2:mem:~/test │ OK}}
> {{karaf@root()> jdbc:tables test}}
> {{TABLE_CAT │ TABLE_NAME │ SELF_REFERENCING_COL_NAME │ TABLE_SCHEM │ TYPE_SCHEM
│ TYPE_CAT │ TABLE_TYPE │ REMARKS │ REF_GENERATION │ TYPE_NAME │ SQL}}
> {{──────────┼───────────────────┼───────────────────────────┼────────────────────┼────────────┼──────────┼──────────────┼─────────┼────────────────┼───────────┼────}}
> {{TEST │ CATALOGS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ COLLATIONS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │
│}}
> {{TEST │ COLUMNS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ COLUMN_PRIVILEGES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │
│ │ │}}
> {{TEST │ CONSTANTS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │
│}}
> {{TEST │ CONSTRAINTS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │
│}}
> {{TEST │ CROSS_REFERENCES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │
│ │}}
> {{TEST │ DOMAINS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ FUNCTION_ALIASES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │
│ │}}
> {{TEST │ FUNCTION_COLUMNS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │
│ │}}
> {{TEST │ HELP │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ INDEXES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ IN_DOUBT │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ LOCKS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ RIGHTS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ ROLES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ SCHEMATA │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ SEQUENCES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │
│}}
> {{TEST │ SESSIONS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ SESSION_STATE │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │
│ │}}
> {{TEST │ SETTINGS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ TABLES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ TABLE_PRIVILEGES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │
│ │}}
> {{TEST │ TABLE_TYPES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │
│}}
> {{TEST │ TRIGGERS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ TYPE_INFO │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │
│}}
> {{TEST │ USERS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ VIEWS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{karaf@root()> jdbc:execute test "CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255))"}}
> {{karaf@root()> jdbc:tables test}}
> {{TABLE_CAT │ TABLE_NAME │ SELF_REFERENCING_COL_NAME │ TABLE_SCHEM │ TYPE_SCHEM
│ TYPE_CAT │ TABLE_TYPE │ REMARKS │ REF_GENERATION │ TYPE_NAME │ SQL}}
> {{──────────┼───────────────────┼───────────────────────────┼────────────────────┼────────────┼──────────┼──────────────┼─────────┼────────────────┼───────────┼────}}
> {{TEST │ CATALOGS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ COLLATIONS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │
│}}
> {{TEST │ COLUMNS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ COLUMN_PRIVILEGES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │
│ │ │}}
> {{TEST │ CONSTANTS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │
│}}
> {{TEST │ CONSTRAINTS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │
│}}
> {{TEST │ CROSS_REFERENCES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │
│ │}}
> {{TEST │ DOMAINS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ FUNCTION_ALIASES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │
│ │}}
> {{TEST │ FUNCTION_COLUMNS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │
│ │}}
> {{TEST │ HELP │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ INDEXES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ IN_DOUBT │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ LOCKS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ RIGHTS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ ROLES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ SCHEMATA │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ SEQUENCES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │
│}}
> {{TEST │ SESSIONS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ SESSION_STATE │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │
│ │}}
> {{TEST │ SETTINGS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ TABLES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ TABLE_PRIVILEGES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │
│ │}}
> {{TEST │ TABLE_TYPES │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │
│}}
> {{TEST │ TRIGGERS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ TYPE_INFO │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │
│}}
> {{TEST │ USERS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
> {{TEST │ VIEWS │ │ INFORMATION_SCHEMA │ │ │ SYSTEM TABLE │ │ │ │}}
>  
> The only records in the log (debug):
> {{13:47:56.834 DEBUG [Karaf local console user karaf] Executing command: 'jdbc:execute
test "CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255))"'}}
> {{13:47:56.918 DEBUG [Karaf local console user karaf] Command: 'jdbc:execute test "CREATE
TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255))"' returned 'null'}}
> {{13:47:59.793 DEBUG [Karaf local console user karaf] Executing command: 'jdbc:tables
test'}}
> {{13:47:59.910 DEBUG [Karaf local console user karaf] Command: 'jdbc:tables test' returned
'null'}}
>  
> If I try to do the same with derby (like in the documentation [http://karaf.apache.org/manual/latest/#_datasources_jdbc|http://karaf.apache.org/manual/latest/#_datasources_jdbc),]), the
table is created, but jdbc:ds-list shows 2 datasources:
> {{karaf@root()> jdbc:ds-list}}
> {{Name │ Product │ Version │ URL │ Status}}
> {{─────┼─────────┼─────────┼─────┼───────}}
> {{karaf@root()> jdbc:ds-create -dn derby -url "jdbc:derby:test;create=true" test}}
> {{karaf@root()> jdbc:ds-list}}
> {{Name │ Product │ Version │ URL │ Status}}
> {{─────┼──────────────┼───────────────────────┼─────────────────┼───────}}
> {{test │ Apache Derby │ 10.13.1.1 - (1765088) │ jdbc:derby:test │ OK}}
> {{test │ Apache Derby │ 10.13.1.1 - (1765088) │ jdbc:derby:test │ OK}}
> From the log (info):
> {{14:01:54.701 INFO [CM Configuration Updater (Delete: pid=org.ops4j.datasource.a3c8e29e-cfbf-4283-85c4-ac53e2cc4cdb)]
Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))}}
> {{14:01:54.702 INFO [CM Configuration Updater (Delete: pid=org.ops4j.datasource.a3c8e29e-cfbf-4283-85c4-ac53e2cc4cdb)]
Found DataSourceFactory. Creating DataSource test}}
> {{14:01:54.703 INFO [CM Configuration Updater (Delete: pid=org.ops4j.datasource.a3c8e29e-cfbf-4283-85c4-ac53e2cc4cdb)]
Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))}}
> {{14:01:54.703 INFO [CM Configuration Updater (Delete: pid=org.ops4j.datasource.a3c8e29e-cfbf-4283-85c4-ac53e2cc4cdb)]
Found DataSourceFactory. Creating DataSource test}}
> {{14:02:04.571 WARN [pipe-jdbc:ds-list] Multiple JDBC datasources found with the same
service ranking for test}}
> {{14:02:04.572 WARN [pipe-jdbc:ds-list] Multiple JDBC datasources found with the same
service ranking for test}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message