我已经坚持了近一个星期,并决定我需要额外的帮助。
我已经将自定义用户/组数据与外部数据库集成,并且工作正常,我的自定义数据库中的所有用户和组都显示在Openfire的管理面板上。问题是当我尝试为任何类型为“group”的用户设置隐私列表时。
示例:
<iq from='romeo@example.net/orchard' type='set' id='msg2'>
<query xmlns='jabber:iq:privacy'>
<list name='message-group-example'>
<item type='group' // IF I use 'jid' here, it works fine. But when I use 'group', it does not.
value='Enemies'
action='deny'
order='4'>
</item>
</list>
</query>
</iq>
我在error.log上收到此错误:
2015.05.05 10:09:19 org.jivesoftware.openfire.group.JDBCGroupProvider - Parameter index out of range (1 > number of parameters, which is 0).
java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1084)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:973)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:918)
at com.mysql.jdbc.PreparedStatement.checkBounds(PreparedStatement.java:3688)
at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:3670)
at com.mysql.jdbc.PreparedStatement.setString(PreparedStatement.java:4491)
at org.jivesoftware.openfire.group.JDBCGroupProvider.getMembers(JDBCGroupProvider. java:177)
at org.jivesoftware.openfire.group.JDBCGroupProvider.getGroup(JDBCGroupProvider.ja va:155)
at org.jivesoftware.openfire.group.GroupManager.getGroup(GroupManager.java:343)
at org.jivesoftware.openfire.group.GroupManager.getGroup(GroupManager.java:320)
at org.jivesoftware.openfire.group.GroupCollection$GroupIterator.getNextElement(Gr oupCollection.java:113)
at org.jivesoftware.openfire.group.GroupCollection$GroupIterator.hasNext(GroupColl ection.java:76)
at org.jivesoftware.openfire.roster.RosterManager.getSharedGroups(RosterManager.ja va:191)
at org.jivesoftware.openfire.roster.Roster.<init>(Roster.java:128)
at org.jivesoftware.openfire.roster.RosterManager.getRoster(RosterManager.java:116 )
at org.jivesoftware.openfire.handler.PresenceUpdateHandler.broadcastUpdate(Presenc eUpdateHandler.java:307)
at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateH andler.java:162)
at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateH andler.java:137)
at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateH andler.java:201)
at org.jivesoftware.openfire.PresenceRouter.handle(PresenceRouter.java:148)
at org.jivesoftware.openfire.PresenceRouter.route(PresenceRouter.java:84)
at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:84)
at org.jivesoftware.openfire.net.StanzaHandler.processPresence(StanzaHandler.java: 348)
at org.jivesoftware.openfire.net.ClientStanzaHandler.processPresence(ClientStanzaH andler.java:100)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:265)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:187)
at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandl er.java:189)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceive d(DefaultIoFilterChain.java:854)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(D efaultIoFilterChain.java:542)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$6(DefaultIoFilterC hain.java:538)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceiv ed(DefaultIoFilterChain.java:943)
at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapte r.java:109)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(D efaultIoFilterChain.java:542)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$6(DefaultIoFilterC hain.java:538)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceiv ed(DefaultIoFilterChain.java:943)
at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flus h(ProtocolCodecFilter.java:405)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:235)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(D efaultIoFilterChain.java:542)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$6(DefaultIoFilterC hain.java:538)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceiv ed(DefaultIoFilterChain.java:943)
at org.apache.mina.filter.ssl.SslHandler.flushScheduledEvents(SslHandler.java:319)
at org.apache.mina.filter.ssl.SslFilter.messageReceived(SslFilter.java:520)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(D efaultIoFilterChain.java:542)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$6(DefaultIoFilterC hain.java:538)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceiv ed(DefaultIoFilterChain.java:943)
at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74)
at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(Ordere dThreadPoolExecutor.java:769)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(Order edThreadPoolExecutor.java:761)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThr eadPoolExecutor.java:703)
at java.lang.Thread.run(Unknown Source)
我尝试直接通过XML节和Openfire'ofprivacylist'数据库表设置隐私列表。我已经清理了所有缓存并在'ofproperty'表上检查了我的SQL语句,但一切看起来都是正确的。我正在使用Openfire 3.10并使用PSI和PSI + XMPP客户端进行测试。
任何想法?
答案 0 :(得分:0)
问题仍然存在,但现在修复了日志消息。它错过了一个&#39;?&#39;在我的自定义dbcGroupProvider.descriptionSQL SQL中。
它是:
SELECT name FROM
(select u.id as uid FROM animati_users u WHERE u.username) as tmp
INNER JOIN
animati_chat_users_groups user_chat_groups
ON
tmp.uid=user_chat_groups.user_id
INNER JOIN
animati_chat_groups cg
ON
cg.id=group_id
现在:
SELECT name FROM
(select u.id as uid FROM animati_users u WHERE u.username = ?)
as tmp
INNER JOIN
animati_chat_users_groups user_chat_groups
ON
tmp.uid=user_chat_groups.user_id
INNER JOIN
animati_chat_groups cg
ON
cg.id=group_id
您可以看到差异在于: WHERE u.username =?