#31 NullPointerException with Jdk14MLog

closed
nobody
None
5
2007-01-31
2007-01-02
tiger-2214
No

Hi,

This is a message I receive now and then.

java.lang.NullPointerException
at com.mchange.v2.log.jdk14logging.Jdk14MLog$Jdk14MLogger.isLoggable(Jdk14MLog.java:349)
at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1897)
at java.util.TimerThread.mainLoop(Timer.java:432)
at java.util.TimerThread.run(Timer.java:382)

It doesn't block anything but I managed to have no errors in my application and this message is a bit annoying.
I'm using Jonas(4.7.4) to run a struts(1.2.9) application with Hibernate(3.2.0) on a Oracle 9 Database.
The JVM is a 1.4.12.

Those are the property of the hibernate.cfg.xml file

<property name="c3p0.acquire_increment">1</property>
<property name="c3p0.idle_test_period">100</property>
<property name="c3p0.max_size">100</property>
<property name="c3p0.max_statements">0</property>
<property name="c3p0.min_size">10</property>
<property name="c3p0.timeout">100</property>

I don't know if it is a bug or something I configure badly.

Best regards, happy new year and thanks for the good work

Denis

Discussion

  • Steve Waldman

    Steve Waldman - 2007-01-05

    Logged In: YES
    user_id=175530
    Originator: NO

    Denis, this is a strange issue (if you look at the code, it seems the null Object should straightforwardly have been initialized), but I think it's a concurrency/visibility issue. If I'm right, a modification to c3p0-0.9.1-pre12 (released minutes ago) should resolve the issue. Can you give it a shot? Thanks!

     
  • tiger-2214

    tiger-2214 - 2007-01-09

    Logged In: YES
    user_id=1066018
    Originator: YES

    A modification to c3p0-0.9.1-pre12 should resolve the issue.

    Sorry nothing changes still this messages.

    When I debug, the message appears at this line :
    public void run() {
    try {
    mainLoop();
    } finally {
    // Somone killed this Thread, behave as if Timer cancelled
    ---> synchronized(queue) {
    newTasksMayBeScheduled = false;
    queue.clear(); // Eliminate obsolete references
    }
    }
    }

    Regards
    Denis

     
  • tiger-2214

    tiger-2214 - 2007-01-09

    Logged In: YES
    user_id=1066018
    Originator: YES

    in Timer.class (line 385)

     
  • Steve Waldman

    Steve Waldman - 2007-01-10

    Logged In: YES
    user_id=175530
    Originator: NO

    denis,

    curiouser and curiouser.

    your debugging indicates the NPE is provoked in java.util.Timer, but the NPE itself suggests that it occurs in com.mchange.v2.log.jdk14logging.Jdk14MLog$Jdk14MLogger (which makes no use of a timer). i think that what's going on is that the NPE is provoked within a Timer's task, and the finally is only executed when a RuntimeException breaks out of the main loop of the timer, so putting a breakpoint in finally catches the Excption.

    but this brings us no closer to understanding why the NPE is occurring at all.

    i'm going to mail you a slightly revised version of c3p0-0.9.1-pre12, which fixes a bug in jdk14logging that I introduced in part trying to fix your issue. can you give c3p0-0.9.1-pre12a a shot, and let me know if it resolves your issue? thanks!

     
  • tiger-2214

    tiger-2214 - 2007-01-17

    Logged In: YES
    user_id=1066018
    Originator: YES

    Hi

    I tried with tha c3p0-0.9.1-pre12a version and still the same message... :(

    Thanks for the effort but you don't have to lose your time for this message.
    C3P0 is working really well except for this message. So I'll leave it this way.
    I'll use the next version as they will be released.
    Perhaps one of them will correct the bug.

    Once again thanks for the good work

    Denis

     
  • tiger-2214

    tiger-2214 - 2007-01-31
    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks