Pergunta

I've got a very basic survey app :

  • one JPA entity (Survey.java)
  • one Spring MVC controller (SurveyController.java)
  • one Spring Data/JPA repository (SurveyRepository.java)
  • 3 main steps, each matching a specific Validation Group
  • a REST API exposed through Spring Data/REST configuration (see ApiConfiguration.java)

You can see it live here: http://survey-preprod.cloudfoundry.com/. The sources are available here: https://github.com/fbiville/spring-example-survey.

Just properly fill the form (3 steps - just answer anything) till you see the "Thanks!" page. Then proceed: http://survey-preprod.cloudfoundry.com/api/survey and notice there is no contents at all!

This happened will all Spring Data / REST I pushed to Cloud Foundry. When run locally, there isn't any problems at all.

Is there something I missed?

Thanks in advance, Rolf

EDIT: even with

curl -v -H "Accept: application/json" -X GET http://survey-preprod.cloudfoundry.com/api/survey

(so the accept header is properly set), no contents are exposed...

Foi útil?

Solução

Well guys, as (sadly) often, this is a clear PEBKAC instance.

ApiConfiguration was importing CoreConfiguration (which was already loaded once as defined by web.xml). Therefore, the same "core" beans were loaded again, but CloudFoundry auto-reconfiguration occurred only the first time on the declared datasource and let the duplicated one as is (that is: an H2 database, of course without any contents).

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top