postcode setup help

OK followed all directions for windows 7 installation and all seems to be working. When I try the first step in the configuration to set up Australian towns and postcodes I get this screen;

 

C:\openvpms\openvpms-release-1.5.1\bin>dataload.bat ../import/data/postcodes.xml

Unexpected argument: ../import/data/postcodes.xml

Usage: java org.openvpms.tools.data.loader.StaxArchetypeDataLoader
                [(-c|--context) <context>] [(-d|--dir) <dir>] [-s|--subdir] [(-f
|--file) file1,file2,...,fileN ] [-v|--verbose] [--validateOnly] [(-b|--batchSav
eSize) <batchSaveSize>]

  [(-c|--context) <context>]
        Application context for the data loader (default:
        application-context.xml)

  [(-d|--dir) <dir>]
        Directory where data files reside.

  [-s|--subdir]
        Search the subdirectories as well.

  [(-f|--file) file1,file2,...,fileN ]
        Name of file containing data

  [-v|--verbose]
        Displays verbose info to the console.

  [--validateOnly]
        Only validate the data file. Do not process.

  [(-b|--batchSaveSize) <batchSaveSize>]
        The batch size for saving objects. (default: 0)

C:\openvpms\openvpms-release-1.5.1\bin>

 

 

Any suggestions??? Thanks Chris

 

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: postcode setup help

Hi Chris,

 

Please use below command .

dataload.bat -f ../import/data/postcodes.xml

 

Regards,

Harinder

Re: postcode setup help

Hi Harinder. I've had the same problem as Chris with windows 7. I tried your solution but got this error message - any suggestions?

 

thanks

Dave

 

 
C:\openvpms\openvpms-release-1.5.1\bin>dataload.bat -f ../import/data/postcodes.
xml
08:20:54,634  INFO StaxArchetypeDataLoader,main:236 -
[PROCESSING FILE : ..\import\data\postcodes.xml]
 
08:20:54,634 ERROR StaxArchetypeDataLoader,main:203 - java.io.FileNotFoundExcept
ion: ..\import\data\postcodes.xml (The system cannot find the file specified)
java.io.FileNotFoundException: ..\import\data\postcodes.xml (The system cannot f
ind the file specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(Unknown Source)
        at org.openvpms.tools.data.loader.StaxArchetypeDataLoader.getReader(Stax
ArchetypeDataLoader.java:272)
        at org.openvpms.tools.data.loader.StaxArchetypeDataLoader.processFile(St
axArchetypeDataLoader.java:238)
        at org.openvpms.tools.data.loader.StaxArchetypeDataLoader.load(StaxArche
typeDataLoader.java:159)
        at org.openvpms.tools.data.loader.StaxArchetypeDataLoader.main(StaxArche
typeDataLoader.java:197)
C:\openvpms\openvpms-release-1.5.1\bin>

Re: postcode setup help

Dave can you first check the file exists, browse with explorer to

C:\openvpms\openvpms-release-1.5.1\import\data\

Check postcodes.xml is there. Im betting you actually have a file postcodesAU.xml

if so try

dataload -f ../import/data/postcodesAU.xml

 

Re: postcode setup help

Thanks Ben, confirmed that was indeed postcodesAU.xml

so entered this as you suggested

dataload -f ../import/data/postcodesAU.xml

and get a screen that is constantly scrolling through 100miles an hour with the following messages

Any thoughts

thanks

Dave

 

 

 

 

        ... 18 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationExce
ption: Duplicate entry 'lookup.suburb-GOWER_3451' for key 'arch_short_name'
        at sun.reflect.GeneratedConstructorAccessor48.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:3491)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
va:1734)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:2019)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1937)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1922)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Del
egatingPreparedStatement.java:101)
        at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAn
dExtract(IdentityGenerator.java:94)
        at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(Abstr
actReturningDelegate.java:57)
        ... 38 more
19:18:38,018 ERROR DataLoader,main:450 - Failed to save object, archetype=lookup
.suburb from path=..\import\data\postcodesAU.xml, line=12374
org.openvpms.component.business.service.archetype.ArchetypeServiceException: Fai
led to save a collection of 1 objects.
        at org.openvpms.component.business.service.archetype.ArchetypeService.sa
ve(ArchetypeService.java:545)
        at org.openvpms.component.business.service.archetype.ArchetypeService.sa
ve(ArchetypeService.java:513)
        at org.openvpms.tools.data.loader.DataLoader.save(DataLoader.java:531)
        at org.openvpms.tools.data.loader.DataLoader.save(DataLoader.java:446)
        at org.openvpms.tools.data.loader.DataLoader.queue(DataLoader.java:408)
        at org.openvpms.tools.data.loader.DataLoader.load(DataLoader.java:377)
        at org.openvpms.tools.data.loader.DataLoader.load(DataLoader.java:169)
        at org.openvpms.tools.data.loader.StaxArchetypeDataLoader.processFile(St
axArchetypeDataLoader.java:239)
        at org.openvpms.tools.data.loader.StaxArchetypeDataLoader.load(StaxArche
typeDataLoader.java:159)
        at org.openvpms.tools.data.loader.StaxArchetypeDataLoader.main(StaxArche
typeDataLoader.java:197)
Caused by: org.openvpms.component.business.dao.im.common.IMObjectDAOException: F
ailed to save a collection of objects
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.save(IMObjectDAOHibernate.java:191)
        at org.openvpms.component.business.service.archetype.ArchetypeService.sa
ve(ArchetypeService.java:542)
        ... 9 more
Caused by: org.springframework.dao.DataIntegrityViolationException: could not in
sert: [org.openvpms.component.business.dao.hibernate.im.lookup.LookupDOImpl]; SQ
L [insert into lookups (version, linkId, active, arch_short_name, arch_version,
code, name, description, default_lookup) values (?, ?, ?, ?, ?, ?, ?, ?, ?)]; co
nstraint [null]; nested exception is org.hibernate.exception.ConstraintViolation
Exception: could not insert: [org.openvpms.component.business.dao.hibernate.im.l
ookup.LookupDOImpl]
        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:1086)
        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:1082)
        at org.springframework.transaction.support.TransactionTemplate.execute(T
ransactionTemplate.java:130)
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.update(IMObjectDAOHibernate.java:1080)
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.save(IMObjectDAOHibernate.java:183)
        ... 10 more
Caused by: org.hibernate.exception.ConstraintViolationException: could not inser
t: [org.openvpms.component.business.dao.hibernate.im.lookup.LookupDOImpl]
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.j
ava:94)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp
er.java:66)
        at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(Abstr
actReturningDelegate.java:64)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(Abstrac
tEntityPersister.java:2176)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(Abstrac
tEntityPersister.java:2656)
        at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentit
yInsertAction.java:71)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
        at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplic
ate(AbstractSaveEventListener.java:321)
        at org.hibernate.event.def.AbstractSaveEventListener.performSave(Abstrac
tSaveEventListener.java:204)
        at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId
(AbstractSaveEventListener.java:130)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGene
ratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTran
sient(DefaultSaveOrUpdateEventListener.java:195)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveO
rUpdate(DefaultSaveOrUpdateEventListener.java:117)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpda
te(DefaultSaveOrUpdateEventListener.java:93)
        at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:535)
 
        at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:527)
        at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:523)
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.save(IMObjectDAOHibernate.java:991)
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.save(IMObjectDAOHibernate.java:881)
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.save(IMObjectDAOHibernate.java:897)
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.access$100(IMObjectDAOHibernate.java:98)
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
$2.doInHibernate(IMObjectDAOHibernate.java:186)
        at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(Hibern
ateTemplate.java:406)
        ... 18 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationExce
ption: Duplicate entry 'lookup.suburb-GRAHAMVALE_3631' for key 'arch_short_name'
 
        at sun.reflect.GeneratedConstructorAccessor48.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:3491)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
va:1734)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:2019)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1937)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1922)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Del
egatingPreparedStatement.java:101)
        at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAn
dExtract(IdentityGenerator.java:94)
        at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(Abstr
actReturningDelegate.java:57)
        ... 38 more
19:18:38,033 ERROR DataLoader,main:450 - Failed to save object, archetype=lookup
.suburb from path=..\import\data\postcodesAU.xml, line=12375
org.openvpms.component.business.service.archetype.ArchetypeServiceException: Fai
led to save a collection of 1 objects.
        at org.openvpms.component.business.service.archetype.ArchetypeService.sa
ve(ArchetypeService.java:545)
        at org.openvpms.component.business.service.archetype.ArchetypeService.sa
ve(ArchetypeService.java:513)
        at org.openvpms.tools.data.loader.DataLoader.save(DataLoader.java:531)
        at org.openvpms.tools.data.loader.DataLoader.save(DataLoader.java:446)
        at org.openvpms.tools.data.loader.DataLoader.queue(DataLoader.java:408)
        at org.openvpms.tools.data.loader.DataLoader.load(DataLoader.java:377)
        at org.openvpms.tools.data.loader.DataLoader.load(DataLoader.java:169)
        at org.openvpms.tools.data.loader.StaxArchetypeDataLoader.processFile(St
axArchetypeDataLoader.java:239)
        at org.openvpms.tools.data.loader.StaxArchetypeDataLoader.load(StaxArche
typeDataLoader.java:159)
        at org.openvpms.tools.data.loader.StaxArchetypeDataLoader.main(StaxArche
typeDataLoader.java:197)
Caused by: org.openvpms.component.business.dao.im.common.IMObjectDAOException: F
ailed to save a collection of objects
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.save(IMObjectDAOHibernate.java:191)
        at org.openvpms.component.business.service.archetype.ArchetypeService.sa
ve(ArchetypeService.java:542)
        ... 9 more
Caused by: org.springframework.dao.DataIntegrityViolationException: could not in
sert: [org.openvpms.component.business.dao.hibernate.im.lookup.LookupDOImpl]; SQ
L [insert into lookups (version, linkId, active, arch_short_name, arch_version,
code, name, description, default_lookup) values (?, ?, ?, ?, ?, ?, ?, ?, ?)]; co
nstraint [null]; nested exception is org.hibernate.exception.ConstraintViolation
Exception: could not insert: [org.openvpms.component.business.dao.hibernate.im.l
ookup.LookupDOImpl]
        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:1086)
        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:1082)
        at org.springframework.transaction.support.TransactionTemplate.execute(T
ransactionTemplate.java:130)
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.update(IMObjectDAOHibernate.java:1080)
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.save(IMObjectDAOHibernate.java:183)
        ... 10 more
Caused by: org.hibernate.exception.ConstraintViolationException: could not inser
t: [org.openvpms.component.business.dao.hibernate.im.lookup.LookupDOImpl]
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.j
ava:94)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp
er.java:66)
        at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(Abstr
actReturningDelegate.java:64)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(Abstrac
tEntityPersister.java:2176)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(Abstrac
tEntityPersister.java:2656)
        at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentit
yInsertAction.java:71)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
        at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplic
ate(AbstractSaveEventListener.java:321)
        at org.hibernate.event.def.AbstractSaveEventListener.performSave(Abstrac
tSaveEventListener.java:204)
        at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId
(AbstractSaveEventListener.java:130)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGene
ratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTran
sient(DefaultSaveOrUpdateEventListener.java:195)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveO
rUpdate(DefaultSaveOrUpdateEventListener.java:117)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpda
te(DefaultSaveOrUpdateEventListener.java:93)
        at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:535)
 
        at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:527)
        at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:523)
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.save(IMObjectDAOHibernate.java:991)
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.save(IMObjectDAOHibernate.java:881)
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.save(IMObjectDAOHibernate.java:897)
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
.access$100(IMObjectDAOHibernate.java:98)
        at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate
$2.doInHibernate(IMObjectDAOHibernate.java:186)
        at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(Hibern
ateTemplate.java:406)
        ... 18 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationExce
ption: Duplicate entry 'lookup.suburb-GRAMPIANS_3314' for key 'arch_short_name'
        at sun.reflect.GeneratedConstructorAccessor48.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:3491)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
va:1734)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:2019)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1937)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1922)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Del
egatingPreparedStatement.java:101)
        at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAn
dExtract(IdentityGenerator.java:94)
        at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(Abstr
actReturningDelegate.java:57)
        ... 38 more

Re: postcode setup help

Its complaining about duplicate lookups.

You will get those messages if you have run the dataload previously.

-Tim

Re: postcode setup help

Thanks Tim, just checked and you are right the postcodes and suburbs have miraculously apeared in the program?? 

Obviously I just kept trying to run it over and over. What confused me was the fact that I didnt actually ever get a screen that resembled the one in the setup guide section on postcodes.

 

Thanks for your help

 

Dave 

Syndicate content