powered by Jive Software

Openfire 3.8.2 with custom database throwing UnsupportedOperationException

After literally hours of trying to set up Openfire with my own database, I finally got the admin interface to allow the admin user to log in again, but as soon as I do, I’m presented with the following exception:

java.lang.UnsupportedOperationException

at org.jivesoftware.openfire.user.JDBCUserProvider.createUser(JDBCUserProvider.jav a:173)

at org.jivesoftware.openfire.auth.JDBCAuthProvider.createUser(JDBCAuthProvider.jav a:404)

at org.jivesoftware.openfire.auth.JDBCAuthProvider.authenticate(JDBCAuthProvider.j ava:175)

at org.jivesoftware.openfire.auth.AuthFactory.authenticate(AuthFactory.java:176)

at org.jivesoftware.openfire.admin.login_jsp._jspService(login_jsp.java:149)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1359)

at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1330)

at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:74)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1330)

at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingF ilter.java:50)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1330)

at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:78)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1330)

at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:164)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1330)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:478)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)

at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:22 7)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:94 1)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186 )

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875 )

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)

at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandler Collection.java:250)

at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.jav a:149)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)

at org.eclipse.jetty.server.Server.handle(Server.java:349)

at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)

at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.j ava:936)

at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)

at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)

at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51 )

at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.jav a:586)

at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java :44)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598 )

at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)

at java.lang.Thread.run(Thread.java:636)

Kind of makes sense, since it’s not supposed to write to those tables, is it?

However, this does stop me from actually using the server.

As a sidenote, connecting to it using Pidgin with one of the users in my table doesn’t work either; it simply returns ‘Not authorized’.

In case it’s needed, here’s my ofProps table:

"passwordKey","sekrit"
"xmpp.socket.ssl.active","true"
"xmpp.domain","dijkstracomputers.nl"
"provider.admin.className","org.jivesoftware.openfire.admin.DefaultAdminProvider"
"provider.lockout.className","org.jivesoftware.openfire.lockout.DefaultLockOutProvider"
"provider.user.className","org.jivesoftware.openfire.user.JDBCUserProvider"
"provider.auth.className","org.jivesoftware.openfire.auth.JDBCAuthProvider"
"xmpp.auth.anonymous","true"
"provider.group.className","org.jivesoftware.openfire.group.JDBCGroupProvider"
"provider.vcard.className","org.jivesoftware.openfire.vcard.DefaultVCardProvider"
"provider.securityAudit.className","org.jivesoftware.openfire.security.DefaultSecurityAuditProvider"
"xmpp.session.conflict-limit","0"
"update.lastCheck","1377545539182"
"jdbcUserProvider.loadUserSQL","SELECT name,email FROM users WHERE userName=?"
"jdbcUserProvider.userCountSQL","SELECT COUNT(*) FROM users"
"jdbcUserProvider.allUsersSQL","SELECT userName FROM users"
"jdbcUserProvider.searchSQL","SELECT userName FROM users WHERE"
"jdbcUserProvider.usernameField","userName"
"jdbcUserProvider.nameField","fullName"
"jdbcUserProvider.emailField","email"
"jdbcAuthProvider.passwordSQL","SELECT password FROM users WHERE userName = ?"
"jdbcAuthProvider.passwordType","sha1"
"jdbcGroupProvider.groupCountSQL","SELECT COUNT(*) FROM userGroups"
"jdbcGroupProvider.allGroupsSQL","SELECT groupName FROM userGroups"
"jdbcGroupProvider.userGroupsSQL","SELECT `userGroups`.`groupName` FROM `userGroups` INNER JOIN `groupMembership` ON `userGroups`.`groupID` = `groupMembership`.`groupID` INNER JOIN `users` ON `groupMembership`.`userID` = `users`.`userID` WHERE `users`.`userName`=?"
"jdbcGroupProvider.descriptionSQL","SELECT description FROM userGroups WHERE groupName=?"
"jdbcGroupProvider.loadMembersSQL","SELECT `users`.`userName` FROM `users` INNER JOIN `groupMembership` ON `users`.`userID` = `groupMembership`.`userID` INNER JOIN `userGroups` ON `groupMembership`.`groupID` = `userGroups`.`groupID` WHERE `userGroups`.`groupName`=? AND `groupMembership`.`administrator` = 0"
"jdbcGroupProvider.loadAdminsSQL","SELECT `users`.`userName` FROM `users` INNER JOIN `groupMembership` ON `users`.`userID` = `groupMembership`.`userID` INNER JOIN `userGroups` ON `groupMembership`.`groupID` = `userGroups`.`groupID` WHERE `userGroups`.`groupName`=? AND `groupMembership`.`administrator` = 1"
"jdbcProvider.driver","com.mysql.jdbc.Driver"
"jdbcProvider.connectionString","jdbc:mysql://localhost/AMSC?user=AMSC&password=sekrit"
"admin.authorizedJIDs","admin@dijkstracomputers.nl"

Well, this is awkward.

Turns out I had an error in one of the simplest SQL queries.

"jdbcUserProvider.loadUserSQL","SELECT name,email FROM users WHERE userName=?"

That obviously should’ve been ‘SELECT userName,email’.

Hi there, I also had this problem.

I want to set custom user database for my OpenFire

Could you tell me how to set custom user database with openfire 3.8.2.

Did you following this documentation http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/db-integ ration-guide.html ?