I am using grails 2.4.2 and postgresql with grails db-migration 1.4.0 plugin. Whenever I issue the grails dbm-update command I get the following exception thereby resulting in failure of tables creation:
Starting dbm-update for database user # jdbc:postgresql://localhost:5432/mydb
liquibase.exception.LockException: liquibase.exception.DatabaseException: Empty result set, expected one row
at liquibase.lockservice.LockService.acquireLock(LockService.java:121)
at liquibase.lockservice.LockService.waitForLock(LockService.java:61)
at liquibase.Liquibase.update(Liquibase.java:102)
at DbmUpdate$_run_closure1_closure2.doCall(DbmUpdate:26)
at DbmUpdate$_run_closure2_closure11.doCall(DbmUpdate:59)
at grails.plugin.databasemigration.MigrationUtils.executeInSession(MigrationUtils.groovy:133)
at DbmUpdate$_run_closure2.doCall(DbmUpdate:51)
at DbmUpdate$_run_closure1.doCall(DbmUpdate:25)
Caused by: liquibase.exception.DatabaseException: Empty result set, expected one row
at liquibase.util.JdbcUtils.requiredSingleResult(JdbcUtils.java:124)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:159)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:167)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:163)
at liquibase.lockservice.LockService.acquireLock(LockService.java:96)
... 7 more
Any help will be appreciated.
Related
To transfer data from Ms sql server 2008 to Snowflake I used talend , but every time I get error as
java.io.IOException: net.snowflake.client.loader.Loader$ConnectionError: State: CREATE_TEMP_TABLE, SQL compilation error: error line 1 at position 68
invalid identifier '"columnname"'
at org.talend.components.snowflake.runtime.SnowflakeWriter.close(SnowflakeWriter.java:397)
at org.talend.components.snowflake.runtime.SnowflakeWriter.close(SnowflakeWriter.java:52)
at local_project.load_jobnotes_0_1.Load_Jobnotes.tMSSqlInput_1Process(Load_Jobnotes.java:2684)
at local_project.load_jobnotes_0_1.Load_Jobnotes.runJobInTOS(Load_Jobnotes.java:3435)
at local_project.load_jobnotes_0_1.Load_Jobnotes.main(Load_Jobnotes.java:2978)
Caused by: net.snowflake.client.loader.Loader$ConnectionError: State: CREATE_TEMP_TABLE, SQL compilation error: error line 1 at position 68
invalid identifier '"ID"'
at net.snowflake.client.loader.ProcessQueue.run(ProcessQueue.java:349)
at java.lang.Thread.run(Thread.java:748)
Caused by: net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error: error line 1 at position 68
The column does exist in my Snowflake DB still I get error as column does not exist
On analysing what query Talend executing in snowflake I found that It tries to create a temporary table to store data but in doing so it selects all column from table between “ ” double quotes and hence error comes as invalid identifier '"columnname"'
If I execute the same query manually without double quotes its works fine , can you please let us know what is workaround of this issue
Query executed by talend in snowflake for your reference
CREATE TEMPORARY TABLE "Tablename_20171024_115736_814_1"
AS SELECT "column1","column2","column3"
FROM "database"."schema"."table" WHERE FALSE
The issue is most likely due to a case mismatch between the object names in Snowflake and what is being sent through the connector. On the Snowflake side, all object names are stored as UPPER CASE. Suggest you try passing COLUMN1, COLUMN2, etc and see if that works.
You can also try setting the QUOTED_IDENTIFIERS_IGNORE_CASE to true, it might help.
I found that this issue is due to mixed case database or schema names not properly being applied by Talend. I discover a hack by updating the Snowflake connector role parameter and added something such as this screenshot:
I attempted to setup OFBiz on PostgreSQL, but when I run the server, I get this error when I visit http://server_address:8080/ecommerce/:
org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen [component://ecommerce/widget/CommonScreens.xml#main]: java.lang.IllegalArgumentException: Error running script at location [component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy]: org.ofbiz.entity.GenericEntityException: org.ofbiz.entity.transaction.GenericTransactionException: The current transaction is marked for rollback, not beginning a new transaction and aborting current operation; the rollbackOnly was caused by: Failure in findByCondition operation for entity [ProdCatalogCategory]: org.ofbiz.entity.GenericEntityException: org.postgresql.Driver (org.postgresql.Driver). Rolling back transaction.org.ofbiz.entity.GenericEntityException: org.postgresql.Driver (org.postgresql.Driver) (org.postgresql.Driver (org.postgresql.Driver)) (The current transaction is marked for rollback, not beginning a new transaction and aborting current operation; the rollbackOnly was caused by: Failure in findByCondition operation for entity [ProdCatalogCategory]: org.ofbiz.entity.GenericEntityException: org.postgresql.Driver (org.postgresql.Driver). Rolling back transaction.org.ofbiz.entity.GenericEntityException: org.postgresql.Driver (org.postgresql.Driver) (org.postgresql.Driver (org.postgresql.Driver))) (Error running script at location [component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy]: org.ofbiz.entity.GenericEntityException: org.ofbiz.entity.transaction.GenericTransactionException: The current transaction is marked for rollback, not beginning a new transaction and aborting current operation; the rollbackOnly was caused by: Failure in findByCondition operation for entity [ProdCatalogCategory]: org.ofbiz.entity.GenericEntityException: org.postgresql.Driver (org.postgresql.Driver). Rolling back transaction.org.ofbiz.entity.GenericEntityException: org.postgresql.Driver (org.postgresql.Driver) (org.postgresql.Driver (org.postgresql.Driver)) (The current transaction is marked for rollback, not beginning a new transaction and aborting current operation; the rollbackOnly was caused by: Failure in findByCondition operation for entity [ProdCatalogCategory]: org.ofbiz.entity.GenericEntityException: org.postgresql.Driver (org.postgresql.Driver). Rolling back transaction.org.ofbiz.entity.GenericEntityException: org.postgresql.Driver (org.postgresql.Driver) (org.postgresql.Driver (org.postgresql.Driver))))
However, I have no idea what it means. I setup a basic database called ofbiz with the owner as the ofbiz user. Then ran ./ant load-demo to populate the database with the demo data. My operating system is Debian GNU/Linux 7.2. I should also note that I'm a newcomer to PostgreSQL, OFBiz, and Java. I'm sorry about formatting, this is how it came.
Your question is not clear. I am assuming that PostgreSQL driver are missing. By default ofbiz doesnt come with PostgreSQL drivers so you need to download it. Go to ofbiz directory and run the following command
ant download-PG-JDBC in windows or ./ant download-PG-JDBC for linux .
I have followed the instructions from here and installed the updated plugin. The error has become:
Query error
Message: net.sf.jasperreports.engine.JRException:
Error executing SQL statement for : null Level: SEVERE Stack Trace:
Error executing SQL statement for : null com.jaspersoft.hadoop.hive.HiveFieldsProvider.getFields(HiveFieldsProvider.java:113)
com.jaspersoft.ireport.hadoop.hive.designer.HiveFieldsProvider.getFields(HiveFieldsProvider.java:32)
com.jaspersoft.ireport.hadoop.hive.connection.HiveConnection.readFields(HiveConnection.java:154)
com.jaspersoft.ireport.designer.wizards.ConnectionSelectionWizardPanel.validate(ConnectionSelectionWizardPanel.java:146)
org.openide.WizardDescriptor$7.run(WizardDescriptor.java:1357)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
After downgrading to 4.5.0 the error has become (the connection is verified and I am able to query the table from hive):
Query error
Message: net.sf.jasperreports.engine.JRException: Query returned non-zero code: 10, cause:
FAILED: Error in semantic analysis: Line 1:14 Table not found 'panstats' Level:
SEVERE Stack Trace: Query returned non-zero code: 10, cause:
FAILED: Error in semantic analysis: Line 1:14 Table not found 'panstats'
com.jaspersoft.hadoop.hive.HiveFieldsProvider.getFields(HiveFieldsProvider.java:260)
com.jaspersoft.ireport.hadoop.hive.designer.HiveFieldsProvider.getFields(HiveFieldsProvider.java:32)
com.jaspersoft.ireport.hadoop.hive.connection.HiveConnection.readFields(HiveConnection.java:146)
com.jaspersoft.ireport.designer.wizards.ConnectionSelectionWizardPanel.validate(ConnectionSelectionWizardPanel.java:146)
org.openide.WizardDescriptor$7.run(WizardDescriptor.java:1357)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
I am using Hive 0.8.1 on OS X Lion 10.7.4.
Is your query as simple as select * from panstats? I suspect that the query is not the problem, but you'll want to confirm that first.
You could try querying that table from a tool like SQuirreL SQL. If that tool also cannot get the data, then it's probably a Hive issue. If it can... then it's probably an issue with iReport or the Hive plugin.
It sounds like Hive is not configured to share metadata. It uses the annoying default configuration with Derby, so outside connections don't get access to your panstats table. I came across this article about configuring Hive earlier this year. It documents using MySQL instead of derby. If that's indeed the problem, then it's just a Hive configuration issue. Following that article would solve things both for SQuirreL and for iReport.
I'm working with: seam 2.2.2 + hibernate + richfaces + jboss 5.1 + postgreSQL
I have an module which needs to load some data from the database. Easy. The problem is, on development it works fine, 100%, but when I deploy on my production server and try to get the data, an error rise:
could not read column value from result set: fechahor9_504_; Bad value for type timestamp : [C#122e5cf
SQL Error: 0, SQLState: 22007
Bad value for type timestamp : [C#122e5cf
javax.persistence.PersistenceException: org.hibernate.exception.DataException: could not execute query
[more errors]
Caused by: org.postgresql.util.PSQLException: Bad value for type timestamp : [C#122e5cf
at org.postgresql.jdbc2.TimestampUtils.loadCalendar(TimestampUtils.java:232)
[more errors]
Caused by: java.lang.NumberFormatException: Trailing junk on timestamp: ''
at org.postgresql.jdbc2.TimestampUtils.loadCalendar(TimestampUtils.java:226)
I can't understand why it works on my machine (development) and why not on production. Any clues? Anyone gone through the same problem? Is exactly the same compilation
Stefano Travelli was right. I was checking the jBoss on production and there was an old jdbc driver on [jboss_dir]/common/lib from an old jwebstart application (not developed by me). Deleted that jdbc and it works fine. I should check if the old application is still needed and if so, check if it still works without the jdbc being there or with an upgraded version.
Not sure what the driver story is ..
but the problem for me show up when JDBC tries to parse bigint from the DB to
myOjbect.setDate(Date date){...}
the other "JDBC friendly" is ignorred for some reason .
myOjbect.setDate(long date){...}
So .. removing the Date setter and leaving a long one resolves the problem.
This is a Big workaround .. but may help someone out there :)
Whenever I connect to HSQLDB from my application deployed on JBoss 5.1, it throws exception as : Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: error in script file line: 1 Unexpected token UNIQUE, requires COLLATION in statement [SET DATABASE UNIQUE]) .
My HSQLDB script file reads something as below :
`SET DATABASE UNIQUE NAME HSQLDB2E0BAD63B3
SET DATABASE GC 0
SET DATABASE DEFAULT RESULT MEMORY ROWS 0
SET DATABASE EVENT LOG LEVEL 0
.....`
Does anyone have idea what thos exception means or should I change something in my HSQLDB configuration?
Regards,
Satya
Your database files are created with version 2.x, but the version of database engine running on JBoss 5.1 is 1.8.x. You should be able to replace the hsqldb.jar in the JBoss configuration with a new version.