gridgain / gridgain-old

267 stars 85 forks source link

java.lang.ClassNotFoundException: org.h2.constant.SysProperties on GridGain.start(); #89

Closed dzlab closed 10 years ago

dzlab commented 10 years ago

I'm trying to get started with GridGain, but I'm having a strange ClassNotFoundException when calling Grid g = GridGain.start();. Here is full stack trace:

oct. 22, 2014 5:52:04 PM org.gridgain.grid.logger.java.GridJavaLogger error
SEVERE: Got exception while starting (will rollback startup routine).
java.lang.NoClassDefFoundError: org/h2/constant/SysProperties
    at org.gridgain.grid.spi.indexing.h2.GridH2IndexingSpi.spiStart(GridH2IndexingSpi.java:1370)
    at org.gridgain.grid.kernal.managers.GridManagerAdapter.startSpi(GridManagerAdapter.java:221)
    at org.gridgain.grid.kernal.managers.indexing.GridIndexingManager.start(GridIndexingManager.java:124)
    at org.gridgain.grid.kernal.GridKernal.startManager(GridKernal.java:1556)
    at org.gridgain.grid.kernal.GridKernal.start(GridKernal.java:712)
    at org.gridgain.grid.kernal.GridGainEx$GridNamedInstance.start0(GridGainEx.java:1937)
    at org.gridgain.grid.kernal.GridGainEx$GridNamedInstance.start(GridGainEx.java:1271)
    at org.gridgain.grid.kernal.GridGainEx.start0(GridGainEx.java:814)
    at org.gridgain.grid.kernal.GridGainEx.start(GridGainEx.java:440)
    at org.gridgain.grid.kernal.GridGainEx.start(GridGainEx.java:416)
    at org.gridgain.grid.GridGain.start(GridGain.java:281)
    at com.heavenize.core.cache.gridgain.GridgainGlobalCache.main(GridgainGlobalCache.java:91)
Caused by: java.lang.ClassNotFoundException: org.h2.constant.SysProperties
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 12 more

What I'm missing?

dsetrakyan commented 10 years ago

I think you are missing a dependency on GridGain indexing functionality:

...
<dependency>
            <groupId>org.gridgain</groupId>
            <artifactId>gridgain-indexing</artifactId>
            <version>${gridgain.version}</version>
</dependency>
...
dzlab commented 10 years ago

Thanks for the quick reply, I've added this to my pom but still having the same problem!


      <dependency>
        <groupId>org.gridgain</groupId>
        <artifactId>gridgain-fabric</artifactId>
        <version>${gridgain.version}</version>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.gridgain</groupId>
        <artifactId>gridgain-indexing</artifactId>
        <version>${gridgain.version}</version>
      </dependency>
dsetrakyan commented 10 years ago

Can you put 6.5.0 instead of ${gridgain.version}?

By the way, the gridgain-fabric dependency already includes indexing, so no need to add it explicitly.

dzlab commented 10 years ago

No way, same problem, but may be there is a conflict as in my pom I'm referencing com.h2database:h2:1.4.182.

svladykin commented 10 years ago

We don't support H2 1.4.182 the only supported version is 1.3.175

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.3.175</version>
        </dependency>
dsetrakyan commented 10 years ago

H2 dependency is only needed if you plan to execute SQL queries in GridGain. If you don't, then you can just have dependency on gridgain-core and, maybe, gridgain-spring.

dzlab commented 10 years ago

Many thanks, now by referencing gridgain-core I don't see the exception.