NoClassDefFoundError org/h2/server/Service

classic Classic list List threaded Threaded
7 messages Options
murphyRic murphyRic
Reply | Threaded
Open this post in threaded view
|

NoClassDefFoundError org/h2/server/Service

This post has NOT been accepted by the mailing list yet.
Hi,
I tried getting this to work but getting the same error always. Am I missing any thing? I request the experts to help.

Environment:
Windows 7
JDK1.8
Ignite 2
Application: https://github.com/dmagda/IgniteSparkIoT
h2 jar version: "h2-1.4.195.jar"

Error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/h2/server/Service
......
        at org.apache.ignite.iot.SparkStreamerStartup.main(SparkStreamerStartup.java:83)

Thanks
ezhuravlev ezhuravlev
Reply | Threaded
Open this post in threaded view
|

Re: NoClassDefFoundError org/h2/server/Service

Hi,

Please properly subscribe to the mailing list so that the community can receive email notifications for your messages. To subscribe, send empty email to user-subscribe@ignite.apache.org and follow simple instructions in the reply.

This example works for me without problems. Did you change something in it?

Why did you mentioned h2 jar version? Did you add h2 jar to classpath? Why?

Regards,
Evgenii
murphyRic murphyRic
Reply | Threaded
Open this post in threaded view
|

Re: NoClassDefFoundError org/h2/server/Service

Hi,
I subscribed to the mailing list now. Thank you.

I did not change anything related to the project, was just trying to execute as-is.

I wanted to run the IgniteNodeStartup and I get this error.
I mentioned the  h2 jar to let know that the specific version I was using is the latest as suggested in some of the answers to the same kind of error in this forum.
Here are the specific Jar dependencies [ignite-spark 2.0.0  --> ignite-indexing 2.0.0 --> h2 1.4.195] which is being used in the project and so I find h2 in the classpath.

Please let me know if this is something wrong and suggest on how I can correct.

Thanks
ezhuravlev ezhuravlev
Reply | Threaded
Open this post in threaded view
|

Re: NoClassDefFoundError org/h2/server/Service

In reply to this post by murphyRic
Do you run the example in IDE? Most likely it incorrectly resolves transitive dependencies - this exception happens if ignite-indexing.jar is on classpath, but H2 is not.

I'm using Intellij Idea and everything works fine.
murphyRic murphyRic
Reply | Threaded
Open this post in threaded view
|

Re: NoClassDefFoundError org/h2/server/Service- Resolved

After I updated the POM file with the below by excluding the jars, it worked.

 <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-spark</artifactId>
            <version>2.0.0</version>
            <exclusions>
            <exclusion>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-indexing</artifactId>
            </exclusion>
            <exclusion>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            </exclusion>

            </exclusions>
        </dependency>

Thanks
murphyRic murphyRic
Reply | Threaded
Open this post in threaded view
|

Re: NoClassDefFoundError org/h2/server/Service

In reply to this post by ezhuravlev
@ezhuravlev
I know the issue is different but since it is related to the same application and you were able to successfully execute it, so posting it here in this thread. If you like this to be opened fresh in another thread I can do that.

- The SparkStreamerStartup starts with the below logs and stays on forever. From the code it stops at @line-126 in the; url:https://github.com/dmagda/IgniteSparkIoT/blob/master/src/main/java/org/apache/ignite/iot/SparkStreamerStartup.java

- From the ignite-node logs, I see all that were started, 2Nodes and 1 client which is fine.


*********** SparkStreamerStartup log ***********
17/06/14 16:28:04 INFO GridDiscoveryManager: Topology snapshot [ver=40, servers=2, clients=1, CPUs=4, heap=11.0GB]
>>> Spark Streamer is up and running.
>>> Shared RDDs are instantiated.
17/06/14 16:29:04 INFO IgniteKernal:
Metrics for local node (to disable set 'metricsLogFrequency' to 0)
    ^-- Node [id=ad8cc426, name=null, uptime=00:01:00:003]
    ^-- H/N/C [hosts=1, nodes=3, CPUs=4]
    ^-- CPU [cur=0%, avg=1.26%, GC=0%]
    ^-- PageMemory [pages=0]
    ^-- Heap [used=186MB, free=94.84%, comm=373MB]
    ^-- Non heap [used=68MB, free=-1%, comm=69MB]
    ^-- Public thread pool [active=0, idle=0, qSize=0]
    ^-- System thread pool [active=0, idle=1, qSize=0]
    ^-- Outbound messages queue [size=0]
17/06/14 16:29:14 INFO GridUpdateNotifier: Update status is not available.

**********ignite node ***************
[17:06:51] Topology snapshot [ver=46, servers=2, clients=1, CPUs=4, heap=11.0GB]

Thanks a lot for your help.
ezhuravlev ezhuravlev
Reply | Threaded
Open this post in threaded view
|

Re: NoClassDefFoundError org/h2/server/Service

Hi,

SensorDataGenerator doesn't start Ignite node, so you should have only 1 server and 1 client node in topology:

Topology snapshot [ver=2, servers=1, clients=1, CPUs=4, heap=6.8GB]

Check it, most probably you have one more running server node on your host.

Also, your topology version is 46, it's strange, looks like nodes failed and started nearly 20 times.

Evgenii