Hello-
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(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216) at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:799) at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1037) at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:839) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3316) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3361) at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100) at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57) at oracle.jdbc.internal.OraclePreparedStatement$$EnhancerByProxool$$f83cbf9a.executeQuery(<generated>) at com.reucon.openfire.plugin.archive.impl.JdbcPersistenceManager.getActiveConversations(JdbcPersistenceManager.java:342) at com.reucon.openfire.plugin.archive.impl.ArchiveManagerImpl.<init>(ArchiveManagerImpl.java:35) at org.jivesoftware.openfire.plugin.MonitoringPlugin.initializePlugin(MonitoringPlugin.java:154) at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java:483) at org.jivesoftware.openfire.container.PluginManager.access$300(PluginManager.java:80) at org.jivesoftware.openfire.container.PluginManager$PluginMonitor.run(PluginManager.java:1073) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662)
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.