powered by Jive Software

Database scripts make Email required for user


According to the web admin pages of the server, it looks like that Email is not supposed to be a required field for a user. However, if you try to create a user without entering an Email address, the web page says the creation is successful but in fact the user does not get added to the database. Upon examination of the JIVE_USER database table, I noticed that the EMAIL column has a NOT NULL constraint. Perhaps this NOT NULL constraint should be removed from your database scripts?




This bug is fixed in the latest version of Messenger (1.0.3). Please install that version and give it a try.


Actually, I am using the Jive 1.0.3 server. I downloaded the Windows (without JRE) version. Perhaps it’'s a deployment issue? I can try downloading it again…

Please let me know how that goes. The server version number is displayed in the admin’‘s server properties screen. I’‘ve tried it with 1.0.3 on mysql and the embedded database without failure. I’‘m hoping it’'s not something unique to Oracle…


I checked the server properties and it says it’‘s Jive 1.0.3. Also, it seems like all of the scripts say “not null” beside email column. I haven’'t downloaded it again yet, so I will still do that…

The user code is supposed to detect empty email addresses and insert an empty string into the database rather than leave it a null value. Either this is failing or your database is interpreting an empty string as NULL (which seems unlikely).

After re-downloading and trying 1.0.3 (and assuming it fails) if you’'re willing, could you alter your user table to change the email column to allow NULLs and then try again to see if our code is trying to insert NULLs into the db?

Oh, and are you using the Oracle 9i thin drivers as per the documentation/database.html instructions? We’'ve seen problems with the 8i drivers and fat drivers.


Argghh…it still doesn’‘t work. I downloaded the generic Java installer, and I’'m now using the Oracle 9i drivers, but I still get the same problem. When I try to create a user (without email) in the admin tool, I get:

java.sql.SQLException: ORA-01400: cannot insert NULL into (“JIVESERVER”.“JIVEUSER”.“EMAIL”)

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)

at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)

at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:579)

at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1892)

at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)

at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2130)

at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2013)

at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:28 69)

at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatemen t.java:608)

at com.jivesoftware.xmpp.user.spi.DbUser.insertIntoDb(DbUser.java:752)

at com.jivesoftware.xmpp.user.spi.DbUser.(DbUser.java:131)

at com.jivesoftware.xmpp.user.spi.DbUserManager.createUser(DbUserManager.java:163)

at com.jivesoftware.messenger.admin.user_0002dcreate_jsp._jspService(user_0002dcre ate_jsp.java:154)

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

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

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)

at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler. java:280)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:553)

at org.mortbay.http.HttpContext.handle(HttpContext.java:1717)

at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.ja va:549)

at org.mortbay.http.HttpContext.handle(HttpContext.java:1667)

at org.mortbay.http.HttpServer.service(HttpServer.java:862)

at org.mortbay.http.HttpConnection.service(HttpConnection.java:759)

at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:923)

at org.mortbay.http.HttpConnection.handle(HttpConnection.java:776)

at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:202)

at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)

at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)

I have put the classes.jar into the lib directory so it should be using that jar file.

Just to make sure, you’'re using the classes12.zip oracle drivers correct?


That is correct…

I was talking to somebody, and apparently if you try to insert an empty string into Oracle, it treats it as a NULL, which would lead to the problem I’'m having.

Maybe you can change it so that it inserts " " (one space)?

I suspect you’‘re right. I just talked with our Oracle guru and he agreed with your assesment. We try to avoid nulls in the db so I’'m going to try your single space idea. The fix will be included in the 1.0.4 release. In the meantime, I guess either set the email to be " " or allow NULLs until 1.0.4.

Thanks for helping track this one down!