pditommaso
pditommaso

Reputation: 3381

GridGain logging configuration issue

I'm starting to play with GridGain (congratulation to open-source it!)

I'm trying to embedding it in another app, for this reason I need to use JCL logging instead of the Log4j.

My simple piece of code looks like the following (yes, it's groovy code):

    def cfg = new GridConfiguration()
    cfg.setGridLogger( new GridJclLogger() )
    cfg.setLifecycleBeans(new DaemonLifecycleBean())
    def grid = GridGain.start(cfg); 

But I get the exception below. Why it complain about missing Log4j if I configure the JCL logging?

Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/varia/LevelRangeFilter
    at org.gridgain.grid.kernal.GridKernal.createNodeAttributes(GridKernal.java:1187) ~[gridgain-platform-6.0.2.jar:na]
    at org.gridgain.grid.kernal.GridKernal.start(GridKernal.java:608) ~[gridgain-platform-6.0.2.jar:na]
    at org.gridgain.grid.kernal.GridGainEx$GridNamedInstance.start0(GridGainEx.java:1828) ~[gridgain-platform-6.0.2.jar:na]
    ... 21 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.varia.LevelRangeFilter
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_51]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_51]
    at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_51]
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_51]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[na:1.7.0_51]

Upvotes: 0

Views: 265

Answers (1)

Alexey
Alexey

Reputation: 406

Currently GridGain has an explicit dependency to log4j, so you need to keep log4j classes in node classpath.

This dependency will be removed in an upcoming release, then you will be able to run the node with JCL logger without having log4j in classpath.

Upvotes: 1

Related Questions