Feb 1, 2012 3:44 PM
PubSubPersistenceManager - Duplicate entry
-
Like (0)
This error message starting popping up in my logs - Openfire 3.7.1 on linux - any suggestions as to whats going on? Thanks!
2012.02.01 16:38:42 org.jivesoftware.openfire.pubsub.PubSubPersistenceManager - Duplicate entry 'username@jabber.example.edu-urn:xmpp:avatar:data-03529a59976dac3af8d' for key 1
com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry 'username@jabber.example.edu-urn:xmpp:avatar:data-03529a59976dac3af8d' for key 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100)
at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57)
at $java.sql.Statement$$EnhancerByProxool$$14e4cbf6.executeUpdate(<generated>)
at org.jivesoftware.openfire.pubsub.PubSubPersistenceManager.createPublishedItem(P ubSubPersistenceManager.java:1015)
at org.jivesoftware.openfire.pubsub.PublishedItemTask.run(PublishedItemTask.java:8 6)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
It looks like you are using custom item id's that are too long. The db has a 100 char limit on that field in the database (I ran into the same problem before).
You have two possible fixes,
The second is pretty trivial and doesn't force you to rewrite client code.
Please be aware, that this can have unwanted side effects, as you can get matches to persisted items even though the id's are different (originally) but will match when the truncated version is pulled from the database. For example:
Obvously id's with long common prefixes can cause this potential issue.
any idea what table in the DB?
ofPubsubItem
Please mark answers as correct or helpful if they help you solve your problem to help others searching these forums.
Thank you.