You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geode.apache.org by Gábor Kendelényi <ga...@ericsson.com> on 2020/09/08 08:03:34 UTC

Geode REST API - Question

Hi Geode Team/Users,

I need your help figuring out why the Apache Geode Java Client is behaving the way it does.
Overall my task is simple. I just need to connect to a Geode server running in a small Kubernetes test cluster via a Spring Boot application.

Geode Server
On the Geode side I have enabled the REST API by setting the "-Dgemfire.start-dev-rest-api" property true.
It's working properly.
bash-4.4# curl -i -X GET http://localhost:7070/gemfire-api/v1
HTTP/1.1 200 OK
Date: Mon, 07 Sep 2020 12:39:43 GMT
Location: http://localhost:7070/gemfire-api/v1

Spring Boot App
On the App side I'm using the below annotations in order I could do the region creation part through the client:
@ClientCacheApplication(useHttp=true)
@EnableClusterConfiguration
@EnableEntityDefinedRegions


Problem
When I check the application log during start app I can see that the client is trying to use a slightly different URL for the RegionCreation POST request:
org.springframework.context.ApplicationContextException: Failed to start bean 'gemfireClusterSchemaObjectInitializer'; nested exception is org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: [HTTP ERROR 404 Not Found
URI: /gemfire/v1/regions
STATUS: 404
MESSAGE: Not Found
SERVLET: null
]


So instead of "/gemfire-api/v1" or "/geode/v1" it's trying to access the "/gemfire/v1" url.

Could you help me figure out why is that? Is this a bug?

Regards, Gábor

Re: Geode REST API - Question

Posted by Udo Kohlmeyer <ud...@vmware.com>.
Thank you for that Jens… I was looking, but must have missed it.

@Gabor, for your reference, https://github.com/apache/geode/blob/develop/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java#L227

I will close the opened JIRA. As there must be another issue here of misconfiguration.

—Udo
On Sep 8, 2020, 11:57 PM +1000, Jens Deppe <jd...@vmware.com>, wrote:
Hi Gábor

I’m not sure that you are hitting a bug with incorrect URLs here.

Geode has a couple of REST APIs.

One is a Developer REST API which you have enabled with the gemfire.start-dev-rest-api option (endpoint is: /gemfire-api/v1 or /geode/v1 – they are equivalent). Another is an internal Admin REST API which is used by gfsh when run over HTTP (endpoint is: /gemfire/v1 or /geode-mgmt/v1). It’s this internal API that SDG uses when you use @EnableClusterConfiguration with useHttp=true. This endpoint is automatically enabled on the locator when you start a cluster.

Something to note is that both of these REST APIs will run on the same port (7070) by default. If you’re wanting all the Geode components (servers and locators) to run on localhost you need to pick different ports for each REST endpoint.

Can you try your app without the gemfire.start-dev-rest-api option? Without this, the Developer REST API endpoint will not start (on port 7070). But SDG should be able to do what it needs to in terms of region creation. Remember also that SDG needs to communicate with the locator in your cluster.

I’m not very familiar with Kubernetes so all of the ports may well be completely isolated within their own containers, but you may still have some problem of port masking here.

--Jens

From: Gábor Kendelényi <ga...@ericsson.com>
Reply-To: "user@geode.apache.org" <us...@geode.apache.org>
Date: Tuesday, September 8, 2020 at 1:03 AM
To: "user@geode.apache.org" <us...@geode.apache.org>
Subject: Geode REST API - Question

Hi Geode Team/Users,

I need your help figuring out why the Apache Geode Java Client is behaving the way it does.
Overall my task is simple. I just need to connect to a Geode server running in a small Kubernetes test cluster via a Spring Boot application.

Geode Server
On the Geode side I have enabled the REST API by setting the “-Dgemfire.start-dev-rest-api” property true.
It’s working properly.
bash-4.4# curl -i -X GET http://localhost:7070/gemfire-api/v1
HTTP/1.1 200 OK
Date: Mon, 07 Sep 2020 12:39:43 GMT
Location: http://localhost:7070/gemfire-api/v1

Spring Boot App
On the App side I’m using the below annotations in order I could do the region creation part through the client:
@ClientCacheApplication(useHttp=true)
@EnableClusterConfiguration
@EnableEntityDefinedRegions


Problem
When I check the application log during start app I can see that the client is trying to use a slightly different URL for the RegionCreation POST request:
org.springframework.context.ApplicationContextException: Failed to start bean 'gemfireClusterSchemaObjectInitializer'; nested exception is org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: [HTTP ERROR 404 Not Found
URI: /gemfire/v1/regions
STATUS: 404
MESSAGE: Not Found
SERVLET: null
]


So instead of “/gemfire-api/v1” or “/geode/v1” it’s trying to access the “/gemfire/v1” url.

Could you help me figure out why is that? Is this a bug?

Regards, Gábor

Re: Geode REST API - Question

Posted by John Martin <ma...@vmware.com>.
Hi Gabor,

I have another question about the Kubernetes setup you’re using.  Are you running the Geode pods and Spring Boot application Pods in the same cluster?

How are the pods connected?  Through a Node or LoadBalancer service?

Thanks,

John

From: Jens Deppe <jd...@vmware.com>
Reply-To: "user@geode.apache.org" <us...@geode.apache.org>
Date: Tuesday, September 8, 2020 at 9:57 AM
To: "user@geode.apache.org" <us...@geode.apache.org>
Subject: Re: Geode REST API - Question

Hi Gábor

I’m not sure that you are hitting a bug with incorrect URLs here.

Geode has a couple of REST APIs.

One is a Developer REST API which you have enabled with the gemfire.start-dev-rest-api option (endpoint is: /gemfire-api/v1 or /geode/v1 – they are equivalent). Another is an internal Admin REST API which is used by gfsh when run over HTTP (endpoint is: /gemfire/v1 or /geode-mgmt/v1). It’s this internal API that SDG uses when you use @EnableClusterConfiguration with useHttp=true. This endpoint is automatically enabled on the locator when you start a cluster.

Something to note is that both of these REST APIs will run on the same port (7070) by default. If you’re wanting all the Geode components (servers and locators) to run on localhost you need to pick different ports for each REST endpoint.

Can you try your app without the gemfire.start-dev-rest-api option? Without this, the Developer REST API endpoint will not start (on port 7070). But SDG should be able to do what it needs to in terms of region creation. Remember also that SDG needs to communicate with the locator in your cluster.

I’m not very familiar with Kubernetes so all of the ports may well be completely isolated within their own containers, but you may still have some problem of port masking here.

--Jens

From: Gábor Kendelényi <ga...@ericsson.com>
Reply-To: "user@geode.apache.org" <us...@geode.apache.org>
Date: Tuesday, September 8, 2020 at 1:03 AM
To: "user@geode.apache.org" <us...@geode.apache.org>
Subject: Geode REST API - Question

Hi Geode Team/Users,

I need your help figuring out why the Apache Geode Java Client is behaving the way it does.
Overall my task is simple. I just need to connect to a Geode server running in a small Kubernetes test cluster via a Spring Boot application.

Geode Server
On the Geode side I have enabled the REST API by setting the “-Dgemfire.start-dev-rest-api” property true.
It’s working properly.
bash-4.4# curl -i -X GET http://localhost:7070/gemfire-api/v1
HTTP/1.1 200 OK
Date: Mon, 07 Sep 2020 12:39:43 GMT
Location: http://localhost:7070/gemfire-api/v1

Spring Boot App
On the App side I’m using the below annotations in order I could do the region creation part through the client:
@ClientCacheApplication(useHttp=true)
@EnableClusterConfiguration
@EnableEntityDefinedRegions


Problem
When I check the application log during start app I can see that the client is trying to use a slightly different URL for the RegionCreation POST request:
org.springframework.context.ApplicationContextException: Failed to start bean 'gemfireClusterSchemaObjectInitializer'; nested exception is org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: [HTTP ERROR 404 Not Found
URI: /gemfire/v1/regions
STATUS: 404
MESSAGE: Not Found
SERVLET: null
]


So instead of “/gemfire-api/v1” or “/geode/v1” it’s trying to access the “/gemfire/v1” url.

Could you help me figure out why is that? Is this a bug?

Regards, Gábor

Re: Geode REST API - Question

Posted by Jens Deppe <jd...@vmware.com>.
Hi Gábor

I’m not sure that you are hitting a bug with incorrect URLs here.

Geode has a couple of REST APIs.

One is a Developer REST API which you have enabled with the gemfire.start-dev-rest-api option (endpoint is: /gemfire-api/v1 or /geode/v1 – they are equivalent). Another is an internal Admin REST API which is used by gfsh when run over HTTP (endpoint is: /gemfire/v1 or /geode-mgmt/v1). It’s this internal API that SDG uses when you use @EnableClusterConfiguration with useHttp=true. This endpoint is automatically enabled on the locator when you start a cluster.

Something to note is that both of these REST APIs will run on the same port (7070) by default. If you’re wanting all the Geode components (servers and locators) to run on localhost you need to pick different ports for each REST endpoint.

Can you try your app without the gemfire.start-dev-rest-api option? Without this, the Developer REST API endpoint will not start (on port 7070). But SDG should be able to do what it needs to in terms of region creation. Remember also that SDG needs to communicate with the locator in your cluster.

I’m not very familiar with Kubernetes so all of the ports may well be completely isolated within their own containers, but you may still have some problem of port masking here.

--Jens

From: Gábor Kendelényi <ga...@ericsson.com>
Reply-To: "user@geode.apache.org" <us...@geode.apache.org>
Date: Tuesday, September 8, 2020 at 1:03 AM
To: "user@geode.apache.org" <us...@geode.apache.org>
Subject: Geode REST API - Question

Hi Geode Team/Users,

I need your help figuring out why the Apache Geode Java Client is behaving the way it does.
Overall my task is simple. I just need to connect to a Geode server running in a small Kubernetes test cluster via a Spring Boot application.

Geode Server
On the Geode side I have enabled the REST API by setting the “-Dgemfire.start-dev-rest-api” property true.
It’s working properly.
bash-4.4# curl -i -X GET http://localhost:7070/gemfire-api/v1
HTTP/1.1 200 OK
Date: Mon, 07 Sep 2020 12:39:43 GMT
Location: http://localhost:7070/gemfire-api/v1

Spring Boot App
On the App side I’m using the below annotations in order I could do the region creation part through the client:
@ClientCacheApplication(useHttp=true)
@EnableClusterConfiguration
@EnableEntityDefinedRegions


Problem
When I check the application log during start app I can see that the client is trying to use a slightly different URL for the RegionCreation POST request:
org.springframework.context.ApplicationContextException: Failed to start bean 'gemfireClusterSchemaObjectInitializer'; nested exception is org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: [HTTP ERROR 404 Not Found
URI: /gemfire/v1/regions
STATUS: 404
MESSAGE: Not Found
SERVLET: null
]


So instead of “/gemfire-api/v1” or “/geode/v1” it’s trying to access the “/gemfire/v1” url.

Could you help me figure out why is that? Is this a bug?

Regards, Gábor

RE: Geode REST API - Question

Posted by Udo Kohlmeyer <ud...@vmware.com>.
Hi there Gabor,

Spring Data Geode is a Spring Data managed project. Apache Geode has no control over the release cycles of the Spring eco-system. The best we can do is, to submit PR’s for them to possibly accept.

After that, Apache Geode will wait for the next release cycle of Spring projects.

—Udo
On Sep 8, 2020, 8:14 PM +1000, user@geode.apache.org <us...@geode.apache.org>, wrote:

https://github.com/spring-projects/spring-data-geode/blob/master/spring-data-geode/src/main/java/org/springframework/data/gemfire/config/admin/remote/RestHttpGemfireAdminTemplate.java#L94<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fspring-projects%2Fspring-data-geode%2Fblob%2Fmaster%2Fspring-data-geode%2Fsrc%2Fmain%2Fjava%2Forg%2Fspringframework%2Fdata%2Fgemfire%2Fconfig%2Fadmin%2Fremote%2FRestHttpGemfireAdminTemplate.java%23L94&data=02%7C01%7Cudo%40vmware.com%7C9b9b52cb816f44a7127108d853dc7983%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637351553678294422&sdata=XcnBC46jOLQNZtjsnBpT3PNkF0yDPlwAR7NH3XBTZlc%3D&reserved=0>

RE: Geode REST API - Question

Posted by Gábor Kendelényi <ga...@ericsson.com>.
Hi Udo,

I’m sad to here that but also happy to see that it’s not that hard to fix.
Usually how long does it take to get a fix out?

Thanks for taking the time to investigate it!

/// Gábor

From: Udo Kohlmeyer <ud...@vmware.com>
Sent: Tuesday, September 8, 2020 11:49 AM
To: user@geode.apache.org
Subject: RE: Geode REST API - Question

Hi there Gabor,

It seems that you might have hit a bug.
In https://github.com/spring-projects/spring-data-geode/blob/master/spring-data-geode/src/main/java/org/springframework/data/gemfire/config/admin/remote/RestHttpGemfireAdminTemplate.java#L94<https://protect2.fireeye.com/v1/url?k=3f4a38ba-61ea9677-3f4a7821-86073b36ea28-f1d2ccee56957c73&q=1&e=e4064585-c0b8-431d-b4e3-8def575b6d4b&u=https%3A%2F%2Fgithub.com%2Fspring-projects%2Fspring-data-geode%2Fblob%2Fmaster%2Fspring-data-geode%2Fsrc%2Fmain%2Fjava%2Forg%2Fspringframework%2Fdata%2Fgemfire%2Fconfig%2Fadmin%2Fremote%2FRestHttpGemfireAdminTemplate.java%23L94>

It specifically looks for the ‘GemFire’ url. Not sure if / why this issue would have slipped through.

I’ve raise https://jira.spring.io/browse/DATAGEODE-366 to track this.

—Udo
On Sep 8, 2020, 7:00 PM +1000, user@geode.apache.org<ma...@geode.apache.org> <us...@geode.apache.org>>, wrote:


-Dgemfire.start-dev-rest-api

RE: Geode REST API - Question

Posted by Udo Kohlmeyer <ud...@vmware.com>.
Hi there Gabor,

It seems that you might have hit a bug.
In https://github.com/spring-projects/spring-data-geode/blob/master/spring-data-geode/src/main/java/org/springframework/data/gemfire/config/admin/remote/RestHttpGemfireAdminTemplate.java#L94

It specifically looks for the ‘GemFire’ url. Not sure if / why this issue would have slipped through.

I’ve raise https://jira.spring.io/browse/DATAGEODE-366 to track this.

—Udo
On Sep 8, 2020, 7:00 PM +1000, user@geode.apache.org <us...@geode.apache.org>, wrote:

-Dgemfire.start-dev-rest-api

RE: Geode REST API - Question

Posted by Udo Kohlmeyer <ud...@vmware.com>.
Hi there Gabor,

Yes, the selected versions are correct.

I’m just creating my own example to double check if / where the error could be occurring.

—Udo
On Sep 8, 2020, 6:57 PM +1000, Gábor Kendelényi <ga...@ericsson.com>, wrote:
I checked the matrix and based ont that the components should be compatible with each other:
SBDG
Latest
Spring Boot
SDG
SSDG
STDG
Spring Framework
Apache Geode
Pivotal GemFire
1.3.x
1.3.3.RELEASE
2.3.3.RELEASE<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fspring-projects%2Fspring-boot-data-geode%2Fblob%2F1.3.3.RELEASE%2Fgradle.properties%23L11&data=02%7C01%7Cudo%40vmware.com%7Cbb29eac8c35c485b271108d853d53764%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637351522573905961&sdata=0aq6OkYl8dAp6lMs8WS8WbZDmwWbF3ny8dcfZhmX6k4%3D&reserved=0>
2.3.3.RELEASE<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fspring-projects%2Fspring-boot-data-geode%2Fblob%2F1.3.3.RELEASE%2Fgradle.properties%23L13&data=02%7C01%7Cudo%40vmware.com%7Cbb29eac8c35c485b271108d853d53764%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637351522573915959&sdata=iMsBuE1vI5NybnjPdcF8zB%2FhYQNY9BRIlK%2F84mOMTVQ%3D&reserved=0>
2.3.0.RELEASE<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fspring-projects%2Fspring-boot-data-geode%2Fblob%2F1.3.3.RELEASE%2Fgradle.properties%23L17&data=02%7C01%7Cudo%40vmware.com%7Cbb29eac8c35c485b271108d853d53764%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637351522573915959&sdata=CDkEz9bMSO6Pk%2FFYGH9aqBPRqFkT%2FnlLvCD7dFzsgDA%3D&reserved=0>
0.0.18.RELEASE<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fspring-projects%2Fspring-boot-data-geode%2Fblob%2F1.3.3.RELEASE%2Fgradle.properties%23L14&data=02%7C01%7Cudo%40vmware.com%7Cbb29eac8c35c485b271108d853d53764%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637351522573925950&sdata=wUF4BoUX3PK2Id2wjhtubU%2F5ntMXZQDbvD5lIwVLg34%3D&reserved=0>
5.2.8.RELEASE<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fspring-projects%2Fspring-boot-data-geode%2Fblob%2F1.3.3.RELEASE%2Fgradle.properties%23L10&data=02%7C01%7Cudo%40vmware.com%7Cbb29eac8c35c485b271108d853d53764%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637351522573935946&sdata=ss%2F%2Bh52p%2FkPnAJg3YCDS1KNkjqg2vptFPXeZTvfBB8U%3D&reserved=0>
1.12.0<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fspring-projects%2Fspring-boot-data-geode%2Fblob%2F1.3.3.RELEASE%2Fgradle.properties%23L3&data=02%7C01%7Cudo%40vmware.com%7Cbb29eac8c35c485b271108d853d53764%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637351522573935946&sdata=FjnYbg%2BOwWRyrLvl7m6D2ZTZ5TR56ro0OZwIpJhmlOs%3D&reserved=0>
9.10.2<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fspring-projects%2Fspring-boot-data-geode%2Fblob%2F1.3.3.RELEASE%2Fgradle.properties%23L9&data=02%7C01%7Cudo%40vmware.com%7Cbb29eac8c35c485b271108d853d53764%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637351522573945941&sdata=yQw6u9%2B9XwAj8F%2Bpmm%2Br4BjFY9Wl7q0aZ%2BNC3fcwpgU%3D&reserved=0>

From: Gábor Kendelényi
Sent: Tuesday, September 8, 2020 10:25 AM
To: user@geode.apache.org
Subject: RE: Geode REST API - Question

You are right It’s my mistake I was trying to simplify my code for the mail and I put the useHttp to the wrong annotation:
    @EnableGemfireRepositories(basePackages = "com.ericsson.eea.privacy.dao")
    @EnableEntityDefinedRegions(basePackages = "com.ericsson.eea.privacy.entity")
    @EnablePdx
    @EnableIndexing
    @ClientCacheApplication(locators = { @ClientCacheApplication.Locator(host = "eric-data-kvdb-ag-locator", port = 10334) }, logLevel = "debug")
    @EnableClusterConfiguration(
            useHttp=true,
            host="eric-data-kvdb-ag-server",
            port=7070,
            requireHttps=false
    )

Lib: 'org.springframework.geode:spring-geode-starter:1.3.3.RELEASE'
Server: Product-Version: 1.12.0.9-NORDIX.202008170838

From: Udo Kohlmeyer <ud...@vmware.com>>
Sent: Tuesday, September 8, 2020 10:20 AM
To: user@geode.apache.org<ma...@geode.apache.org>
Subject: Re: Geode REST API - Question

Hi there Gabor,

I’ve done some digging.. And I really don’t know what version of SBDG or SDG you are using in your client.

In none of the supported versions is there any support for
`ClientCacheApplication(useHttp=true)`

Maybe you are looking for:

`EnableClusterConfiguration(useHttp=true)`

And in case you want to opt-out of using HTTPS

`EnableClusterConfiguration(useHttp=true, requireHttps=false)`

Please let me know what versions of the libraries you are using, so that we can try and help you further.

—Udo
On Sep 8, 2020, 6:08 PM +1000, Udo Kohlmeyer <ud...@vmware.com>>, wrote:
Hi there Gabor.

Can you please elaborate on versions of Geode and Spring Boot Data Geode are you using.

You can confirm if you are using compatible versions here. https://github.com/spring-projects/spring-boot-data-geode/wiki/Spring-Boot-for-Apache-Geode-and-Pivotal-GemFire-Version-Compatibility-Matrix<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fprotect2.fireeye.com%2Fv1%2Furl%3Fk%3D8bdcd0ff-d56c4d65-8bdc9064-867b36d1634c-e7df90ff1c0652f3%26q%3D1%26e%3D30d4a48f-50ea-4de6-8a21-b9b72218bea2%26u%3Dhttps%253A%252F%252Fnam04.safelinks.protection.outlook.com%252F%253Furl%253Dhttps%25253A%25252F%25252Fgithub.com%25252Fspring-projects%25252Fspring-boot-data-geode%25252Fwiki%25252FSpring-Boot-for-Apache-Geode-and-Pivotal-GemFire-Version-Compatibility-Matrix%2526data%253D02%25257C01%25257Cudo%252540vmware.com%25257Cf8577a04f2d9453a173008d853ce57f2%25257Cb39138ca3cee4b4aa4d6cd83d9dd62f0%25257C0%25257C0%25257C637351492990187660%2526sdata%253DsI%25252B8DyDkwN18q9tDp9NKW3%25252FhIpPEcE3GQHM0TxYsQoc%25253D%2526reserved%253D0&data=02%7C01%7Cudo%40vmware.com%7Cbb29eac8c35c485b271108d853d53764%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637351522573945941&sdata=%2FXfMkNiA8albVBzveTwD7Qn59nicaf%2BJQ7b7XB6%2BwT8%3D&reserved=0>

—Udo
On Sep 8, 2020, 6:03 PM +1000, Gábor Kendelényi <ga...@ericsson.com>>, wrote:
Hi Geode Team/Users,

I need your help figuring out why the Apache Geode Java Client is behaving the way it does.
Overall my task is simple. I just need to connect to a Geode server running in a small Kubernetes test cluster via a Spring Boot application.

Geode Server
On the Geode side I have enabled the REST API by setting the “-Dgemfire.start-dev-rest-api” property true.
It’s working properly.
bash-4.4# curl -i -X GET http://localhost:7070/gemfire-api/v1
HTTP/1.1 200 OK
Date: Mon, 07 Sep 2020 12:39:43 GMT
Location: http://localhost:7070/gemfire-api/v1

Spring Boot App
On the App side I’m using the below annotations in order I could do the region creation part through the client:
@ClientCacheApplication(useHttp=true)
@EnableClusterConfiguration
@EnableEntityDefinedRegions


Problem
When I check the application log during start app I can see that the client is trying to use a slightly different URL for the RegionCreation POST request:
org.springframework.context.ApplicationContextException: Failed to start bean 'gemfireClusterSchemaObjectInitializer'; nested exception is org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: [HTTP ERROR 404 Not Found
URI: /gemfire/v1/regions
STATUS: 404
MESSAGE: Not Found
SERVLET: null
]


So instead of “/gemfire-api/v1” or “/geode/v1” it’s trying to access the “/gemfire/v1” url.

Could you help me figure out why is that? Is this a bug?

Regards, Gábor

RE: Geode REST API - Question

Posted by Gábor Kendelényi <ga...@ericsson.com>.
I checked the matrix and based ont that the components should be compatible with each other:
SBDG
Latest
Spring Boot
SDG
SSDG
STDG
Spring Framework
Apache Geode
Pivotal GemFire
1.3.x
1.3.3.RELEASE
2.3.3.RELEASE<https://github.com/spring-projects/spring-boot-data-geode/blob/1.3.3.RELEASE/gradle.properties#L11>
2.3.3.RELEASE<https://github.com/spring-projects/spring-boot-data-geode/blob/1.3.3.RELEASE/gradle.properties#L13>
2.3.0.RELEASE<https://github.com/spring-projects/spring-boot-data-geode/blob/1.3.3.RELEASE/gradle.properties#L17>
0.0.18.RELEASE<https://github.com/spring-projects/spring-boot-data-geode/blob/1.3.3.RELEASE/gradle.properties#L14>
5.2.8.RELEASE<https://github.com/spring-projects/spring-boot-data-geode/blob/1.3.3.RELEASE/gradle.properties#L10>
1.12.0<https://github.com/spring-projects/spring-boot-data-geode/blob/1.3.3.RELEASE/gradle.properties#L3>
9.10.2<https://github.com/spring-projects/spring-boot-data-geode/blob/1.3.3.RELEASE/gradle.properties#L9>

From: Gábor Kendelényi
Sent: Tuesday, September 8, 2020 10:25 AM
To: user@geode.apache.org
Subject: RE: Geode REST API - Question

You are right It’s my mistake I was trying to simplify my code for the mail and I put the useHttp to the wrong annotation:
    @EnableGemfireRepositories(basePackages = "com.ericsson.eea.privacy.dao")
    @EnableEntityDefinedRegions(basePackages = "com.ericsson.eea.privacy.entity")
    @EnablePdx
    @EnableIndexing
    @ClientCacheApplication(locators = { @ClientCacheApplication.Locator(host = "eric-data-kvdb-ag-locator", port = 10334) }, logLevel = "debug")
    @EnableClusterConfiguration(
            useHttp=true,
            host="eric-data-kvdb-ag-server",
            port=7070,
            requireHttps=false
    )

Lib: 'org.springframework.geode:spring-geode-starter:1.3.3.RELEASE'
Server: Product-Version: 1.12.0.9-NORDIX.202008170838

From: Udo Kohlmeyer <ud...@vmware.com>>
Sent: Tuesday, September 8, 2020 10:20 AM
To: user@geode.apache.org<ma...@geode.apache.org>
Subject: Re: Geode REST API - Question

Hi there Gabor,

I’ve done some digging.. And I really don’t know what version of SBDG or SDG you are using in your client.

In none of the supported versions is there any support for
`ClientCacheApplication(useHttp=true)`

Maybe you are looking for:

`EnableClusterConfiguration(useHttp=true)`

And in case you want to opt-out of using HTTPS

`EnableClusterConfiguration(useHttp=true, requireHttps=false)`

Please let me know what versions of the libraries you are using, so that we can try and help you further.

—Udo
On Sep 8, 2020, 6:08 PM +1000, Udo Kohlmeyer <ud...@vmware.com>>, wrote:
Hi there Gabor.

Can you please elaborate on versions of Geode and Spring Boot Data Geode are you using.

You can confirm if you are using compatible versions here. https://github.com/spring-projects/spring-boot-data-geode/wiki/Spring-Boot-for-Apache-Geode-and-Pivotal-GemFire-Version-Compatibility-Matrix<https://protect2.fireeye.com/v1/url?k=8bdcd0ff-d56c4d65-8bdc9064-867b36d1634c-e7df90ff1c0652f3&q=1&e=30d4a48f-50ea-4de6-8a21-b9b72218bea2&u=https%3A%2F%2Fnam04.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fgithub.com%252Fspring-projects%252Fspring-boot-data-geode%252Fwiki%252FSpring-Boot-for-Apache-Geode-and-Pivotal-GemFire-Version-Compatibility-Matrix%26data%3D02%257C01%257Cudo%2540vmware.com%257Cf8577a04f2d9453a173008d853ce57f2%257Cb39138ca3cee4b4aa4d6cd83d9dd62f0%257C0%257C0%257C637351492990187660%26sdata%3DsI%252B8DyDkwN18q9tDp9NKW3%252FhIpPEcE3GQHM0TxYsQoc%253D%26reserved%3D0>

—Udo
On Sep 8, 2020, 6:03 PM +1000, Gábor Kendelényi <ga...@ericsson.com>>, wrote:
Hi Geode Team/Users,

I need your help figuring out why the Apache Geode Java Client is behaving the way it does.
Overall my task is simple. I just need to connect to a Geode server running in a small Kubernetes test cluster via a Spring Boot application.

Geode Server
On the Geode side I have enabled the REST API by setting the “-Dgemfire.start-dev-rest-api” property true.
It’s working properly.
bash-4.4# curl -i -X GET http://localhost:7070/gemfire-api/v1
HTTP/1.1 200 OK
Date: Mon, 07 Sep 2020 12:39:43 GMT
Location: http://localhost:7070/gemfire-api/v1

Spring Boot App
On the App side I’m using the below annotations in order I could do the region creation part through the client:
@ClientCacheApplication(useHttp=true)
@EnableClusterConfiguration
@EnableEntityDefinedRegions


Problem
When I check the application log during start app I can see that the client is trying to use a slightly different URL for the RegionCreation POST request:
org.springframework.context.ApplicationContextException: Failed to start bean 'gemfireClusterSchemaObjectInitializer'; nested exception is org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: [HTTP ERROR 404 Not Found
URI: /gemfire/v1/regions
STATUS: 404
MESSAGE: Not Found
SERVLET: null
]


So instead of “/gemfire-api/v1” or “/geode/v1” it’s trying to access the “/gemfire/v1” url.

Could you help me figure out why is that? Is this a bug?

Regards, Gábor

RE: Geode REST API - Question

Posted by Gábor Kendelényi <ga...@ericsson.com>.
You are right It’s my mistake I was trying to simplify my code for the mail and I put the useHttp to the wrong annotation:
    @EnableGemfireRepositories(basePackages = "com.ericsson.eea.privacy.dao")
    @EnableEntityDefinedRegions(basePackages = "com.ericsson.eea.privacy.entity")
    @EnablePdx
    @EnableIndexing
    @ClientCacheApplication(locators = { @ClientCacheApplication.Locator(host = "eric-data-kvdb-ag-locator", port = 10334) }, logLevel = "debug")
    @EnableClusterConfiguration(
            useHttp=true,
            host="eric-data-kvdb-ag-server",
            port=7070,
            requireHttps=false
    )

Lib: 'org.springframework.geode:spring-geode-starter:1.3.3.RELEASE'
Server: Product-Version: 1.12.0.9-NORDIX.202008170838

From: Udo Kohlmeyer <ud...@vmware.com>
Sent: Tuesday, September 8, 2020 10:20 AM
To: user@geode.apache.org
Subject: Re: Geode REST API - Question

Hi there Gabor,

I’ve done some digging.. And I really don’t know what version of SBDG or SDG you are using in your client.

In none of the supported versions is there any support for
`ClientCacheApplication(useHttp=true)`

Maybe you are looking for:

`EnableClusterConfiguration(useHttp=true)`

And in case you want to opt-out of using HTTPS

`EnableClusterConfiguration(useHttp=true, requireHttps=false)`

Please let me know what versions of the libraries you are using, so that we can try and help you further.

—Udo
On Sep 8, 2020, 6:08 PM +1000, Udo Kohlmeyer <ud...@vmware.com>>, wrote:

Hi there Gabor.

Can you please elaborate on versions of Geode and Spring Boot Data Geode are you using.

You can confirm if you are using compatible versions here. https://github.com/spring-projects/spring-boot-data-geode/wiki/Spring-Boot-for-Apache-Geode-and-Pivotal-GemFire-Version-Compatibility-Matrix<https://protect2.fireeye.com/v1/url?k=8bdcd0ff-d56c4d65-8bdc9064-867b36d1634c-e7df90ff1c0652f3&q=1&e=30d4a48f-50ea-4de6-8a21-b9b72218bea2&u=https%3A%2F%2Fnam04.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fgithub.com%252Fspring-projects%252Fspring-boot-data-geode%252Fwiki%252FSpring-Boot-for-Apache-Geode-and-Pivotal-GemFire-Version-Compatibility-Matrix%26data%3D02%257C01%257Cudo%2540vmware.com%257Cf8577a04f2d9453a173008d853ce57f2%257Cb39138ca3cee4b4aa4d6cd83d9dd62f0%257C0%257C0%257C637351492990187660%26sdata%3DsI%252B8DyDkwN18q9tDp9NKW3%252FhIpPEcE3GQHM0TxYsQoc%253D%26reserved%3D0>

—Udo
On Sep 8, 2020, 6:03 PM +1000, Gábor Kendelényi <ga...@ericsson.com>>, wrote:

Hi Geode Team/Users,

I need your help figuring out why the Apache Geode Java Client is behaving the way it does.
Overall my task is simple. I just need to connect to a Geode server running in a small Kubernetes test cluster via a Spring Boot application.

Geode Server
On the Geode side I have enabled the REST API by setting the “-Dgemfire.start-dev-rest-api” property true.
It’s working properly.
bash-4.4# curl -i -X GET http://localhost:7070/gemfire-api/v1
HTTP/1.1 200 OK
Date: Mon, 07 Sep 2020 12:39:43 GMT
Location: http://localhost:7070/gemfire-api/v1

Spring Boot App
On the App side I’m using the below annotations in order I could do the region creation part through the client:
@ClientCacheApplication(useHttp=true)
@EnableClusterConfiguration
@EnableEntityDefinedRegions


Problem
When I check the application log during start app I can see that the client is trying to use a slightly different URL for the RegionCreation POST request:
org.springframework.context.ApplicationContextException: Failed to start bean 'gemfireClusterSchemaObjectInitializer'; nested exception is org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: [HTTP ERROR 404 Not Found
URI: /gemfire/v1/regions
STATUS: 404
MESSAGE: Not Found
SERVLET: null
]


So instead of “/gemfire-api/v1” or “/geode/v1” it’s trying to access the “/gemfire/v1” url.

Could you help me figure out why is that? Is this a bug?

Regards, Gábor

Re: Geode REST API - Question

Posted by Udo Kohlmeyer <ud...@vmware.com>.
Hi there Gabor,

I’ve done some digging.. And I really don’t know what version of SBDG or SDG you are using in your client.

In none of the supported versions is there any support for
`ClientCacheApplication(useHttp=true)`

Maybe you are looking for:

`EnableClusterConfiguration(useHttp=true)`

And in case you want to opt-out of using HTTPS

`EnableClusterConfiguration(useHttp=true, requireHttps=false)`

Please let me know what versions of the libraries you are using, so that we can try and help you further.

—Udo
On Sep 8, 2020, 6:08 PM +1000, Udo Kohlmeyer <ud...@vmware.com>, wrote:
Hi there Gabor.

Can you please elaborate on versions of Geode and Spring Boot Data Geode are you using.

You can confirm if you are using compatible versions here. https://github.com/spring-projects/spring-boot-data-geode/wiki/Spring-Boot-for-Apache-Geode-and-Pivotal-GemFire-Version-Compatibility-Matrix<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fspring-projects%2Fspring-boot-data-geode%2Fwiki%2FSpring-Boot-for-Apache-Geode-and-Pivotal-GemFire-Version-Compatibility-Matrix&data=02%7C01%7Cudo%40vmware.com%7Cf8577a04f2d9453a173008d853ce57f2%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637351492990187660&sdata=sI%2B8DyDkwN18q9tDp9NKW3%2FhIpPEcE3GQHM0TxYsQoc%3D&reserved=0>

—Udo
On Sep 8, 2020, 6:03 PM +1000, Gábor Kendelényi <ga...@ericsson.com>, wrote:
Hi Geode Team/Users,

I need your help figuring out why the Apache Geode Java Client is behaving the way it does.
Overall my task is simple. I just need to connect to a Geode server running in a small Kubernetes test cluster via a Spring Boot application.

Geode Server
On the Geode side I have enabled the REST API by setting the “-Dgemfire.start-dev-rest-api” property true.
It’s working properly.
bash-4.4# curl -i -X GET http://localhost:7070/gemfire-api/v1
HTTP/1.1 200 OK
Date: Mon, 07 Sep 2020 12:39:43 GMT
Location: http://localhost:7070/gemfire-api/v1

Spring Boot App
On the App side I’m using the below annotations in order I could do the region creation part through the client:
@ClientCacheApplication(useHttp=true)
@EnableClusterConfiguration
@EnableEntityDefinedRegions


Problem
When I check the application log during start app I can see that the client is trying to use a slightly different URL for the RegionCreation POST request:
org.springframework.context.ApplicationContextException: Failed to start bean 'gemfireClusterSchemaObjectInitializer'; nested exception is org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: [HTTP ERROR 404 Not Found
URI: /gemfire/v1/regions
STATUS: 404
MESSAGE: Not Found
SERVLET: null
]


So instead of “/gemfire-api/v1” or “/geode/v1” it’s trying to access the “/gemfire/v1” url.

Could you help me figure out why is that? Is this a bug?

Regards, Gábor

RE: Geode REST API - Question

Posted by Gábor Kendelényi <ga...@ericsson.com>.
Hi Udo,

Server
gfsh>version --full
Build-Date: 2020-08-17 08:42:10 +0000
Build-Id: infra 202008170838
Build-Java-Vendor: Private Build
Build-Java-Version: 1.8.0_252
Build-Platform: Linux 4.15.0-101-generic amd64
Product-Name: Apache Geode
Product-Version: 1.12.0.9-NORDIX.202008170838
Source-Date: 2020-08-17 08:09:19 +0000
Source-Repository: HEAD
Source-Revision: be8d0606ba2ad2961e603098ac4d970738a55547
Running on: /192.168.254.58, 2 cpu(s), amd64 Linux 4.12.14-195-default

Client
'org.springframework.geode:spring-geode-starter:1.3.3.RELEASE'

/// Gábor

From: Udo Kohlmeyer <ud...@vmware.com>
Sent: Tuesday, September 8, 2020 10:08 AM
To: user@geode.apache.org
Subject: Re: Geode REST API - Question

Hi there Gabor.

Can you please elaborate on versions of Geode and Spring Boot Data Geode are you using.

You can confirm if you are using compatible versions here. https://github.com/spring-projects/spring-boot-data-geode/wiki/Spring-Boot-for-Apache-Geode-and-Pivotal-GemFire-Version-Compatibility-Matrix<https://protect2.fireeye.com/v1/url?k=cef1194a-9051db0f-cef159d1-8692dc8284cb-7308fce7ed79d1a9&q=1&e=5a50da78-7bd5-4e72-a2e5-d11eb95e9631&u=https%3A%2F%2Fgithub.com%2Fspring-projects%2Fspring-boot-data-geode%2Fwiki%2FSpring-Boot-for-Apache-Geode-and-Pivotal-GemFire-Version-Compatibility-Matrix>

—Udo
On Sep 8, 2020, 6:03 PM +1000, Gábor Kendelényi <ga...@ericsson.com>>, wrote:

Hi Geode Team/Users,

I need your help figuring out why the Apache Geode Java Client is behaving the way it does.
Overall my task is simple. I just need to connect to a Geode server running in a small Kubernetes test cluster via a Spring Boot application.

Geode Server
On the Geode side I have enabled the REST API by setting the “-Dgemfire.start-dev-rest-api” property true.
It’s working properly.
bash-4.4# curl -i -X GET http://localhost:7070/gemfire-api/v1
HTTP/1.1 200 OK
Date: Mon, 07 Sep 2020 12:39:43 GMT
Location: http://localhost:7070/gemfire-api/v1

Spring Boot App
On the App side I’m using the below annotations in order I could do the region creation part through the client:
@ClientCacheApplication(useHttp=true)
@EnableClusterConfiguration
@EnableEntityDefinedRegions


Problem
When I check the application log during start app I can see that the client is trying to use a slightly different URL for the RegionCreation POST request:
org.springframework.context.ApplicationContextException: Failed to start bean 'gemfireClusterSchemaObjectInitializer'; nested exception is org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: [HTTP ERROR 404 Not Found
URI: /gemfire/v1/regions
STATUS: 404
MESSAGE: Not Found
SERVLET: null
]


So instead of “/gemfire-api/v1” or “/geode/v1” it’s trying to access the “/gemfire/v1” url.

Could you help me figure out why is that? Is this a bug?

Regards, Gábor

Re: Geode REST API - Question

Posted by Udo Kohlmeyer <ud...@vmware.com>.
Hi there Gabor.

Can you please elaborate on versions of Geode and Spring Boot Data Geode are you using.

You can confirm if you are using compatible versions here. https://github.com/spring-projects/spring-boot-data-geode/wiki/Spring-Boot-for-Apache-Geode-and-Pivotal-GemFire-Version-Compatibility-Matrix

—Udo
On Sep 8, 2020, 6:03 PM +1000, Gábor Kendelényi <ga...@ericsson.com>, wrote:
Hi Geode Team/Users,

I need your help figuring out why the Apache Geode Java Client is behaving the way it does.
Overall my task is simple. I just need to connect to a Geode server running in a small Kubernetes test cluster via a Spring Boot application.

Geode Server
On the Geode side I have enabled the REST API by setting the “-Dgemfire.start-dev-rest-api” property true.
It’s working properly.
bash-4.4# curl -i -X GET http://localhost:7070/gemfire-api/v1
HTTP/1.1 200 OK
Date: Mon, 07 Sep 2020 12:39:43 GMT
Location: http://localhost:7070/gemfire-api/v1

Spring Boot App
On the App side I’m using the below annotations in order I could do the region creation part through the client:
@ClientCacheApplication(useHttp=true)
@EnableClusterConfiguration
@EnableEntityDefinedRegions


Problem
When I check the application log during start app I can see that the client is trying to use a slightly different URL for the RegionCreation POST request:
org.springframework.context.ApplicationContextException: Failed to start bean 'gemfireClusterSchemaObjectInitializer'; nested exception is org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: [HTTP ERROR 404 Not Found
URI: /gemfire/v1/regions
STATUS: 404
MESSAGE: Not Found
SERVLET: null
]


So instead of “/gemfire-api/v1” or “/geode/v1” it’s trying to access the “/gemfire/v1” url.

Could you help me figure out why is that? Is this a bug?

Regards, Gábor