java - GridException Failed to add no-op logger for Log4j on GridGain startup -


I'm having trouble getting started with Gridgen, I am using XML configuration file which can be used for Gridgen instances (Is there a simple configuration file?) When I thus gridgain I started a found GridException :

  public static void (String [] args) GridException, URISyntaxException {URL throws url = GridgainCache.class. . GetClassLoader () getResource ("gridgain.xml"); String file name = url.toURI (). ToString (); System.out.println ("Reading Gridgnen:" + Filename); Grid G ​​= Gridgen Start (file name); ...}  

Here is the full stack trace:

  Exception in thread "main" category org.gridgain.grid.GridException: failed to add for log logger more information Log4j: troubleshooting: http://bit.ly/GridGain-Troubleshooting documentation center: http://bit.ly/GridGain on org.gridgain.grid.util.GridUtils.addLog4jNoOpLogger -Documentation (GridUtils.java:7709) org.gridgain.grid.kernal.GridGainEx.start (GridGainEx.java:714) on org.gridgain.grid.kernal.GridGainEx.start (GridGainEx.java:659) org.gridgain. At grid.kernal.GridGainEx but on. org.gridgain.grid.kernal.GridGainEx.start (GridGainEx.java:492) start (GridGainEx.java:522) on com.examples.gridgain on org.gridgain.grid.GridGain.start (GridGain.java:314) .GridgainCache.main (GridgainCache.java:102) caused by: java.lang.IllegalArgumentException: sun.reflect.NativeMethodAccessorImpl.invoke on sun.reflect.NativeMethodAccessorImpl.invoke0 (Native method) No argument type matches (NativeMethodAccessorImpl on. java: 57) on Sun.reflect.DellegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) on java.lang.reflect.Method.invoke (org.gridgain.grid.util.GridUtils.addLog4jNoOpLogger (GridUtils.java:7706) .. 6. Method.java:606 on more)  

Do I need to configure log4j? I'm using slf4j

Checks the grid-geen whether there are log4j classes available in the classpath and try to add Log4j Logger automatically goes into error, due to which the Log4j version mismatch in your case.

Since you can not switch to Gridgen supported Log4j v1.2.17, you have to manually configure another logger. I will already use the SLF4j bridge from the Log4j version (note that you will need to add Gridgen-Slaf 4H dependency):

   & Lt; / Property & gt;  

Another option is to use Java logging (no additional dependencies are required)

  & lt; Property Name = "Grid Logger" & gt; & Lt; Bean class = "org.gridgain.grid.logger.java.GridJavaLogger" /> & Lt; / Property & gt;  

Comments