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 .
Related
I'm working through a book on GlassFish4 application server and have trouble deploying a sample war to the server. The server says:
"Error occurred during deployment: Exception while deploying the app [jpaintro-1.0] : Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.1.v20150605-31e8258): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: The connection was refused because the database customerdb was not found. Error Code: 0. Please see server.log for more details."
The database server is Derby that comes with GlassFish. The database was created with this from the ./ij prompt:
connect 'jdbc:derby://localhost:1527/customerdb;create=true';
Next I could logon:
connect 'jdbc:derby://localhost:1527/customerdb;user=dev;password=dev';
and successfully enter table creation data and insert table data. Next I could retrieve this data with SQL. All fine, so the database exists.
Physical location database:
/home/fedora/GlassFish/glassfish4/glassfish/databases/1527/customerdb
The DERBY_HOME environment value was set.
I had to set up the following resources from the command line prompt:
./asadmin create-jdbc-connection-pool --datasourceclassname org.apache.derby.jdbc.ClientDataSource --restype javax.sql.DataSource --property DatabaseName=customerdb:User=dev:password=dev CustomerDBPool
./asadmin create-jdbc-resource --connectionpoolid CustomerDBPool jdbc/__CustomerDBPool
And I could verify in the GlassFish console that they were created successfully. The JDBC connection pool does indeed have an entry CustomerDBPool with an "additional property" name=DatabaseName, value=customerdb as well as user/password dev/dev. Also in the console is a JDBC resource with JNDI name jdbc/__CustomerDBPool and pool name CustomerDBPool
The war-file that I can't deploy contains a JPA-entity Customer and CDI named bean JpaDemoBean. The latter constructs a few Customer object and persists them to the database.
In the persistence.xml there is merely a jta-data-source element with value jdbc/__CustomerDBPool
I am all following literally "from the book".
Now why can't I deploy the war?
And all of a sudden I can't connect to the database via command line tool ij either:
ERROR 08004: The connection was refused because the database customerdb was not found.
I can stop and start the database server from the command line, but during startup I get the message:
"Invalid database home directory: /home/fedora/GlassFish/glassfish4/glassfish/databases"
Nevertheless the startup process continues and says it started the database successfully.
Thanks in advance!
i would execute a simple select with eclipselink from another schema like this:
Query query = em.createNativeQuery("select * from another_schema.TABLE_NAME");
List returnList = query.getResultList();
But when i run my application i get the following error:
java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback.
Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 30 seconds
BEA1-0091256F3B0B87325B62]'. No further JDBC access is allowed within this transaction.
I have privileges to run this sql command, i tried with sql developer, and it's working.
Can anybody please help me, how should I run this NativeQuery?
Thank you!
I solved this error "No further JDBC access is allowed within this transaction." by setting the transaction in Weblogic as "Local Transaction".
Just uncheck the transaction option: Supports Global Transactions
I'm having trouble restoring an OrientDB database from a backup. I'm using OrientDB version 1.2.0 (this backup is from November 2012) and the backup was produced by OrientDB (same version) using the built-in backup utility. I'm trying to restore the backup to a new database using the OrientDB console:
create database remote:localhost/dbname root password local graph
import database backup.json
But when I run those commands, I get the following error in the console:
Importing indexes ...
- Index 'dictionary'...Error on database import happened just before line 22258, column 6
com.orientechnologies.orient.core.exception.OConcurrentModificationException: Cannot update record #0:1 in storage 'dbname' because the version is not the latest. Probably you are updating an old record or it has been modified by another user (db=v2 your=v1)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.createException(OChannelBinary.java:429)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.handleStatus(OChannelBinary.java:382)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:145)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:59)
at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:1556)
at com.orientechnologies.orient.client.remote.OStorageRemote.command(OStorageRemote.java:727)
at com.orientechnologies.orient.client.remote.OStorageRemoteThread.command(OStorageRemoteThread.java:191)
at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:60)
at com.orientechnologies.orient.core.index.OIndexManagerRemote.dropIndex(OIndexManagerRemote.java:80)
at com.orientechnologies.orient.core.index.OIndexManagerProxy.dropIndex(OIndexManagerProxy.java:80)
at com.orientechnologies.orient.core.db.tool.ODatabaseImport.importIndexes(ODatabaseImport.java:687)
at com.orientechnologies.orient.core.db.tool.ODatabaseImport.importDatabase(ODatabaseImport.java:127)
at com.orientechnologies.orient.console.OConsoleDatabaseApp.importDatabase(OConsoleDatabaseApp.java:1419)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.orientechnologies.common.console.OConsoleApplication.execute(OConsoleApplication.java:238)
at com.orientechnologies.common.console.OConsoleApplication.executeCommands(OConsoleApplication.java:127)
at com.orientechnologies.common.console.OConsoleApplication.run(OConsoleApplication.java:92)
at com.orientechnologies.orient.console.OConsoleDatabaseApp.main(OConsoleDatabaseApp.java:130)
All of the records import correctly, but it fails on the indexes. I have 15+ backups of the same database and they all have this issue, so it seems unlikely that they're all corrupted. How can I restore my database? (I'm OK with having to modify the JSON if needbe.)
When trying to use local mode rather than remote mode, I get a different error:
Started import of database 'local:dbname' from dbname.json...
Importing database info...OK
Importing clusters...
- Creating cluster 'internal'...OK, assigned id=0
- Creating cluster 'default'...Error on database import happened just before line 13, column 52
com.orientechnologies.orient.core.exception.OConfigurationException: Imported cluster 'default' has id=3 different from the original: 2. To continue the import drop the cluster 'manindex' that has 1 records
at com.orientechnologies.orient.core.db.tool.ODatabaseImport.importClusters(ODatabaseImport.java:544)
at com.orientechnologies.orient.core.db.tool.ODatabaseImport.importDatabase(ODatabaseImport.java:130)
at com.orientechnologies.orient.console.OConsoleDatabaseApp.importDatabase(OConsoleDatabaseApp.java:1414)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.orientechnologies.common.console.OConsoleApplication.execute(OConsoleApplication.java:269)
at com.orientechnologies.common.console.OConsoleApplication.executeCommands(OConsoleApplication.java:157)
at com.orientechnologies.common.console.OConsoleApplication.run(OConsoleApplication.java:97)
at com.orientechnologies.orient.graph.console.OGremlinConsole.main(OGremlinConsole.java:53)
Error: com.orientechnologies.orient.core.db.tool.ODatabaseExportException: Error on importing database 'dbname' from file: dbname.json
Error: com.orientechnologies.orient.core.exception.OConfigurationException: Imported cluster 'default' has id=3 different from the original: 2. To continue the import drop the cluster 'manindex' that has 1 records
It seems like the issue is that my old cluster IDs don't match the ones in the new database. Perhaps there are creation options that affect which clusters are created by default?
It turns out that the issue was that the database was being imported with OrientDB version 1.2.0 but was created with 1.0.1 (or 1.0.0). The JSON file listed version 1.2.0 as the engine-version, but that was the engine that backed it up, not created it. After I tried Lvca's suggestion of using local mode, I discovered that the cluster IDs weren't matching up. From there I guessed that the version numbers might not be correct. So it seems that even though I was running the database using the 1.2.0 server and the 1.2.0 Java library, the database was never "upgraded" to use the new 1.2.0 schema.
Thanks to Lvca for a nudge in the right direction.
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.
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.