Skip navigation

[CF8] java.lang.NullPointerException

Oct 2, 2007 6:13 AM

  Latest reply: Ultimatorx, Feb 1, 2012 10:13 AM
Replies 1 2 3 Previous Next
  • Currently Being Moderated
    Calculating status...
    Jul 17, 2008 12:25 PM   in reply to Max Donnelly
    I am having this same error
    =================================
    java.lang.NullPointerException at com.mysql.jdbc.Statement.setMaxRows(Statement.java:2178) at coldfusion.server.j2ee.sql.JRunStatement.setMaxRows(JRunStatement.jav a:214) at... etc... etc..
    =================================

    Is there any help on this topic? Adobe? Please?
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 11, 2008 6:15 AM   in reply to Fusecast
    We are having the same issues in our shop. We are running CF 8 on Solaris using Oracle as the database. The error and the inconsistency of the error is exactly how you describe. It started happening immediately after the upgrade.

    Has Adobe provided any guidance on this yet?
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 8, 2008 6:23 PM   in reply to dennis longnecker
    i have the same problem on a daily razor server. every now and then it throws a 500 error for no reason. saying there is a problem with either some system code or programming code.

    then when i refresh its fine :S
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 9, 2008 8:34 AM   in reply to Joshua_Russell
    Hey all,

    The only way I found to solve this problem thus far was to go into the Data Source Menu in the CF Admin and UNCHECK the "Maintain Connections" check box (in the Advanced settings). I know it is said this may cause other issues but I have not see any since I made the change to several virtual host account DSN's. So far it's worked great for me. You'll be the better judge in each of your different circumstances. I hope this helps cause nothing else I've tried to this point has.
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 9, 2008 10:10 AM   in reply to yogonaise
    Same problem for us - detailed description is at (created before I found this thread):

    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1 &catid=7&threadid=1391203&highlight_key=y&keyword1=jdbc%2EStatement%2E setMaxRows

    Unchecking "maintain connections" is not a viable solution for us. We have a very heavy database environment.

    Does anyone else have a solution?

    Has anyone with a support contract reported it to Adobe? What's their answer.
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 9, 2008 11:55 AM   in reply to yogonaise
    I completely understand the frustration. It is a pain and to date I have yet to see a fix or any real help. This issue and an alternative to Dreamweaver (that's not CFEclipse) is what I have been asking Adobe to help CF developers out with for some time. I miss Homesite. ;)
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 9, 2008 12:36 PM   in reply to yogonaise
    Let's follow another strategy. Run the following query on the MySQL database

    show variables;

    What value do you get for wait_timeout and for interactive_timeout ? Each has a default value of 28800, that is, 8 hours, converted into seconds.

    Is either of the values much lower for your MySQL server? If so, increase it or have it increased. You can do so, for example, by adding the line

    wait_timeout=28800

    or the line

    interactive_timeout=28800

    or both to the [mysqld] section of the my.ini configuration file. Restart the MySQL server for the changes to take effect.



     
    |
    Mark as:
  • Currently Being Moderated
    Sep 9, 2008 12:53 PM   in reply to BKBK
    quote:

    What value do you get for wait_timeout and for interactive_timeout ? Each has a default value of 28800, that is, 8 hours, converted into seconds.




    This is a new server using Red Hat, default installation and values - both wait_timeout and internactive_timeout are 100 (not 28800). I'll change these values and do some testing and report back.
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 9, 2008 1:46 PM   in reply to yogonaise

    Maybe Helm uses a newer and|or better driver then ships with ColdFusion!
    Since, while Adobe provides the drivers, they do not write them. Other
    companies write the drivers. (P.S. this is a large reason for the price
    difference between standard and enterprise ColdFusion, the licensee fees
    paid by Adobe to Oracle for the native Oracle driver included in
    Enterprise)

    Adobe nee Macromedia nee Alaire provide documentation on how to
    update|change database drivers anytime it is desirable to do so.
    Especially since a stable ColdFusion server can easily live much longer
    then the lifespan of a driver version.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 9, 2008 2:54 PM   in reply to Newsgroup_User
    quote:

    Originally posted by: Newsgroup User

    Since, while Adobe provides the drivers, they do not write them. Other
    companies write the drivers.



    Newsgroup User - Do you work for Adobe? Hope not, as I hope this is not a common view point with them.

    --- Rant mode ON ----
    Adobe charges $7,500 for this product to run on a single server and says it works with MySQL 4 or 5. We make purchasing decisions based on these claims. We don't care if they write the DB driver or acquire it. It needs to work as advertised and as it did on prior CF releases. The view that "if MySQL access does not work, you can try and find drivers yourself" is B.S. The number of people that have reported this problem and the length of time without Adobe comment/help or intervention is shameful.

    We had planned to open an incident ($500) with Adobe to get a resolution to this but getting a "not our problem - we did not write the driver" response is not something I care to drop $500 on.

    We have 3 licenses of CF Enterprise we have to decide on for a customer in 17 days. Looks like our response will be to not use CF for this client and save the $22,500 . Unfortunately we have quite a few other clients that it will be tougher to migrate off CF.
    --- Rant mode OFF ----

    BKBK - thanks for the suggestion. We will try that and if it works, or not, will report back.
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 9, 2008 3:04 PM   in reply to Newsgroup_User
    FreedomNet wrote:

    > Newsgroup User - Do you work for Adobe? Hope not, as I hope this is not a
    > common view point with them.
    >

    No I do *NOT* work for Adobe, and these Forums are not official adobe
    support, but rather community friends helping friends, so since my help
    is undesired, I'll stop offering it to you.

    If one would still like a suggestion try contacting these folks who do
    work for Adobe, but be warned that this link is a year out of date,
    because that is how long it has been since I have had a need to engage
    Adobe with our $7,499x7 purchase.

    http://www.forta.com/blog/index.cfm/2007/10/9/ColdFusions-Dedicated-Ac count-Managers
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 10, 2008 5:42 AM   in reply to Newsgroup_User
    quote:

    No I do *NOT* work for Adobe, and these Forums are not official adobe
    support, but rather community friends helping friends, so since my help
    is undesired, I'll stop offering it to you.




    Newsgroup User - my apologies. I jumped to the conclusion that you were with Adobe and that this was their "unofficial" position. That got my blood pressure up that there was no shot at a resolution and that we had invested a lot of time and money in something that did not do simple inserts or selects any longer in MySQL. Sorry.
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 12, 2008 7:30 AM   in reply to BKBK
    quote:

    Originally posted by: BKBK
    Let's follow another strategy. Run the following query on the MySQL database

    show variables;

    What value do you get for wait_timeout and for interactive_timeout ? Each has a default value of 28800, that is, 8 hours, converted into seconds.

    Is either of the values much lower for your MySQL server? If so, increase it or have it increased. You can do so, for example, by adding the line

    wait_timeout=28800

    or the line

    interactive_timeout=28800

    or both to the [mysqld] section of the my.ini configuration file. Restart the MySQL server for the changes to take effect.



    BKBK - changing the 2 timeout's above appears to have done the trick for us - THANK YOU SO MUCH! We will keep testing, as it is possible it has not shown up yet since it is an intermittent thing, but I think this will work for us - thanks again!
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 18, 2008 8:13 AM   in reply to FreedomNet
    quote:

    changing the 2 timeout's above appears to have done the trick for us - ...



    Spoke too soon, changing the timeout values does not resolve this issue. Does any one else have a suggestion?
     
    |
    Mark as:
  • Currently Being Moderated
    Oct 19, 2008 1:50 PM   in reply to FreedomNet
    I too am having the same null pointer exception issue. After talking my boss into spending $7K on CF8 Enterprise, I cannot just jump ship to PHP, so I will love to know if there is anything we can about this.

    I have turned off "Maintain Connection across all clients" on my test database connection to see if that will help. But it looks like this issue (from reading the above posts) has something to do with the MySQL 4/5 driver. I seriously hope something can be done about this as I have been thinking it was my code all along.
     
    |
    Mark as:
  • Currently Being Moderated
    Oct 25, 2008 10:32 AM   in reply to wbnc1902
    Sign me up as another casualty of this debilitating error inflicted upon a CF8/MySQL 5.0 user.

    Here it is for all to see again and again and again...


    "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."
     
    |
    Mark as:
  • Currently Being Moderated
    Oct 25, 2008 12:18 PM   in reply to yogonaise
    In my opinion, the best clue to this puzzel so far is that given by Rich.Thibault early on in this thread, namely,

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

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

    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."



     
    |
    Mark as:
  • Currently Being Moderated
    Oct 26, 2008 11:16 AM   in reply to BKBK
    Is there anything that can be done on our end to prevent, reduce this problem? I have, for the moment, had some luck by unchecking " Maintain connections across client requests". However this problem seems to be so random that I am not sure if it has been fixed or I just have not experienced it yet.
     
    |
    Mark as:
  • Currently Being Moderated
    Calculating status...
    Nov 22, 2008 5:36 AM   in reply to wbnc1902
    :smile; My first ever posting so please be patient with me.
    I have had the same problem and this forum has helped greatly, many thanks to all. While I am getting my ISP to change the wait_timeout from 20 secs. I have put in place this fix in the application.cfc file.

    <cftry>
    <CFQUERY NAME="qGlobalStatus"
    DATASOURCE="#application.shopDSN#"
    USERNAME="#application.userName#"
    PASSWORD="#application.shopPass#">

    SELECT fldErrorhandling,
    fldShopOpen
    FROM tglobals;
    </CFQUERY>
    <CFIF qGlobalStatus.fldShopOpen EQ False>
    <CFLOCATION addtoken="no" url="shopClosed.htm">
    </CFIF>
    <!---to prevent page error caused by mysql wait_timeout; set too low.--->
    <cfcatch type="java.lang.NullPointerException">
    <CFLOCATION addtoken="no" url="#CGI.SCRIPT_NAME#?#CGI.QUERY_STRING#">
    </cfcatch>
    </cftry>
     
    |
    Mark as:
  • Currently Being Moderated
    Nov 22, 2008 5:39 AM   in reply to wbnc1902
    :smile; My first ever posting so please be patient with me.
    I have had the same problem and this forum has helped greatly, many thanks to all. While I am getting my ISP to change the wait_timeout from 20 secs. I have put in place this fix in the application.cfc file.


    <cftry>
    <CFQUERY NAME="qGlobalStatus"
    DATASOURCE="#application.shopDSN#"
    USERNAME="#application.userName#"
    PASSWORD="#application.shopPass#">

    SELECT fldErrorhandling,
    fldShopOpen
    FROM tglobals;
    </CFQUERY>

    <!---to prevent page error caused by mysql wait_timeout; set too low.--->
    <cfcatch type="java.lang.NullPointerException">
    <CFLOCATION addtoken="no" url="#CGI.SCRIPT_NAME#?#CGI.QUERY_STRING#">
    </cfcatch>
    </cftry>
    It works well and certainly easier than recoding in php or .net.
     
    |
    Mark as:
  • Currently Being Moderated
    Nov 22, 2008 5:39 AM   in reply to wbnc1902
    :smile; My first ever posting so please be patient with me.
    I have had the same problem and this forum has helped greatly, many thanks to all. While I am getting my ISP to change the wait_timeout from 20 secs. I have put in place this fix in the application.cfc file.


    <cftry>
    <CFQUERY NAME="qGlobalStatus"
    DATASOURCE="#application.shopDSN#"
    USERNAME="#application.userName#"
    PASSWORD="#application.shopPass#">

    SELECT fldErrorhandling,
    fldShopOpen
    FROM tglobals;
    </CFQUERY>

    <!---to prevent page error caused by mysql wait_timeout; set too low.--->
    <cfcatch type="java.lang.NullPointerException">
    <CFLOCATION addtoken="no" url="#CGI.SCRIPT_NAME#?#CGI.QUERY_STRING#">
    </cfcatch>
    </cftry>
    It works well and certainly easier than recoding in php or .net.
     
    |
    Mark as:
  • Currently Being Moderated
    Nov 22, 2008 5:41 AM   in reply to yogonaise
    Sorry about the 3 posts but the forum website is acting strangely. pete
     
    |
    Mark as:
  • Currently Being Moderated
    Nov 22, 2008 5:41 AM   in reply to yogonaise
    Sorry about the 3 posts but the forum website is acting strangely. pete
     
    |
    Mark as:
  • Currently Being Moderated
    Nov 22, 2008 9:25 AM   in reply to yogonaise
    Hello yogonaise,

    Instead of ??????

    > Ofcourse it is acting strangely, it is written in ColdFusion.
    >


     
    |
    Mark as:
  • Currently Being Moderated
    May 27, 2009 12:50 AM   in reply to yogonaise

    I have an idea. Coldfusion 8 has a new setting in the Administrator for MySQL datasources. It is the checkbox field, "Validation query". My idea is that it has something to do with this particular NullPointerException.

     

    To my knowledge, no one yet knows what is responsible for the broken connection. Is it the database driver, the database itself or an external influence such as a firewall? However, we know one thing for sure. When the current connection drops, the driver makes no attempt to get a new connection from the connection pool. That led me to the following hypothesis about how Coldfusion 8 and the MySQL driver work together:

     

    1) if the current connection fails the Validation Query must run

     

    and

     

    2) if the Validation Query fails, no new connection is obtained from the connection pool; instead, an exception is silently thrown.

     

    That could then explain the NullPointerException. By default, the Validation Query field is empty. If, for whatever reason, the database connection is broken then, by my hypothesis, the validation query is run. This fails, for the query is nonexistent. As a result, no new connection is obtained from the connection pool. Instead, an exception is silently thrown.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 16, 2009 7:13 AM   in reply to yogonaise

    Has a solution to this bug been created?  I am receiving the same random error when we upgraded to CF8 from CF7.  Please help...

     

    Server Product  ColdFusion 
    Version  8,0,1,195765   
    Edition  Standard   
    Java Version  1.6.0_04   
    Java Vendor  Sun Microsystems Inc.   
    Java Vendor URL  http://java.sun.com/   
    Java Home  C:\ColdFusion8\runtime\jre   
    Driver  SeeFusion (MySQL5) - mysql-connector-java-commercial-5.0.5-bin.jar, seefusion.jar

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 25, 2010 10:16 AM   in reply to yogonaise

    I wanted to resurrect this old post because I have a client that is seeing this error on a site and he's tried moving it to CF9 and is getting the same error. It does generally occur on the same query, but it's a pretty simply update statement, the only variable in the query is definitely not null (verified in an error dump), the same code runs fine on many other sites without issue. But we are seeing this on a regular basis:

     

    java.lang.NullPointerException at com.mysql.jdbc.Statement.setMaxRows(Statement.java:2178) at coldfusion.sql.Executive.executeQuery(Executive.java:1267) at coldfusion.sql.Executive.executeQuery(Executive.java:1009) at coldfusion.sql.Executive.executeQuery(Executive.java:940) at coldfusion.sql.SqlImpl.execute(SqlImpl.java:325) at coldfusion.tagext.sql.QueryTag.executeQuery(QueryTag.java:838) at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:528)

     

    Has anyone found a solution for this?

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 25, 2010 2:38 PM   in reply to MaryJo

    Oops, small correction. It does appear the setMaxRows issue was indeed corrected in CF9 and we're now getting the underlying error that caused that one to occur on CF8. We haven't yet figured it out yet but does appear to be something that's causing a null exception...I've got enough information on the exact steps that recreate it so should be able to track it down.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 18, 2010 2:32 AM   in reply to MaryJo

    We're suffering from the same issue; unfortunately none of the suggestions in this thread have done anything for us. I have created a detailed explanation of the symptoms in my blog at http://devbox.computec.de/2010/06/coldfusion-8-and-mysql-5-1-via-jdbc- help-needed/. Is there any news or any other suggestions to get CF8 and MySQL 5.1 to play nice?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 7, 2010 8:29 AM   in reply to yogonaise

    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. ;-)

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 27, 2010 1:48 AM   in reply to yogonaise

    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&oa uth_co

    nsumer_key%3D2n2xvpH3gK1gjAawipnDw%26oauth_nonce%3D-385779984%26oauth_ signature_

    method%3DHMAC-SHA1%26oauth_timestamp%3D1285568448%26oauth_token%3D1802 66706-lOs2

    Jj46bXBTsKJaQiE4XMM0Vj3z6Jslg5UgpEVS%26oauth_version%3D1.0%26screen_na me%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)

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 5, 2010 12:19 PM   in reply to Shrutipriya

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 15, 2011 4:00 AM   in reply to yogonaise

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 15, 2011 6:08 AM   in reply to agentfitz3

    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

     
    |
    Mark as:
Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points