JPPF Issue Tracker
star_faded.png
Please log in to bookmark issues
bug_report_small.png
CLOSED  Bug report JPPF-568  -  Exceptions shown in the log when JMXDriverConnectionWrapper fails to connect to the driver
Posted Dec 18, 2018 - updated Dec 19, 2018
icon_info.png This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Bug report
  • Status
     
    Closed
  • Assigned to
     lolo4j
  • Progress
       
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     lolo4j
  • Owned by
    Not owned by anyone
  • Category
    Management / Monitoring
  • Resolution
    RESOLVED
  • Priority
    Normal
  • Reproducability
    Always
  • Severity
    Normal
  • Targetted for
    icon_milestones.png JPF 6.0.2
Issue description
When no driver is started, and the log level is set to DEBUG for the package org.jppf.management and trying to connect via JMXDriverConnectionWrapper, the following are shown in the log:
2018-12-18 07:16:44,485 [WARN ][jmx@localhost:11111 ][org.jppf.comm.socket.QueuingSocketInitializer.initialize(68)]: java.lang.InterruptedException
2018-12-18 07:16:44,491 [DEBUG][jmx@localhost:11111 ][org.jppf.management.JMXConnectionThread.run(68)]: localhost:11111 JMX URL = service:jmx:jppf://localhost:11111
java.net.ConnectException: Connection refused: connect
  at sun.nio.ch.Net.connect0(Native Method)
  at sun.nio.ch.Net.connect(Net.java:454)
  at sun.nio.ch.Net.connect(Net.java:446)
  at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:648)
  at org.jppf.comm.socket.SocketChannelClient.open(SocketChannelClient.java:248)
  at org.jppf.comm.socket.SocketInitializerImpl.initialize(SocketInitializerImpl.java:105)
  at org.jppf.comm.socket.QueuingSocketInitializer.access$001(QueuingSocketInitializer.java:31)
  at org.jppf.comm.socket.QueuingSocketInitializer$1.call(QueuingSocketInitializer.java:61)
  at org.jppf.comm.socket.QueuingSocketInitializer$1.call(QueuingSocketInitializer.java:58)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  at java.lang.Thread.run(Thread.java:748)
2018-12-18 07:16:44,491 [DEBUG][alhost:11111 closing][org.jppf.management.JMXConnectionWrapper.run(139)]: 
java.lang.NullPointerException
  at org.jppf.jmxremote.JPPFJMXConnector.close(JPPFJMXConnector.java:140)
  at org.jppf.management.JMXConnectionWrapper$1.run(JMXConnectionWrapper.java:137)
  at java.lang.Thread.run(Thread.java:748)
These exceptions are harmless, as they are indeed caught and handled in the JPPF code, however they may cause some worries:
  • the InterruptedException is logged as a warning. This is wrong, because it is expected when the connection attempts fail after a specified timeout. This should be logged at TRACE level
  • the NullPointerException results from poor handling in the JPPFJMXConnector code, this must be fixed.
Steps to reproduce this issue
Use the following code:
try (JMXDriverConnectionWrapper jmx = new JMXDriverConnectionWrapper("localhost", 11111)) {
  if (jmx.connectAndWait(5_000L)) {
    String[] ids = jmx.getJobManager().getAllJobUuids();
    System.out.println("ids = " + Arrays.toString(ids));
  } else System.out.println("could not connect to localhost:11111");
} catch (Exception e) {
  e.printStackTrace();
}