Joao Peixoto • almost 11 years ago
Exception starting basic Geode server
I'm trying to create the server component of my project but I'm having a hard time getting it working.
My config is very simple:
gfe:cache />
gfe:cache-server/>
And then: "@ImportResource("classpath:cache-config.xml")"
This works with "org.springframework.data:spring-data-gemfire:1.6.0.RELEASE" but not with "org.springframework.data:spring-data-gemfire:1.7.0.APACHE-GEODE-EA-SNAPSHOT", which I was advised to use.
The latter fails with the exception:
"java.lang.ClassNotFoundException: com.gemstone.gemfire.internal.GemFireVersion"
Am I missing some dependency?
Comments are closed.

8 comments
Joao Peixoto • almost 11 years ago
For the record, if I change that same dependency to https://github.com/spring-projects/spring-gemfire-examples the project won't even compile.
Greg Chase Manager • almost 11 years ago
Hi Joao,
Please post your question to user@geode.incubator.apache.org.
You may need to subscribe first: user-subscribe@geode.incubator.apache.org - send anything in subject and body. It will then email back a verification email which you reply to, and then you are subscribed.
Thanks!
-Greg
Joao Peixoto • almost 11 years ago
Done. Thanks for letting me know!
John Blum • almost 11 years ago
Hi Joao Peixoto-
In short, the dependency you need is "org.apache.geode:gemfire-core:1.0.0-incubating-SNAPSHOT", JAR file.
At first glance, this appeared to be a problem with the SDG 'apache-geode' branch (https://github.com/spring-projects/spring-data-gemfire/tree/apache-geode) and subsequent artifact from (http://repo.spring.io/libs-snapshot/org/springframework/data/spring-data-gemfire/1.7.0.APACHE-GEODE-EA-SNAPSHOT/), possibly due to the latest developments and changes to Apache Geode @ (https://github.com/apache/incubator-geode); more on this tidbit below.
However, I see that the com.gemstone.gemfire.internal.GemFireVersion class you are hitting the ClassNotFoundException on is present in the Apache Geode codebase (https://github.com/apache/incubator-geode/blob/develop/gemfire-core/src/main/java/com/gemstone/gemfire/internal/GemFireVersion.java).
Also, you are correct in using the org.springframework.data:spring-data-gemfire:1.7.0.APACHE-GEODE-EA-SNAPSHOT artifact. It is (or would be) somewhat of anomaly that the SDG 1.6.0.RELEASE artifact works (with Apache Geode artifacts?).
How did you "resolve" the Apache Geode artifacts?
SDG 1.7.0.APACHE-GEODE-EA-SNAPSHOT declares the appropriate dependencies on Apache Geode artifacts (https://github.com/spring-projects/spring-data-gemfire/blob/apache-geode/build.gradle#L78-123) from (https://github.com/spring-projects/spring-data-gemfire/blob/apache-geode/build.gradle#L26) and pulls them in. So, it should be sufficient that your application project Maven POM file, or perhaps build.gradle Gradle-based build file, declares the following dependency...
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-gemfire</artifactId>
<version>1.7.0.APACHE-GEODE-EA-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
That and possibly the following repo declarations...
<repository>
<id>apache-geode-snapshot</id>
<name>Apache Snapshot Repository</name>
<url>https://repository.apache.org/content/repositories/snapshots </url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
<repository>
<id>spring-libs-snapshot</id>
<name>Spring Maven libs-release Repository</name>
<url>https://repo.spring.io/libs-snapshot </url>
</repository>
The following article explains it better... https://spring.io/blog/2015/06/12/spring-data-gemfire-supports-apache-geode#get-started
NOTE: if using Gradle, know that Gradle has some bizarre bug (bug #?) where "repos" are not transitively used to resolve dependencies of dependencies. This is not an issue for Maven.
Today, I moved SDG forward and updated 1.7.0.APACHE-GEODE-EA-SNAPSHOT with the latest Apache Geode developments (https://jira.spring.io/browse/SGF-417). I had no problems building SDG nor running any of the tests; everything ran as expected. Many of the tests in the test suite are even integration tests and start an actual Apache Geode Cache instance. Others use mocks, but can be disabled with the following JVM System property (-Dorg.springframework.data.gemfire.test.GemfireTestRunner.nomock=true).
Anyway, I am confident everything works as expected providing the dependencies are appropriately defined and up-to-date.
Now, it is usual that 1 OS project (e.g. SDG) will depend on another OS project (i.e. Apache Geode) using a "SNAPSHOT" dependency. Unfortunately for SDG, there is no "official" release of Apache Geode yet (not even a Release Candidate or a Milestone release). However, in order to provide "early access" support and garner feedback from the community, I built a version of SDG that works with Apache Geode. Also, equally unfortunate is, Apache Geode is a moving target given it is in "development."
To help alleviate any integration issues involving SDG and Apache Geode compatibility, based on the latest "snapshots", I have just setup a Spring Bambo CI build plan (https://build.spring.io/browse/SGF-NAG) to build SDG with Apache Geode nightly snapshots on a daily basis. Please refer to this SDG-based nightly build plan (https://build.spring.io/browse/SGF-NAG) to assess the current state of SDG and Apache Geode integration when using both in an application development project.
Hope this helps, and... good luck on the Hackathon!
Cheers!
John Blum
Joao Peixoto • almost 11 years ago
Dear John,
Thank you for taking the time to check this out!
I was unaware of the gradle issue. I tried exactly the same code but in a maven project and everything seems to simply work... it seems to be indeed a grade issue.
Joao
Greg Chase Manager • almost 11 years ago
Joao,
Please post your initial email to user@geode as a Jira issue at: https://issues.apache.org/jira/browse/GEODE/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel
We provide points in the hackathon for Jira issues posted as part of the "community contribution" critera.
John Blum • almost 11 years ago
Hi Joao-
Technically, you can get the Gradle-based project to work too, but you need to explicitly list all dependencies' repos (e.g. Apache Geode) in your application build.gradle file by doing...
repositories {
...
maven { url "https://repository.apache.org/content/repositories/snapshots" }
}
Well, at least so I have heard.
Cheers,
John
Greg Chase Manager • almost 11 years ago
Anyone wishing to follow this discussion can find it in the user@Geode archive: http://mail-archives.apache.org/mod_mbox/incubator-geode-user/201507.mbox/%3CCAHUPoL%3D9Pwmk2MjFqPZ7zNGahTuwOgh6SjbC_hhb-t0GTLD5ig%40mail.gmail.com%3E