To initialize log4j, you must ensure that the JVM system variable "log4j.configuration" points to a log4j configuration file that is in your class path.
For instance, if you have a log4.properties
file in your ./config
folder, you must add ./config to your classpath (or make sure it's already there), then add -Dlog4j.configuration=config/log4j.properties
in your Java launch command. You'll find multiple examples of that in the build.xml located in the demo project.
In your example, you need to either make the enclosing class (Main) Serializable, or have the inner class MyLongTask static.
The current problem that you have is that, since your task class is not static, Java will implicitely attach a reference to an enclosing instance of Main. However, since Main is not Serializable, the client will throw a NotSerializableException and try to log it. Unfortunately, log4j cannot find a configuration file and will display the warning messages that you mentioned.
Yes, you need to start one or more nodes to have the tasks executed.
Make sure the nodes' configuration file points to the right host.
You can find more information on how to configure the nodes on our wiki pages, at this place
Let me know how it works out.