• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[CF8] java.lang.NullPointerException

New Here ,
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

Views

49.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 07, 2010 Jul 07, 2010

Copy link to clipboard

Copied

We finally figured this out on our box.  Turns out that we had set the maxtimeout on the mysql box low for some other applications we have running against it.  So, when we configured the timeout for each datasource to be less than the maxtimeout on the mysql box, all was well. set mysql max timeout = 60 seconds...datasource timeouts at 58 seconds.  obviously, you can configure as you see fit, we figured at the one minute point someone was throwing the keyboard anyway. 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 27, 2010 Sep 27, 2010

Copy link to clipboard

Copied

Hi I am working on an application which requires integration with Twitter. I have used twitter4j api,n when i tried to run the server and client it is giving the following error.  Can you help me get through this.

[Thread-4] INFO  twitter4j.internal.logging.Logger - Will use class

twitter4j.internal.logging.SLF4JLoggerFactory as logging factory.

14:20:48.375 [Thread-4] INFO  t.internal.http.HttpClientFactory - Will use twitt

er4j.internal.http.alternative.HttpClientImpl as HttpClient implementation.

14:20:48.531 [Thread-4] DEBUG twitter4j.http.OAuthAuthorization - OAuth base str

ing: POST&http%3A%2F%2Fapi.twitter.com%2F1%2Fdirect_messages%2Fnew.json&oauth_co

nsumer_key%3D2n2xvpH3gK1gjAawipnDw%26oauth_nonce%3D-385779984%26oauth_signature_

method%3DHMAC-SHA1%26oauth_timestamp%3D1285568448%26oauth_token%3D180266706-lOs2

Jj46bXBTsKJaQiE4XMM0Vj3z6Jslg5UgpEVS%26oauth_version%3D1.0%26screen_name%3Dpifi3

%26text%3Daaa

java.lang.NullPointerException

        at twitter4j.internal.http.BASE64Encoder.encode(BASE64Encoder.java:46)

        at twitter4j.http.OAuthAuthorization.generateSignature(OAuthAuthorizatio

n.java:321)

        at twitter4j.http.OAuthAuthorization.generateAuthorizationHeader(OAuthAu

thorization.java:216)

        at twitter4j.http.OAuthAuthorization.generateAuthorizationHeader(OAuthAu

thorization.java:257)

        at twitter4j.http.OAuthAuthorization.getAuthorizationHeader(OAuthAuthori

zation.java:95)

        at twitter4j.internal.http.alternative.HttpClientImpl.request(HttpClient

Impl.java:166)

        at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.j

ava:72)

        at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java

:103)

        at twitter4j.Twitter.sendDirectMessage(Twitter.java:964)

        at multiverse.org.mxr.qri.server.util.TwitterIntegration1.SendChatMessag

e(TwitterIntegration1.java:55)

        at multiverse.org.mxr.qri.server.service.impl.GiftSendService.process(Gi

ftSendService.java:127)

        at multiverse.org.mxr.qri.server.service.impl.GiftSendService.<init>(Gif

tSendService.java:41)

        at multiverse.org.mxr.qri.server.util.MessageRouter.run(MessageRouter.ja

va:40)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 05, 2010 Oct 05, 2010

Copy link to clipboard

Copied

Shrutipriya-

Please start a new thread - this is not at all related to the topic the others were talking about.

Also, if you haven't gone too far with your solution, I highly recommend using the monkehTweet project to connect to Twitter from ColdFusion. Open source, works great (using it on a project now) and really easy to work with.  http://monkehtweet.riaforge.org/

Steve

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 15, 2011 Apr 15, 2011

Copy link to clipboard

Copied

I am suffering from this same problem.  I am receiving all sorts of random, disturbing errors, and after realizing that all the stacktraces started the same way, I found myself here.

All the errors start like this: java.lang.NullPointerException at com.mysql.jdbc.Statement.setMaxRows(Statement.java:2178)

Is anyone aware of any reliable fix for this??


Thanks,

Brian

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 15, 2011 Apr 15, 2011

Copy link to clipboard

Copied

Have you tried tweaking all the timeout settings (both on the CF and MySQL side) as suggested in any of the prior posts?

Failing that, please provide more information:

* OS/version

* CF version (and any/all updaters and hotfixes applied)

* code snippet

* exact exception/stack information

Or if you don't feel like doing any of that, try a clean re-installation of ColdFusion. I know it sounds dramatic, but sometimes it's the easiest way out.

steve

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 18, 2011 Apr 18, 2011

Copy link to clipboard

Copied

Thank you for the response Steve.  I wasn't able to tweak those settings (being on a shared host), but after I contacted my shared host, they moved my site to a CF9 server and since then I have stopped seeing that issue.  I guess it's only a bug in CF8.

Best,

Brian

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 18, 2011 Apr 18, 2011

Copy link to clipboard

Copied

I've experienced this error after upgrading MySQL from 4 to 5

I've put together this small article on how to temporarily fix it until a hot fix is released from Adobe:

http://www.thebluepipe.com/Developer/tutorials/coldfusion/coldfusion-mysql-5-fix
ing-the-system-has-a...


I hope it helps

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 01, 2012 Feb 01, 2012

Copy link to clipboard

Copied

LATEST

Quite a simple problem, just got to coldfusion administrator, click on the datasource, click on show advanced settings, uncheck maintain connections. and you have banished the problem forever.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation