I try to use tigase message archiving component with postgre sql, but I get an exception,
2015-01-20 11:58:46.393 [main] JDBCMessageArchiveRepository.initRepository() WARNING: MessageArchiveDB initialization exception
org.postgresql.util.PSQLException: ERROR: there is no unique constraint matching given keys for referenced table "tig_ma_msgs"
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:302)
at tigase.db.jdbc.DataRepositoryImpl.checkTable(DataRepositoryImpl.java:144)
at tigase.db.DataRepositoryPool.checkTable(DataRepositoryPool.java:113)
at tigase.archive.db.JDBCMessageArchiveRepository.initRepository(JDBCMessageArchiveRepository.java:426)
at tigase.archive.MessageArchiveComponent.setProperties(MessageArchiveComponent.java:216)
at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:540)
at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:177)
at tigase.conf.Configurator.componentAdded(Configurator.java:50)
at tigase.conf.Configurator.componentAdded(Configurator.java:33)
at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)
at tigase.server.MessageRouter.addComponent(MessageRouter.java:108)
at tigase.server.MessageRouter.addRouter(MessageRouter.java:145)
at tigase.server.MessageRouter.setProperties(MessageRouter.java:704)
at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:540)
at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:177)
at tigase.conf.Configurator.componentAdded(Configurator.java:50)
at tigase.conf.Configurator.componentAdded(Configurator.java:33)
at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)
at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:131)
at tigase.server.MessageRouter.setConfig(MessageRouter.java:603)
at tigase.server.XMPPServer.start(XMPPServer.java:142)
at tigase.server.XMPPServer.main(XMPPServer.java:112)
Loading component: message-archive :: componentInfo{Title=Tigase Message Archiving Component, Version=1.1.0-SNAPSHOT-b67/001375b1, Class=tigase.archive.MessageArchiveComponent}
As I examined, in postgre sql creation table query for table tig_ma_msgs there isn't any primary key and referencing foreign key to this table, encounter an error. I corrected this bug [just by adding 1 line of adding primary key to this table] and attached the modified file. can it be merged to the mainline?
Thank you for this patch, I included attached patch to Tigase Message Archiving master repository and tomorrows snapshot build should already contain this patch
hi,
I try to use tigase message archiving component with postgre sql, but I get an exception,
As I examined, in postgre sql creation table query for table tig_ma_msgs there isn't any primary key and referencing foreign key to this table, encounter an error. I corrected this bug [just by adding 1 line of adding primary key to this table] and attached the modified file. can it be merged to the mainline?
Thanks
behnam Hatami
JDBCMessageArchiveRepository.java