0
[CF8] java.lang.NullPointerException
New Here
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/td-p/188830
Oct 02, 2007
Oct 02, 2007
Copy link to clipboard
Copied
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:28)
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:28)
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
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:28)
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:28)
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Engaged
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188831#M17022
Oct 02, 2007
Oct 02, 2007
Copy link to clipboard
Copied
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
HTH
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Participant
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188832#M17023
Oct 02, 2007
Oct 02, 2007
Copy link to clipboard
Copied
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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188833#M17024
Oct 03, 2007
Oct 03, 2007
Copy link to clipboard
Copied
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.
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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
yogonaise
AUTHOR
New Here
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188834#M17025
Oct 03, 2007
Oct 03, 2007
Copy link to clipboard
Copied
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!
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!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188835#M17026
Oct 03, 2007
Oct 03, 2007
Copy link to clipboard
Copied
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
> 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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188836#M17027
Oct 17, 2007
Oct 17, 2007
Copy link to clipboard
Copied
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 ?
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 ?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188837#M17028
Oct 17, 2007
Oct 17, 2007
Copy link to clipboard
Copied
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.
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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188838#M17029
Oct 18, 2007
Oct 18, 2007
Copy link to clipboard
Copied
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 ?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188839#M17030
Oct 18, 2007
Oct 18, 2007
Copy link to clipboard
Copied
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).
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188840#M17031
Oct 18, 2007
Oct 18, 2007
Copy link to clipboard
Copied
Let's rule out something. Do you have any JAR file in the
directory /wwwroot/WEB-INF/lib/ whose name starts with
mysql-connector?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188841#M17032
Oct 22, 2007
Oct 22, 2007
Copy link to clipboard
Copied
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.
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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188842#M17033
Mar 26, 2008
Mar 26, 2008
Copy link to clipboard
Copied
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)
java.lang.NullPointerException at com.mysql.jdbc.Statement.setMaxRows(Statement.java:2178)
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188843#M17034
Mar 29, 2008
Mar 29, 2008
Copy link to clipboard
Copied
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.
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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188844#M17035
Apr 07, 2008
Apr 07, 2008
Copy link to clipboard
Copied
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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188845#M17036
Apr 09, 2008
Apr 09, 2008
Copy link to clipboard
Copied
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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188846#M17037
Apr 09, 2008
Apr 09, 2008
Copy link to clipboard
Copied
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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188847#M17038
Apr 09, 2008
Apr 09, 2008
Copy link to clipboard
Copied
@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.
@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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188848#M17039
Apr 09, 2008
Apr 09, 2008
Copy link to clipboard
Copied
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.
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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188849#M17040
Apr 09, 2008
Apr 09, 2008
Copy link to clipboard
Copied
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/Statement.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.
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/Statement.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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188850#M17041
Apr 09, 2008
Apr 09, 2008
Copy link to clipboard
Copied
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.
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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188851#M17042
May 24, 2008
May 24, 2008
Copy link to clipboard
Copied
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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188852#M17043
May 25, 2008
May 25, 2008
Copy link to clipboard
Copied
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.
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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188853#M17044
May 27, 2008
May 27, 2008
Copy link to clipboard
Copied
Thanks ChillyWilly,
Unfortunately that fix didn't work for us....our servers are already using 28800, but we still get the error.
rich
Unfortunately that fix didn't work for us....our servers are already using 28800, but we still get the error.
rich
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Beginner
,
/t5/coldfusion-discussions/cf8-java-lang-nullpointerexception/m-p/188854#M17045
Jun 17, 2008
Jun 17, 2008
Copy link to clipboard
Copied
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)
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)
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

