0

I have created server function in GemFire and tried to deploy in gfsh, I was getting Exception shown below...

Member  | Deployed JAR | Deployed JAR Location
------- | ------------ | ----------------------------------------------------------------------------
server1 |              | ERROR: java.lang.NoClassDefFoundError: com/gemstone/gemfire/cache/Declarable
server2 |              | ERROR: java.lang.NoClassDefFoundError: com/gemstone/gemfire/cache/Declarable
server3 |              | ERROR: java.lang.NoClassDefFoundError: com/gemstone/gemfire/cache/Declarable
Vigneshwaran
  • 229
  • 1
  • 3
  • 14
  • What version of GemFire are you using? Make sure the Function implementation based the version of GemFire you coded the Function to matches the version in GemFire. Seems your Function implements the `Declarable` interface, which would be necessary for instance if you were "declaring" you Function in cache.xml as well. But I see that the `Declarable` interface referenced in your Function (?) i using the `com.gemstone.gemfire` packaging when in fact GemFire 9 has been rebased on Apache Geode. So `Declarable` is actually in `org.apache.geode.Declarable`... – John Blum Jun 10 '17 at 08:18
  • See here... http://gemfire-90-javadocs.docs.pivotal.io/org/apache/geode/cache/Declarable.html – John Blum Jun 10 '17 at 08:19
  • In other words, if you coded your Function against GemFire 8.x or earlier but are using Pivotal GemFire 9 on the server end, this is not going to work and is the reason why you would be getting a CNFE. – John Blum Jun 10 '17 at 08:20
  • Server version is 9.0.1 and xsd used for servercache.xml is 8.1 – Vigneshwaran Jun 12 '17 at 01:32
  • Right, so see my final answer below... – John Blum Jun 12 '17 at 17:56

1 Answers1

0

The application Function must be coded against the Pivotal GemFire 9.0.x API (http://gemfire-90-javadocs.docs.pivotal.io/) if you are running and deploying Functions to a Pivotal GemFire 9.0.x (i.e. 9.0.1) custer on the server-side.

Specifically, this means your Function needs to implement the org.apache.geode.cache.Declarable interface, particularly when you declare/register your application Function in Pivotal GemFire's cache.xml.

I really don't think the version of the DTD/XSD between Pivotal GemFire 8.x and 9.x matters all that much, but I would generally prefer the 9.x XSD if you are working with Pivotal GemFire 9, FYI.

John Blum
  • 7,381
  • 1
  • 20
  • 30