openvpms-release-1.5-beta-1 archload error
Hi Matt,
Had a go at setting up. Migrate works ok but can't get archload to run properly. Hibernate file again? Noted that you have listed Java version 1.6 or higher is this necessary as still using Java 1.5.0_16.
Attached error generated on archload.
Thanks Geoff
Attachment isnt accessable my end so revised post and included here
C:\openvpms-release-1.5-beta-1\bin>archload
0 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Cannot delete or upda
te a parent row: a foreign key constraint fails (`openvpms/assertion_descriptors
`, CONSTRAINT `FKA1159D27C550DB74` FOREIGN KEY (`node_desc_id`) REFERENCES `node
_descriptors` (`node_desc_id`))
0 [main] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could no
t synchronize database state with session
org.hibernate.exception.ConstraintViolationException: could not delete: [org.ope
nvpms.component.business.dao.hibernate.im.archetype.ArchetypeDescriptorDOImpl#45
7]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.j
ava:94)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp
er.java:66)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(Abstrac
tEntityPersister.java:2559)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(Abstrac
tEntityPersister.java:2715)
at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.ja
va:97)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutio
ns(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlus
hEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
at org.openvpms.component.business.dao.hibernate.im.common.AbstractDelet
eHandler.delete(AbstractDeleteHandler.java:59)
at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
$3.doInHibernate(IMObjectDAOHibernate.java:204)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(Hibern
ateTemplate.java:406)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(Hibernat
eTemplate.java:339)
at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
$9$1.doInHibernate(IMObjectDAOHibernate.java:1090)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(Hibern
ateTemplate.java:406)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(Hibernat
eTemplate.java:339)
at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
$9.doInTransaction(IMObjectDAOHibernate.java:1086)
at org.springframework.transaction.support.TransactionTemplate.execute(T
ransactionTemplate.java:130)
at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.update(IMObjectDAOHibernate.java:1084)
at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.delete(IMObjectDAOHibernate.java:198)
at org.openvpms.component.business.service.archetype.ArchetypeService.re
move(ArchetypeService.java:448)
at org.openvpms.tools.archetype.loader.ArchetypeLoader.removeArchetypeDe
scriptors(ArchetypeLoader.java:563)
at org.openvpms.tools.archetype.loader.ArchetypeLoader.clean(ArchetypeLo
ader.java:168)
at org.openvpms.tools.archetype.loader.ArchetypeLoader.main(ArchetypeLoa
der.java:301)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationExce
ption: Cannot delete or update a parent row: a foreign key constraint fails (`op
envpms/assertion_descriptors`, CONSTRAINT `FKA1159D27C550DB74` FOREIGN KEY (`nod
e_desc_id`) REFERENCES `node_descriptors` (`node_desc_id`))
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
va:1761)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:2046)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1964)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1949)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Del
egatingPreparedStatement.java:101)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(Abstrac
tEntityPersister.java:2541)
... 23 more
31 [main] ERROR org.openvpms.tools.archetype.loader.ArchetypeLoader - org.openv
pms.component.business.service.archetype.ArchetypeServiceException: Failed to de
lete object with reference descriptor.archetype.1.0:457:86dbf8e2-ee0a-11de-b153-
05f220bf3a18
org.openvpms.component.business.service.archetype.ArchetypeServiceException: Fai
led to delete object with reference descriptor.archetype.1.0:457:86dbf8e2-ee0a-1
1de-b153-05f220bf3a18
at org.openvpms.component.business.service.archetype.ArchetypeService.re
move(ArchetypeService.java:455)
at org.openvpms.tools.archetype.loader.ArchetypeLoader.removeArchetypeDe
scriptors(ArchetypeLoader.java:563)
at org.openvpms.tools.archetype.loader.ArchetypeLoader.clean(ArchetypeLo
ader.java:168)
at org.openvpms.tools.archetype.loader.ArchetypeLoader.main(ArchetypeLoa
der.java:301)
Caused by: org.openvpms.component.business.dao.im.common.IMObjectDAOException: F
ailed to delete IMObject with reference descriptor.archetype.1.0:457:86dbf8e2-ee
0a-11de-b153-05f220bf3a18
at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.delete(IMObjectDAOHibernate.java:212)
at org.openvpms.component.business.service.archetype.ArchetypeService.re
move(ArchetypeService.java:448)
... 3 more
Caused by: org.springframework.dao.DataIntegrityViolationException: could not de
lete: [org.openvpms.component.business.dao.hibernate.im.archetype.ArchetypeDescr
iptorDOImpl#457]; SQL [delete from archetype_descriptors where archetype_desc_id
=? and version=?]; constraint [null]; nested exception is org.hibernate.exceptio
n.ConstraintViolationException: could not delete: [org.openvpms.component.busine
ss.dao.hibernate.im.archetype.ArchetypeDescriptorDOImpl#457]
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHiberna
teAccessException(SessionFactoryUtils.java:637)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernate
AccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(Hibern
ateTemplate.java:411)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(Hibernat
eTemplate.java:339)
at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
$9$1.doInHibernate(IMObjectDAOHibernate.java:1090)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(Hibern
ateTemplate.java:406)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(Hibernat
eTemplate.java:339)
at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
$9.doInTransaction(IMObjectDAOHibernate.java:1086)
at org.springframework.transaction.support.TransactionTemplate.execute(T
ransactionTemplate.java:130)
at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.update(IMObjectDAOHibernate.java:1084)
at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.delete(IMObjectDAOHibernate.java:198)
... 4 more
Caused by: org.hibernate.exception.ConstraintViolationException: could not delet
e: [org.openvpms.component.business.dao.hibernate.im.archetype.ArchetypeDescript
orDOImpl#457]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.j
ava:94)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp
er.java:66)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(Abstrac
tEntityPersister.java:2559)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(Abstrac
tEntityPersister.java:2715)
at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.ja
va:97)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutio
ns(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlus
hEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
at org.openvpms.component.business.dao.hibernate.im.common.AbstractDelet
eHandler.delete(AbstractDeleteHandler.java:59)
at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
$3.doInHibernate(IMObjectDAOHibernate.java:204)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(Hibern
ateTemplate.java:406)
... 12 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationExce
ption: Cannot delete or update a parent row: a foreign key constraint fails (`op
envpms/assertion_descriptors`, CONSTRAINT `FKA1159D27C550DB74` FOREIGN KEY (`nod
e_desc_id`) REFERENCES `node_descriptors` (`node_desc_id`))
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
va:1761)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:2046)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1964)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1949)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Del
egatingPreparedStatement.java:101)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(Abstrac
tEntityPersister.java:2541)
... 23 more
47 [main] ERROR org.openvpms.tools.archetype.loader.ArchetypeLoader - Rolling b
ack changes
C:\openvpms-release-1.5-beta-1\bin>
Re: openvpms-release-1.5-beta-1 archload error
Hi Geoff,
Sorry, but I can't help you with the archload script. But, I'm sure someone will be able to.
OpenVPMS 1.5 has only be tested with java version 1.6, specifically the ESCI has been developed for 1.6+ so java 1.5 may or may not work.
Matt Y.
Hi Matt, Managed to install
Hi Matt,
Managed to install from scratch on xp system think problem was in tomcat configuration and vista. Not quite sorted as throwing me application error on login after loaded own database but should be able to sort.
Thanks Geoff
Re: openvpms-release-1.5-beta-1 archload error
Hi Geoff, I haven't seen that particular problem migrating a 1.4 database to 1.5.
You might be missing "on delete cascade" constraints on the node_descriptor table.
The schema for this table should look like:
You can generate this using the following command in mysql:
If the table is missing the constraints, the easiest way to add them is via MySQL Workbench.
-Tim
Re: openvpms-release-1.5-beta-1 archload error
Thanks for the help Tim,
Delete cascade all seemed in order. Appears to be an issue with Vista & tomcat on my laptop so have resorted to desktop and XP pro to test out 1.5 Beta. I havent managed to install 1.5 via upgrade script as it looks to setup OK but then wont accept password at login.
I was successful though setting up the database using 1.5 Beta itself and then restoring my database via mysql administrator.
This let me experiment with customer/alerts which look good.
The ability to edit products directly is going to make things far easier and quicker. :-)
Problem I have is that all is well until I reboot then further attempts to log in give an application error. Only takes 5 minutes to setup from scratch again so can continue to test but if anyone has an idea as to why the login is causing me issues after reboot your insight would be appreciated.
Thanks Geoff
Re: openvpms-release-1.5-beta-1 archload error
In that case, there is something screwy with your existing schema. If you can send the create statements I can take a look. You can dump these using:
Not sure why you can't log in after reboot. Whats the application error?
Are there errors listed in <TOMCAT_HOME>/bin/openvpms-full.log?
(might be in a different directory, depending on how you start tomcat).
Also, the available users can be found in the 'users' table. Make sure the user you are trying to log in as exists, with the correct password.
-Tim
Re: openvpms-release-1.5-beta-1 archload error
Hi Tim,
I have attached the dump of my existing schema for Openvpms 1.4 which is a duplicate of the production system which to date (cross fingers) has been running without problems. As I mentioned I cant get a duplicate of this setup to upgrade on my vista laptop as it just brings up the login fields again with no error or comment. Users and passwords all appear to be OK.
Also while I can get it setup on a backup XP system by installing 1.5 itself, archloading base 1.5 then dataload 1.5 then restoring copy of the production database (this is much more convoluted than Ive needed to do for previous versions but was only way I could get it up and running.). This runs fine until reboot then I get 'an application error has occurred, your session has been rebooted' no error comment or code when try to log in and the login fields come up again but the same happens each time try to log in?
The log file is also attached. I set it up as a fresh install you can see openvpms logged in ok initially then after reboot at 10.41 it spat the dummy.
Thanks Geoff
Re: openvpms-release-1.5-beta-1 archload error
There's a few minor differences between yours and the 1.5 schema, but I don't think these will cause problems.
If you are restoring a copy of your production database over the top of a 1.5 database, I suspect you are just going to end up with a copy of your original database. The mysqldump command generates SQL statements that drop the existing tables before creating and populating them.
You may need to manually delete your archetypes via SQL. You can do this using:
delete from assertion_descriptors; delete from archetype_descriptors; delete from node_descriptors; delete from action_type_descriptors; delete from assertion_type_descriptors;
You should then be able to run archload to load the 1.5 archetypes.
Normally, the steps woud be:
1. backup database
2. run migrate-1.4-to-1.5.sql
3. run archload
-Tim