Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to

Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

Error editing e-mail address

  • on a new installation of 1.12.4 with derby, when I hit the save icon after changing a user e-mail address:

    ERROR 2012-07-10 14:10:55,666 ( - DWR invocation exception 
    org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [update users set   username=?, password=?, email=?, phone=?, admin=?, disabled=?, homeUrl=?, receiveAlarmEmails=?,   receiveOwnAuditEvents=? where id=?]; An attempt was made to get a data value of type 'VARCHAR' from a data value of type 'null'.; nested exception is java.sql.SQLDataException: An attempt was made to get a data value of type 'VARCHAR' from a data value of type 'null'.
    	at org.springframework.jdbc.core.JdbcTemplate.execute(
    	at org.springframework.jdbc.core.JdbcTemplate.update(
    	at org.springframework.jdbc.core.JdbcTemplate.update(
    	at com.serotonin.db.spring.ExtendedJdbcTemplate.update(
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(
    	at org.directwebremoting.impl.DefaultRemoter$1.doFilter(
    	at org.directwebremoting.impl.DefaultRemoter$1.doFilter(
    	at com.serotonin.web.dwr.LocalizationFilter.doFilter(
    	at org.directwebremoting.impl.DefaultRemoter$1.doFilter(
    	at org.directwebremoting.impl.DefaultRemoter$1.doFilter(
    	at org.directwebremoting.impl.DefaultRemoter.execute(
    	at org.directwebremoting.impl.DefaultRemoter.execute(
    	at org.directwebremoting.servlet.PlainCallHandler.handle(
    	at org.directwebremoting.servlet.UrlProcessor.handle(
    	at org.directwebremoting.servlet.DwrServlet.doPost(
    	at javax.servlet.http.HttpServlet.service(
    	at javax.servlet.http.HttpServlet.service(
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    	at org.apache.catalina.core.StandardWrapperValve.invoke(
    	at org.apache.catalina.core.StandardContextValve.invoke(
    	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
    	at org.apache.catalina.core.StandardHostValve.invoke(
    	at org.apache.catalina.valves.ErrorReportValve.invoke(
    	at org.apache.catalina.valves.AccessLogValve.invoke(
    	at org.apache.catalina.core.StandardEngineValve.invoke(
    	at org.apache.catalina.connector.CoyoteAdapter.service(
    	at org.apache.coyote.http11.AbstractHttp11Processor.process(
    	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$ Source)
    	at Source)
    Caused by: java.sql.SQLDataException: An attempt was made to get a data value of type 'VARCHAR' from a data value of type 'null'.
    	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
    	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
    	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
    	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
    	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
    	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
    	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.dataTypeConversion(Unknown Source)
    	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.setObject(Unknown Source)
    	at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(
    	at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(
    	at com.serotonin.db.spring.ArgPreparedStatementSetter.setValues(
    	at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(
    	at org.springframework.jdbc.core.JdbcTemplate.execute(
    	... 44 more
    Caused by: java.sql.SQLException: An attempt was made to get a data value of type 'VARCHAR' from a data value of type 'null'.
    	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
    	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
    	... 57 more

    Does anyone else have this problem?

  • What is your O/S?

  • To answer your question, yes, others have reported this problem, but it was never reproducable. I have added some code to try to protect against it based on information from Derby forums, and some logging in case it still happens. Hopefully, one way or another, this will be dealt with. The changes will be in the next release.

  • the OS is windows 7. It does happen every time.

  • Sorry, by "reproduceable", i meant not reproduceable in a development environment.

  • on my local machine it is reproduceable if you would like me to test any patches

  • Unfortunately, the UserDao class has undergone changes for multiple purposes, so i can't just send you a class file. But if you're feeling ambitious, you could modify the code by changing the updateUser method to that below. I have not tested this in 1.12.4, so ymmv.

        void updateUser(User user) {
            // Potential fix for "An attempt was made to get a data value of type 'VARCHAR' from a data value of type 'null'"
            if (user.getPhone() == null)
            if (user.getHomeUrl() == null)
            try {
                        new Object[] { user.getUsername(), user.getPassword(), user.getEmail(), user.getPhone(),
                                boolToChar(user.isAdmin()), boolToChar(user.isDisabled()), user.getHomeUrl(),
                                user.getReceiveAlarmEmails(), boolToChar(user.isReceiveOwnAuditEvents()),
                                user.getId() }, new int[] { Types.VARCHAR, Types.VARCHAR,
                                Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.INTEGER,
                                Types.VARCHAR, Types.INTEGER });
            catch (DataIntegrityViolationException e) {
                // Log some information about the user object.
                LOG.error("Error updating user: " + user, e);
                throw e;

  • that fixed it. thanks.

  • Awesome. Thanks Craig.

  • Can you make the updated library available for 1.12.4? I'm also having the same error when changing data point permissions on any users.

    Actually I get the error when changing anything on a user.

  • You should consider using Mango Automation.

  • I have attached the patched UserDao classes off of an instance of 1.12.4.
    Good Luck

    @Victorino said:

    Can you make the updated library available for 1.12.4?

    Attachment: download link

  • I had the same problem in mango 1.12.3 and I solved it using the Derby.jar file from mango 1.12.5