Monitoring plugin 1.4.0 error with OFMESSAGEARCHIVE.body type


I am upgrading from Openfire 3.7.1 to 3.9.1 and I’m having an issue with the Monitoring plugin. I found 2 other posts in the forum with this issue, but neither has a resolution that will work for me. I could not find any bugs in the issue tracker.

I am using a Oracle database. When I start up the server, I get the following error in the error.log:

2014.03.28 13:55:30 org.jivesoftware.util.Log - Error selecting conversations

java.sql.SQLException: ORA-00997: illegal use of LONG datatype

at oracle.jdbc.driver.DatabaseError.throwSqlException(

at oracle.jdbc.driver.T4CTTIoer.processError(

at oracle.jdbc.driver.T4CTTIoer.processError(

at oracle.jdbc.driver.T4C8Oall.receive(

at oracle.jdbc.driver.T4CPreparedStatement.doOall8(

at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(

at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(

at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(

at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(

at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(

at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(

at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(

at java.lang.reflect.Method.invoke(

at org.logicalcobwebs.proxool.ProxyStatement.invoke(

at org.logicalcobwebs.proxool.ProxyStatement.intercept(

at oracle.jdbc.internal.OraclePreparedStatement$$EnhancerByProxool$$f83cbf9a.executeQuery()

at com.reucon.openfire.plugin.archive.impl.JdbcPersistenceManager.getActiveConversations(

at com.reucon.openfire.plugin.archive.impl.ArchiveManagerImpl.(

at org.jivesoftware.openfire.plugin.MonitoringPlugin.initializePlugin(

at org.jivesoftware.openfire.container.PluginManager.loadPlugin(

at org.jivesoftware.openfire.container.PluginManager.access$300(

at org.jivesoftware.openfire.container.PluginManager$

at java.util.concurrent.Executors$

at java.util.concurrent.FutureTask$Sync.innerRunAndReset(

at java.util.concurrent.FutureTask.runAndReset(

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(

at java.util.concurrent.ScheduledThreadPoolExecutor$

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(

at java.util.concurrent.ThreadPoolExecutor$



The LONG datatype has been deprecated by Oracle, CLOB or NCLOB should be used to replace it. However, that’s not the real issue. The real issue is that you cannot do SELECT DISTINCT on a field of type LONG or CLOB. There are several queiries in JdbcPersistenceManager that use SELECT DISTINCT, and they include the LONG body field.

One of the forum posts I found suggested changing the datatype to varchar2(4000), but my DBA is reporting that some of the rows in the production database are longer than 4000 characters.

Has anyone else encountered this issue and found a solution? Otherwise, can anyone provide any guideance on why these queries need DISTINCT, then maybe I can implement a workaround in the queries. This is fairly new to me so I don’t know much about the capabilities of this plugin.

I was not able to solve this. However, I did determine that these incorrect queries are only used by the Archiving portion of the plugin. Since I’m only using the Montitoring portion I have moved on without a solution.