JPPF Issue Tracker
star_faded.png
Please log in to bookmark issues
bug_report_small.png
CLOSED  Bug report JPPF-166  -  Alternate configuration source incorrectly handled
Posted Jul 10, 2013 - updated Today (06:59)
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
    Core
  • Resolution
    RESOLVED
  • Priority
    Normal
  • Reproducability
    Always
  • Severity
    Normal
  • Targetted for
    icon_milestones.png JPPF 3.3.x
Issue description
When specifying an alternate configuration source via the system property -Djppf.config.plugin=mypackage.MyConfigSource, the specified configuration source is not taken into account by the driver or node.

This is caused by the way we launch the drivers and nodes. In effect, each driver or node is launched as 2 processes, such that the 1st process launches the other and is able to restart it when it terminates with exit code 2. The problem here is that the first process reads the configuration and handles it properly, but, when launching the 2nd process, it does not add the -Djppf.config.plugin= system property to its command line, which means that the real driver/node isn't aware of the alternate configuration source.

A workaround is to have the configuration source implementation add the following: jppf.jvm.options = -Djppf.config.plugin=mypackage.MyConfigSource
Steps to reproduce this issue
  • use the following configuration source implementation:
package test;
import java.io.*;
import org.jppf.utils.JPPFConfiguration.ConfigurationSource;
public class MyConfigurationSource implements ConfigurationSource {
  @Override
  public InputStream getPropertyStream() throws IOException {
    e.printStackTrace(new Exception("getting the configuration source"));
    StringBuilder sb = new StringBuilder();
    sb.append("jppf.server.port = 11111\n");
    sb.append("jppf.management.port = 11198\n");
    sb.append("jppf.discovery.enabled = false\n");
    // ... add other properties ...
    return new ByteArrayInputStream(sb.toString().getBytes());
  }
}
  • in the script that launches the driver add the classpath to this implementation, then launch the driver
  • You will see the following trace:
java.lang.Exception: getting the configuration source
  at test.MyConfigurationSource.getPropertyStream(MyConfigurationSource.java:42)
  at org.jppf.utils.JPPFConfiguration.getConfigurationStream(JPPFConfiguration.java:131)
  at org.jppf.utils.JPPFConfiguration.getStream(JPPFConfiguration.java:114)
  at org.jppf.utils.JPPFConfiguration.loadProperties(JPPFConfiguration.java:92)
  at org.jppf.utils.JPPFConfiguration.getProperties(JPPFConfiguration.java:69)
  at org.jppf.process.ProcessLauncher.run(ProcessLauncher.java:99)
  at org.jppf.server.DriverLauncher.main(DriverLauncher.java:45)
  • we can see that the main class is org.jppf.server.DriverLauncher: this is the class which launches the 2nd process (which is the actual JPPF driver), whose main class is org.jppf.server.JPPFDriver

#3
Comment posted by
 lolo4j
Jul 10, 08:39
Fixed. Changes committed to SVN:

The issue was updated with the following change(s):
  • This issue has been closed
  • The status has been updated, from Confirmed to Closed.
  • This issue's progression has been updated to 100 percent completed.
  • The resolution has been updated, from Not determined to RESOLVED.
  • Information about the user working on this issue has been changed, from lolo4j to Not being worked on.