adequate
adequate
adequate
adequate
 

JPPF
 Home   About   Download   Documentation   Forums 
May 19, 2013, 10:57:38 PM *
Welcome,
Please login or register.

Login with username, password and session length
Advanced search  
News: Registered users, your contribution is requested! Please participate in our JDK support poll
New users, please read this message. Thank you!
  Home Help Search Login Register  
Pages: [1]   Go Down

Author Topic: Integration of the framework  (Read 1925 times)

heller

  • JPPF Padawan
  • *
  • Posts: 1
Integration of the framework
« on: February 14, 2008, 05:58:15 PM »

Hi,

I gave the framework a try and have some issues I would like to discuss. First of all this is really a nice framework, thanks for the submission and all your work.
Now here are my issues:

I built up a sample and everything worked fine if I start the drivers and the nodes in different VMs (non-integrated).

*I tried to integrate the framework into my own code and wanted to start a server (driver) and one node as minimal configuration for my processing engine. The idea was to start additional nodes later.
I tried to start the driver and a node in one VM and failed. The first point is that the configuration file access of driver and node is defined in the same system property (jppf.config). It seems not to be possible to have different logging settings etc for driver and node if they are in the same VM? Is there a way to pass a set of properties directly to the driver or a node without using the config file (e.g. for configs via a GUI?)
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?


*I failed asking a node if it is connected to a driver. All I could do is asking the driver if nodes are connected to it (via the jmx interface). Is there a direct way to start the NodeLauncher and have the feedback if this was successful? I had the problem that starting an integrated node that connects to a driver that doesn't exist results in an endless reconnection attempt after a task has been submitted to it (but not before).

I hope you have some ideas on these points

Thanks for your time
Heller
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 1431
    • JPPF Web site
Integration of the framework
« Reply #1 on: February 15, 2008, 07:00:57 PM »

Hello Heller,

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

Quote
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:

Code: [Select]

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.

Quote
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:
Code: [Select]

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
Logged
Pages: [1]   Go Up
 
Support This Project Powered by SMF 2.0 RC5 | SMF © 2006–2011, Simple Machines LLC Powered by Parallel Matters Get JPPF at SourceForge.net. Fast, secure and Free Open Source software downloads