The search plugin can't work when i use the JDBCUserProvider Database

Hello Everybody,

when i use the my own databases as the user database, it works well but can not search only, it seems that search plugin also find the default database but not the JDBCUserProvider setting value. And when i search in the spark,

the openfire error.log give me an error such as this:

2011.10.16 14:10:05 org.jivesoftware.openfire.user.JDBCUserProvider - Table 'ybu_bbsx15.ofUser' doesn't exist
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'ybu_bbsx15.ofUser' doesn't exist
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
        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.executeQuery(PreparedStatement.java:1467)
        at org.jivesoftware.openfire.user.JDBCUserProvider.findUsers(JDBCUserProvider.java:352)
        at org.jivesoftware.openfire.user.JDBCUserProvider.findUsers(JDBCUserProvider.java:288)
        at org.jivesoftware.openfire.user.UserManager.findUsers(UserManager.java:321)
        at org.jivesoftware.openfire.plugin.SearchPlugin.performSearch(SearchPlugin.java:604)
        at org.jivesoftware.openfire.plugin.SearchPlugin.performSearch(SearchPlugin.java:626)
        at org.jivesoftware.openfire.plugin.SearchPlugin.processSetPacket(SearchPlugin.java:512)
        at org.jivesoftware.openfire.plugin.SearchPlugin.handleSearchRequest(SearchPlugin.java:356)
        at org.jivesoftware.openfire.plugin.SearchPlugin.handleIQRequest(SearchPlugin.java:294)
        at org.jivesoftware.openfire.plugin.SearchPlugin.processPacket(SearchPlugin.java:240)
        at org.jivesoftware.openfire.spi.RoutingTableImpl.routeToComponent(RoutingTableImpl.java:352)
        at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.java:237)
        at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:324)
        at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:121)
        at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:76)
        at org.jivesoftware.openfire.net.StanzaHandler.processIQ(StanzaHandler.java:337)
        at org.jivesoftware.openfire.net.ClientStanzaHandler.processIQ(ClientStanzaHandler.java:93)
        at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:302)
        at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:194)
        at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandler.java:169)
        at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:570)
        at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
        at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
        at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
        at org.apache.mina.common.IoFilterAdapter.messageReceived(IoFilterAdapter.java:80)
        at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
        at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
        at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
        at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:58)
        at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:185)
        at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
        at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
        at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
        at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:239)
        at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:283)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
        at java.lang.Thread.run(Thread.java:662)

how can i deal with this ploblem?

Thank you!

youbaking


Hello Everybody,

I solv this issue , because the JDBCProvider has a code just like" .Ofuser.", and change it to my own user table, and it works OK!

Hello youbaking,

I allso meet the same problem,but i don’t know where to change it.

My error is:

2011.10.18 20:03:02 org.jivesoftware.openfire.user.JDBCUserProvider - 对象名 ‘ofUser’ 无效。

java.sql.SQLException: 对象名 ‘ofUser’ 无效。


The following is my configuration:

org.jivesoftware.openfire.user.JDBCUserProvider

INSERT [ofProperty] ( [name] , [propValue] ) VALUES ( ‘jdbcProvider.connectionString’ , 'jdbc:jtds:sqlserver://localhost/tyschool;user=sa;password=hzyhllp;appName=jive ’ )

INSERT [ofProperty] ( [name] , [propValue] ) VALUES ( ‘jdbcProvider.driver’ , ‘net.sourceforge.jtds.jdbc.Driver’ )

INSERT [ofProperty] ( [name] , [propValue] ) VALUES ( ‘jdbcUserProvider.allUsersSQL’ , ‘SELECT UserName FROM hm_accounts’ )

INSERT [ofProperty] ( [name] , [propValue] ) VALUES ( ‘jdbcUserProvider.emailField’ , ‘accountaddress’ )

INSERT [ofProperty] ( [name] , [propValue] ) VALUES ( ‘jdbcUserProvider.loadUserSQL’ , ‘SELECT Name, accountaddress FROM hm_accounts where UserName = ?’ )

INSERT [ofProperty] ( [name] , [propValue] ) VALUES ( ‘jdbcUserProvider.nameField’ , ‘Name’ )

INSERT [ofProperty] ( [name] , [propValue] ) VALUES ( ‘jdbcUserProvider.searchSQL’ , ‘SELECT UserName from hm_accounts WHERE’ )

INSERT [ofProperty] ( [name] , [propValue] ) VALUES ( ‘jdbcUserProvider.userCountSQL’ , ‘SELECT COUNT(*) FROM hm_accounts’ )

INSERT [ofProperty] ( [name] , [propValue] ) VALUES ( ‘jdbcUserProvider.usernameField’ , ‘UserName’ )

Can you elaborate on how to chanage it?

Thank you.

Hello,

I fixed this bug last night. You can grab the binaries from bamboo.igniterealtime.org for the Openfire nightly builds to try it now.

daryl

Hello I have the same problem with the search plugin

at org.jivesoftware.openfire.plugin.SearchPlugin.performSearch(SearchPlugin.java:6 04)

at org.jivesoftware.openfire.plugin.SearchPlugin.performSearch(SearchPlugin.java:6 26)
at org.jivesoftware.openfire.plugin.SearchPlugin.processSetPacket(SearchPlugin.jav a:512)
at org.jivesoftware.openfire.plugin.SearchPlugin.handleSearchRequest(SearchPlugin. java:356)
at org.jivesoftware.openfire.plugin.SearchPlugin.handleIQRequest(SearchPlugin.java :294)
at org.jivesoftware.openfire.plugin.SearchPlugin.processPacket(SearchPlugin.java:2 40)
at org.jivesoftware.openfire.component.InternalComponentManager$RoutableComponents .process(InternalComponentManager.java:587)
at org.jivesoftware.openfire.spi.RoutingTableImpl.routeToComponent(RoutingTableImp l.java:352)
at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.jav a:237)
at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:324)
at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:121)
at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:76)
at org.jivesoftware.openfire.SessionPacketRouter.route(SessionPacketRouter.java:10 8)
at org.jivesoftware.openfire.SessionPacketRouter.route(SessionPacketRouter.java:69 )
at org.jivesoftware.openfire.http.HttpSession.sendPendingPackets(HttpSession.java: 636)
at org.jivesoftware.openfire.http.HttpSessionManager$HttpPacketSender.run(HttpSess ionManager.java:390)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
2012.02.22 23:52:51 org.jivesoftware.openfire.user.JDBCUserProvider - Table ‘aqua_passion.ofUser’ doesn’t exist
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table ‘aqua_passion.ofUser’ doesn’t exist
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
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.executeQuery(PreparedStatement.java:1467)
at org.jivesoftware.openfire.user.JDBCUserProvider.findUsers(JDBCUserProvider.java :352)
at org.jivesoftware.openfire.user.JDBCUserProvider.findUsers(JDBCUserProvider.java :288)
at org.jivesoftware.openfire.user.UserManager.findUsers(UserManager.java:321)
at org.jivesoftware.openfire.plugin.SearchPlugin.performSearch(SearchPlugin.java:6 04)
at org.jivesoftware.openfire.plugin.SearchPlugin.performSearch(SearchPlugin.java:6 26)
at org.jivesoftware.openfire.plugin.SearchPlugin.processSetPacket(SearchPlugin.jav a:512)
at org.jivesoftware.openfire.plugin.SearchPlugin.handleSearchRequest(SearchPlugin. java:356)
at org.jivesoftware.openfire.plugin.SearchPlugin.handleIQRequest(SearchPlugin.java :294)
at org.jivesoftware.openfire.plugin.SearchPlugin.processPacket(SearchPlugin.java:2 40)
at org.jivesoftware.openfire.component.InternalComponentManager$RoutableComponents .process(InternalComponentManager.java:587)
at org.jivesoftware.openfire.spi.RoutingTableImpl.routeToComponent(RoutingTableImp l.java:352)
at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.jav a:237)
at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:324)
at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:121)
at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:76)
at org.jivesoftware.openfire.SessionPacketRouter.route(SessionPacketRouter.java:10 8)
at org.jivesoftware.openfire.SessionPacketRouter.route(SessionPacketRouter.java:69 )
at org.jivesoftware.openfire.http.HttpSession.sendPendingPackets(HttpSession.java: 636)
at org.jivesoftware.openfire.http.HttpSessionManager$HttpPacketSender.run(HttpSess ionManager.java:390)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

I use custom db for users