1 2 3 Previous Next 82 Replies Latest reply: Feb 1, 2012 10:13 AM by Ultimatorx RSS

    [CF8] java.lang.NullPointerException

    yogonaise
      Hello,

      On my CF8 web host, I sometimes get strange java.lang.nullpointerexceptions errors. All my code works flawless since the year 2000. The same pages do work but sometimes, maybe 1 out of 30 try's, the error appears again. First I thought it was a session problem or a problem with Application.cfm. But I stripped those down and it even happens with simple queries. I think it has to do with queries or MySQL 5.

      Has anyone encountered this error? The system says "The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code." But I have all my values defined and it is not a programming error. It is more like a server configuration error I guess.



      The following information is meant for the website developer for debugging purposes.
      Error Occurred While Processing Request
      The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.

      Null Pointers are another name for undefined values.
      500

      ROOT CAUSE:
      java.lang.NullPointerException
      at com.mysql.jdbc.Statement.setMaxRows(Statement.java:2178)
      at coldfusion.server.j2ee.sql.JRunStatement.setMaxRows(JRunStatement.java:214)
      at coldfusion.sql.Executive.executeQuery(Executive.java:1229)
      at coldfusion.sql.Executive.executeQuery(Executive.java:1008)
      at coldfusion.sql.Executive.executeQuery(Executive.java:939)
      at coldfusion.sql.SqlImpl.execute(SqlImpl.java:325)
      at coldfusion.tagext.sql.QueryTag.executeQuery(QueryTag.java:831)
      at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:521)
      at cfhetkoor2ecfm251397670.runPage(E:\westlandkoorconcordia.nl\wwwroot\hetkoor.cfm:1)
      at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:192)
      at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:366)
      at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
      at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:279)
      at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
      at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
      at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
      at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
      at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
      at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
      at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
      at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
      at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
      at coldfusion.CfmServlet.service(CfmServlet.java:175)
      at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
      at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
      at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 )
      at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
      at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
      at jrun.servlet.FilterChain.service(FilterChain.java:101)
      at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
      at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
      at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284)
      at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
      at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
      at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
      at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
      at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
      at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


      javax.servlet.ServletException: ROOT CAUSE:
      java.lang.NullPointerException
      at com.mysql.jdbc.Statement.setMaxRows(Statement.java:2178)
      at coldfusion.server.j2ee.sql.JRunStatement.setMaxRows(JRunStatement.java:214)
      at coldfusion.sql.Executive.executeQuery(Executive.java:1229)
      at coldfusion.sql.Executive.executeQuery(Executive.java:1008)
      at coldfusion.sql.Executive.executeQuery(Executive.java:939)
      at coldfusion.sql.SqlImpl.execute(SqlImpl.java:325)
      at coldfusion.tagext.sql.QueryTag.executeQuery(QueryTag.java:831)
      at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:521)
      at cfhetkoor2ecfm251397670.runPage(E:\westlandkoorconcordia.nl\wwwroot\hetkoor.cfm:1)
      at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:192)
      at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:366)
      at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
      at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:279)
      at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
      at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
      at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
      at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
      at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
      at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
      at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
      at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
      at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
      at coldfusion.CfmServlet.service(CfmServlet.java:175)
      at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
      at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
      at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 )
      at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
      at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
      at jrun.servlet.FilterChain.service(FilterChain.java:101)
      at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
      at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
      at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284)
      at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
      at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
      at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
      at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
      at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
      at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

      at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:70 )
      at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
      at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
      at jrun.servlet.FilterChain.service(FilterChain.java:101)
      at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
      at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
      at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284)
      at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
      at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
      at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
      at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
      at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
      at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
      The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code. Text
        • 1. Re: [CF8] java.lang.NullPointerException
          Stressed_Simon Community Member
          Looks like there might be a database driver issue for MySQL 5 in CF8, I do not use MySQL with CF8 so I cannot really go into it much more than that, but you might want to get the MySQL Connector 3.1.10 which I know works well with CF7 and MySQL 5.

          HTH
          • 2. Re: [CF8] java.lang.NullPointerException
            Dipanwita S Community Member
            Hi,

            Could you please post some sample code that is causing the problem so that we can try reproducing and debugging it at our end? Also, do mention any relevant repro steps.

            Thanks,
            Dipanwita
            • 3. Re: [CF8] java.lang.NullPointerException
              BKBK MVP
              You should not install any drivers in Coldfusion 8 for current versions of MySQL. In fact, the Coldfusion Administrator will warn you if you attempt to configure an additional driver. Coldfusion 8 already has suitable JDBC drivers built in for MySQL 3, 4 and 5. These things usually fit tight. Installing other drivers might tip the balance and cause errors. Did your Admin install an extra driver?

              As the error message says, there could also be a mistake in your code. An error is likely to have occurred in your code or in system code similar to:

              Statement stmt = conn.createStatement();
              stmt.setMaxRows(67);

              Another possible source of a setMaxRows error is the Coldfusion Administrator. Do the datasource settings specify the maxRows? For example, does the Coldfusion Administrator define the connection URL as:

              jdbc:mysql://localhost:3306/myDSN?user=myUsername&password=myPassword&maxRows=200

              Finally, it is just possible that there is a bug in the driver or in Coldfusion's implementation of it.




              • 4. [CF8] java.lang.NullPointerException
                yogonaise Community Member
                After 3 weeks of terror and sleepless nights, I found out the problem.

                I stripped all my code and even on a small page like below the error occured in approx. 1 out of 30 tries. This was my code:

                <cfquery name="getitems" datasource="bla" username="bla" password="bla">
                select * from ordertable
                </cfquery>
                <cfoutput query="getitems">
                #order_id# #order_desc#<br>
                </cfoutput>

                I am using CF8 and MySQL5 on my Windows host. It turned out to be that the ColdFusion DNS's they made for me, were not working properly. But after my webhost installed a new version of the Helm Control Panel, in which I can make my own Coldfusion DSN's, it all worked finally without the random errors like I had before.

                So the problem was the DSN's or something in the communication between (the drivers of) Coldfusion 8 and the (configuration of the) Helm control panel, I guess.

                Thanks all!
                • 5. Re: [CF8] java.lang.NullPointerException
                  Newsgroup_User Community Member
                  yogonaise wrote:
                  > I am using CF8 and MySQL5 on my Windows host. It turned out to be that the
                  > ColdFusion ODBC DNS's they made for me, were not working properly.

                  the question is: why did your host use ODBC to connect to a MySQL
                  database???

                  --

                  Azadi Saryev
                  Sabai-dee.com
                  http://www.sabai-dee.com
                  • 6. Re: [CF8] java.lang.NullPointerException
                    norbertAdobe Community Member
                    I have the same problem here (the same stackdump one out of five requests). The DSN was created using mysql (4/5) driver with default settings. The problem can happen on any kind of request, even the simplest.

                    I solved this issue by making a new DSN (other) with driver class com.mysql.jdbc.Driver. It's only a workaround and I would really like to know what is the difference between the two methods. Maybe the problem is linked to the fact that I previously had a CF7 running on this server, and something happened during the upgrade ?
                    • 7. [CF8] java.lang.NullPointerException
                      BKBK MVP
                      NorbertAdobe wrote:
                      I solved this issue by making a new DSN (other) with driver class com.mysql.jdbc.Driver. It's only a workaround and I would really like to know what is the difference between the two methods. Maybe the problem is linked to the fact that I previously had a CF7 running on this server, and something happened during the upgrade ?

                      It is not a coincidence. MX7 doesn't have built-in Administrator services for the MySQL 5 driver. So it is indeed likely that the upgrade didn't go well.

                      However, I cannot imagine that the issue is critical, as your MySQL 5 driver apparently works without you installing anything extra. The following code will display the list of database drivers. Confirm that MySQL 5 is in the list.

                      • 8. Re: [CF8] java.lang.NullPointerException
                        norbertAdobe Community Member
                        In my previous CF7 installation, I had to manually add the official mysql driver in coldfusion lib path to make mysql5 work. This jar file is not in my current CF8 installation tree. I did list installed drivers (result attached). I see nothing special, both mysql4/5 and mysql3 drivers are present. Is there a way to know which driver is using which DSN ?
                        • 9. Re: [CF8] java.lang.NullPointerException
                          norbertAdobe Community Member
                          update : in fact changing the driver type to "other" didn't solve the issue. I still have the nullpointerexpection at com.mysql.jdbc.Statement.setMaxRows(Statement.java:2178).
                          • 10. Re: [CF8] java.lang.NullPointerException
                            BKBK MVP
                            Let's rule out something. Do you have any JAR file in the directory /wwwroot/WEB-INF/lib/ whose name starts with mysql-connector?


                            • 11. Re: [CF8] java.lang.NullPointerException
                              BKBK MVP
                              java.lang.NullPointerException
                              at com.mysql.jdbc.Statement.setMaxRows(Statement.java:2178)


                              Does indeed look like a bug in Coldfusion 8's built-in MySQL driver, mysql-connector-java-commercial-5.0.5-bin.jar. I have had a look round the web. Sadly, there's not much information about the error. Let's hope someone from Adobe will chime in.

                              • 12. Re: [CF8] java.lang.NullPointerException
                                rich.thibault Community Member
                                Are there any updates on this issue? I get the same error, intermittently, using CF 8 with MySQL 5. Hitting refresh makes it go away, temporarily anyway.

                                java.lang.NullPointerException at com.mysql.jdbc.Statement.setMaxRows(Statement.java:2178)
                                • 13. Re: [CF8] java.lang.NullPointerException
                                  BKBK MVP
                                  java.lang.NullPointerException
                                  at com.mysql.jdbc.Statement.setMaxRows(Statement.java:2178)


                                  I wonder if it could be caused by a temporarily broken connection between Coldfusion and the MySQL database server.

                                  • 14. Re: [CF8] java.lang.NullPointerException
                                    FastmusicJimmy Community Member
                                    I've also been getting this same error. It worked fine on my development machine however when I moved to my live server the error is occurring.

                                    I did some quick research and on my local server my tables were setup as InnoDB and on the live server they were setup as MyISAM. Unfortunately my hosting company only allows MyISAM on their servers so I can't switch back to InnoDB and test. Could this be part of the issue? Any help greatly appreciated!

                                    Thanks
                                    • 15. [CF8] java.lang.NullPointerException
                                      Hi,

                                      It would be great if you could post the sample code and provide us with the details about the environment setup, so that we can try reproducing the issue, since it happens to be an inconsistent issue.

                                      Thanks,
                                      Hareni
                                      Adobe CF Team
                                      • 16. Re: [CF8] java.lang.NullPointerException
                                        FastmusicJimmy Community Member
                                        Hi Hareni,

                                        I believe I finally found a solution. In my advanced settings for the datasource I turn "Maintain connections across client requests" off and it seems to work.

                                        My code is very similar to the code posted in this thread and my error is the same as well. If it will help I'm on CF Standard 8,0,0,176276. Changed the JVM to 1.5.0_15 for faster object creation. Using MySQL 5.0.22.

                                        On the server where my code was working without DB errors I'm using CF Developer 8,0,0,176276 , MySQL 5.0.51a-community-nt and the same JVM.

                                        Thanks,

                                        Jimmy
                                        • 17. Re: [CF8] java.lang.NullPointerException
                                          rich.thibault Community Member
                                          @Jimmy - I would consider that a temporary workaround, but not a solution. With "Maintain connections" unchecked, CF is now creating a new connection with each query. You can imagine the performance degradation on high-traffic sites that will result. The fact that the error manifests after a lull in activity, and that unchecking "Maintain connections" fixes it, would point to a bug in CF's connection pool handling for MySQL.

                                          @Hareni - We are seeing the error in both CF 8 and CF 8.0.1, on both Windows XP and Mac OSX Leopard. We're connecting to MySQL 5.0.22. It could happen on any query, so I don't really have a code sample for you. But it always happens after a pause in activity - if I hit reload over and over, it won't happen, but if I step away for 10 minutes and come back, it probably will.

                                          My datasource settings are all the default settings for MySQL. I tried setting Connection String to autoReconnect=true&autoReconnectForPools=true, but that does not help.
                                          • 18. Re: [CF8] java.lang.NullPointerException
                                            BKBK MVP
                                            I may be on to something. I extracted the MySQL driver c:\coldfusion8\lib\mysql-connector-java-commercial-5.0.5-bin.jar and opened the file Statement.class using a decompiler. The constructor looks like this:

                                            public Statement(com.mysql.jdbc.Connection c, String catalog) throws SQLException
                                            {
                                            cancelTimeoutMutex = new Object();
                                            wasCancelled = false;
                                            charConverter = null;
                                            charEncoding = null;
                                            connection = null;
                                            connectionId = 0L;
                                            currentCatalog = null;
                                            doEscapeProcessing = true;
                                            eventSink = null;
                                            fetchSize = 0;
                                            isClosed = false;
                                            lastInsertId = -1L;
                                            maxFieldSize = MysqlIO.getMaxBuf();
                                            maxRows = -1;
                                            maxRowsChanged = false;
                                            openResults = new ArrayList();
                                            pedantic = false;
                                            profileSQL = false;
                                            results = null;
                                            resultSetConcurrency = 0;
                                            resultSetType = 0;
                                            timeoutInMillis = 0;
                                            updateCount = -1L;
                                            useUsageAdvisor = false;
                                            warningChain = null;
                                            holdResultsOpenOverClose = false;
                                            batchedGeneratedKeys = null;
                                            retrieveGeneratedKeys = false;
                                            continueBatchOnError = false;
                                            if(c == null || c.isClosed())
                                            throw SQLError.createSQLException(Messages.getString("Statement.0"), "08003");
                                            connection = c;
                                            connectionId = connection.getId();
                                            currentCatalog = catalog;
                                            pedantic = connection.getPedantic();
                                            continueBatchOnError = connection.getContinueBatchOnError();
                                            if(!connection.getDontTrackOpenResources())
                                            connection.registerStatement(this);
                                            if(connection != null)
                                            {
                                            maxFieldSize = connection.getMaxAllowedPacket();
                                            int defaultFetchSize = connection.getDefaultFetchSize();
                                            if(defaultFetchSize != 0)
                                            setFetchSize(defaultFetchSize);
                                            }
                                            if(connection.getUseUnicode())
                                            {
                                            charEncoding = connection.getEncoding();
                                            charConverter = connection.getCharsetConverter(charEncoding);
                                            }
                                            boolean profiling = connection.getProfileSql() || connection.getUseUsageAdvisor();
                                            if(connection.getAutoGenerateTestcaseScript() || profiling)
                                            statementId = statementCounter++;
                                            if(profiling)
                                            {
                                            pointOfOrigin = new Throwable();
                                            profileSQL = connection.getProfileSql();
                                            useUsageAdvisor = connection.getUseUsageAdvisor();
                                            eventSink = ProfileEventSink.getInstance(connection);
                                            }
                                            int maxRowsConn = connection.getMaxRows();
                                            if(maxRowsConn != -1)
                                            setMaxRows(maxRowsConn);
                                            0
                                            }

                                            There appears to be an extraneous 0 at the end.


                                            • 19. Re: [CF8] java.lang.NullPointerException
                                              rich.thibault Community Member
                                              Hey BKBK,

                                              I think that's an artifact from your decompiler - MySQL source code doesn't have that 0, and it would prevent compiling anyway:

                                              http://svn.mysql.com/svnpublic/connector-j/tags/5.0.5/connector-j/src/com/mysql/jdbc/State ment.java

                                              But your post got me looking at their source code. The NPE happens at line 2178, which I believe is this line inside setMaxRows():

                                              this.connection.unsetMaxRows(this);

                                              So it looks like CF is invoking setMaxRows() after the connection has already gone dead (null). It should be detecting the dead connection, removing it from the pool, and starting a new one.
                                              • 20. [CF8] java.lang.NullPointerException
                                                BKBK MVP
                                                rich.thibault wrote:
                                                I think that's an artifact from your decompiler

                                                You are right about the decompiler error. It has been confirmed on the same decompiler, but not on two others.(Thanks, Jack).

                                                ...MySQL source code doesn't have that 0, and it would prevent compiling anyway:
                                                I was thinking more of a bug in the binary, Statement.class, in the Coldfusion lib package. I expect the constructor to handle the case where the connection is null.

                                                P.S.: I have received four reactions (three in an hour!) repeating your point about the MySQL source code. To clarify, I thought of a bug in Coldfusion's jar because no other MySQL users are reporting the error. It's as simple as that.








                                                • 21. Re: [CF8] java.lang.NullPointerException
                                                  ChillyWillyReal Community Member
                                                  Any news on this bug?

                                                  Maybe it's in the mysql 5 version or mysql 5 settings. I have 5.0.45-community-nt in production which has the errors and 5.0.51a-3buntu5 in development.

                                                  I found the following differences between the mysql servers (mysql administrator->startup params->advanc network or Mysql administrator->health-server variables->connection)
                                                  Dev box (working):
                                                  Interactive timeout: 28800
                                                  Wait timeout: 28800
                                                  Production (not working):
                                                  Interactive timeout: 30
                                                  Wait timeout: 15
                                                  • 22. Re: [CF8] java.lang.NullPointerException
                                                    ChillyWillyReal Community Member
                                                    Ok, I'm able to reproduce consistently on my devbox. The culprit is the wait timeout. If I set it to 15 seconds I get the error if I wait more then 15 seconds between request. If I set it to something like 21 seconds I get the error precisely after waiting more the 21 seconds between requests.

                                                    The default coldfusion timeout is 1200 seconds. So the solution is to set the mysql wait timeout to something >1200.

                                                    You can change it via the mysql administrator->startup parameters (select mysqld if asked)->tab advanced networking.
                                                    • 23. Re: [CF8] java.lang.NullPointerException
                                                      rich.thibault Community Member
                                                      Thanks ChillyWilly,

                                                      Unfortunately that fix didn't work for us....our servers are already using 28800, but we still get the error.

                                                      rich
                                                      • 24. Re: [CF8] java.lang.NullPointerException
                                                        dennis longnecker Community Member
                                                        Anyone have any insights into this? I am using dailyrazor as my host and am getting the error, exactly as described. Once in a while..refresh works fine...

                                                        java.lang.NullPointerException
                                                        at com.mysql.jdbc.Statement.setMaxRows(Statement.java:2178)
                                                        at coldfusion.server.j2ee.sql.JRunStatement.setMaxRows(JRunStatement.java:214)
                                                        at coldfusion.sql.Executive.executeQuery(Executive.java:1276)
                                                        at coldfusion.sql.Executive.executeQuery(Executive.java:1008)
                                                        at coldfusion.sql.Executive.executeQuery(Executive.java:939)
                                                        at coldfusion.sql.SqlImpl.execute(SqlImpl.java:325)
                                                        at coldfusion.tagext.sql.QueryTag.executeQuery(QueryTag.java:831)
                                                        at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:521)
                                                        • 25. [CF8] java.lang.NullPointerException
                                                          BKBK MVP
                                                          In the settings page in the Coldfusion Administrator for that particular datasource, choose to Show Advanced Settings. In the Connection String field, enter: autoReconnectForPools=true

                                                          Press Submit to register the change. Does it solve the problem?


                                                          • 26. Re: [CF8] java.lang.NullPointerException
                                                            dennis longnecker Community Member
                                                            I already had something in the connection string, so I tried to add another, with a semi-colon in between and am getting:

                                                            zeroDateTimeBehavior=convertToNull;autoReconnectForPools=true

                                                            Warning: gyro4_content: java.sql.SQLException: The connection property 'zeroDateTimeBehavior' only accepts values of the form: 'exception', 'round' or 'convertToNull'. The value 'convertToNull;autoReconnectForPools=true' is not in this set.

                                                            Is a semi-colon not the value for multiple entries?

                                                            If I uncheck this value, it 'solves' the problem, but I was reading about the possible performance issues with it:

                                                            "Maintain connections across client requests"

                                                            • 27. Re: [CF8] java.lang.NullPointerException
                                                              BKBK MVP
                                                              zeroDateTimeBehavior='convertToNull';autoReconnectForPools=true
                                                              • 28. Re: [CF8] java.lang.NullPointerException
                                                                BKBK MVP
                                                                Oh, and ensure "Maintain connections across client requests" is checked.


                                                                • 29. Re: [CF8] java.lang.NullPointerException
                                                                  dennis longnecker Community Member
                                                                  The Plesk control panel still doesn't like that:

                                                                  zeroDateTimeBehavior='convertToNull';autoReconnectForPools=true

                                                                  Warning: gyro4_content: java.sql.SQLException: The connection property 'zeroDateTimeBehavior' only accepts values of the form: 'exception', 'round' or 'convertToNull'. The value ''convertToNull';autoReconnectForPools=true' is not in this set.

                                                                  I'll have to check into whats different about plesk.
                                                                  • 30. Re: [CF8] java.lang.NullPointerException
                                                                    Newsgroup_User Community Member
                                                                    try zeroDateTimeBehavior=convertToNull&autoReconnectForPools=true ?

                                                                    Azadi Saryev
                                                                    Sabai-dee.com
                                                                    http://www.sabai-dee.com/
                                                                    • 31. Re: [CF8] java.lang.NullPointerException
                                                                      rich.thibault Community Member
                                                                      Try an ampersand....I believe these are like URL params:

                                                                      zeroDateTimeBehavior=convertToNull&autoReconnectForPools=true
                                                                      • 32. Re: [CF8] java.lang.NullPointerException
                                                                        BKBK MVP
                                                                        .. if it still complains, then slap it with

                                                                        autoReconnectForPools=true;zeroDateTimeBehavior=convertToNull
                                                                        or
                                                                        autoReconnectForPools=true&zeroDateTimeBehavior=convertToNull
                                                                        • 33. Re: [CF8] java.lang.NullPointerException
                                                                          dennis longnecker Community Member
                                                                          DOesn't accept the first format..same error message as before. When I try the second one, my code bombs because of the null date issue, so it is not converting it to null.
                                                                          • 34. Re: [CF8] java.lang.NullPointerException
                                                                            BKBK MVP
                                                                            Do you mean that

                                                                            zeroDateTimeBehavior=convertToNull

                                                                            and

                                                                            autoReconnectForPools=true

                                                                            work, but

                                                                            autoReconnectForPools=true&zeroDateTimeBehavior=convertToNull

                                                                            fails?


                                                                            • 35. Re: [CF8] java.lang.NullPointerException
                                                                              dennis longnecker Community Member
                                                                              zeroDateTimeBehavior=convertToNull fixes a error with zerodate's, but I have the connection issue.

                                                                              autoReconnectForPools=true fixes the connection problem, but I have the zerodate issue.

                                                                              autoReconnectForPools=true&zeroDateTimeBehavior=convertToNull I have both the connection isse and the zerodate problem. Its like its not doing either...but then it doesn't complain about it as a value either.

                                                                              • 36. Re: [CF8] java.lang.NullPointerException
                                                                                BKBK MVP
                                                                                Quite odd. What if you apply no connection string in the administrator, but do the following instead.

                                                                                Open the file {CF_installation_dir}/lib/neo-datasource.xml in a text editor. (Make a back-up). Locate the URL(s) which correspond to the datasources to which you want to apply the connection string.

                                                                                Suppose one such URL is

                                                                                jdbc:mysql://127.0.0.1:3306/my_orders?

                                                                                Modify the line to

                                                                                jdbc:mysql://127.0.0.1:3306/my_orders?autoReconnectForPools=true&zeroDateTimeBehavior=conv ertToNull

                                                                                Restart Coldfusion.


                                                                                • 37. Re: [CF8] java.lang.NullPointerException
                                                                                  drjamiii Community Member
                                                                                  Previously, I was using ColdFusion 6.1 and I'm sure an older version of mySQL. I transferred hosting to dailyrazor with ColdFusion 8 as my host and am getting the error:

                                                                                  quote:

                                                                                  The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.

                                                                                  Null Pointers are another name for undefined values.
                                                                                  500

                                                                                  ROOT CAUSE:
                                                                                  java.lang.NullPointerException



                                                                                  When I refresh the page the error goes away for a while. Then it comes back after a while. It happens on all sorts of pages and it never happened before I migrated the site to the new host.

                                                                                  quote:

                                                                                  Originally posted by: dennis longnecker
                                                                                  Anyone have any insights into this? I am using dailyrazor as my host and am getting the error, exactly as described. Once in a while..refresh works fine...

                                                                                  java.lang.NullPointerException
                                                                                  at com.mysql.jdbc.Statement.setMaxRows(Statement.java:2178)
                                                                                  at coldfusion.server.j2ee.sql.JRunStatement.setMaxRows(JRunStatement.java:214)
                                                                                  at coldfusion.sql.Executive.executeQuery(Executive.java:1276)
                                                                                  at coldfusion.sql.Executive.executeQuery(Executive.java:1008)
                                                                                  at coldfusion.sql.Executive.executeQuery(Executive.java:939)
                                                                                  at coldfusion.sql.SqlImpl.execute(SqlImpl.java:325)
                                                                                  at coldfusion.tagext.sql.QueryTag.executeQuery(QueryTag.java:831)
                                                                                  at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:521)



                                                                                  • 38. Re: [CF8] java.lang.NullPointerException
                                                                                    Max Donnelly Community Member
                                                                                    We are experiencing the same issue on Crystaltech shared ColdFusion hosting. From reviews of the Crystaltech forum, this issue seems to have cropped up since the upgrade to CF8.1? This is a serious issue. It is crippling for sites with heavy data input capabilities, because the error forces the user to re-enter all the information from the submitting page. I've created a workaround cftry/cfcatch, but this only works effectively for display pages. Any form submission page which generates the error loses all the form data. Unacceptable.

                                                                                    Adobe? Hello? Help us out here.
                                                                                    • 39. [CF8] java.lang.NullPointerException
                                                                                      yogonaise Community Member
                                                                                      Well, I have decided to stop with ColdFusion. Always troubles. Isn't it for these errors, then there is trouble with the hosting company's (control panel) or finding the right hosting company.

                                                                                      The developing with CF time may be lower, but errors like these and setup of the DB and environment at the hoster take much longer. Probably the latter is the hosters fault, but with my host (who uses Helm and CF8) I always have to beg them to make CF8 things for me, like DSN's and Sandbox security, because I cannot do it myself in the control panel. And even then, I will get strange errors like the null exception error. Also, CF hangs many more times then ASP and PHP on the same servers (at my Host).

                                                                                      Not anymore. I have switched to PHP.

                                                                                      Goodbye all!
                                                                                      1 2 3 Previous Next