Hello Heller,
It seems not to be possible to have different logging settings etc for driver and node if they are in the same VM
JPPF is using Apache's commons-logging for its logging, with the underlying logger set to Log4j by default. I don't know if it's possible to use multiple logging configurations within the same JVM, and I suggest you consult the Apache documentation for these frameworks.
On the other hand the node didnt find the driver if driver and node are in the same VM. Is this a known issue or was this my fault?
Here is an example code to start a node and driver in the same JVM:
public class DriverAndNodeLauncher
{
public static void main(final String...args)
{
try
{
Runnable driver = new Runnable()
{
public void run()
{
JPPFDriver.main(new String[] { "noLauncher" });
}
};
Runnable node = new Runnable()
{
public void run()
{
NodeLauncher.main(args);
}
};
new Thread(driver).start();
new Thread(node).start();
}
catch(Throwable t)
{
t.printStackTrace();
}
}
}
You will need to set the property
jppf.management.enabled = false, otherwise you will have a conflict when the driver and node both attempt to initialize an RMI registry with the same namespace (for JMX). So the drawback of having a driver and node in the same JVM is that you can't use the associated management features.
Unfortunately, you will probably face this bug:
1885143 - NPE in node when JMX is disabled, which will be fixed in the next release. This release will be either Monday or Tuesday next week, I hope it is compatible with your timeline.
Is there a direct way to start the NodeLauncher and have the feedback if this was successful?
You can use the code sample above, when successful, the node will print the following to the console:
JPPFClassLoader.init(): attempting connection to the class server
JPPFClassLoader.init(): Reconnected to the class server
PeerNode.init(): Attempting connection to the JPPF driver
PeerNode.init(): Reconnected to the JPPF driver
Let me know if this helps.
Sincerely,
-Laurent