Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible incompatibility between Cassandra, REST, and Kotlin [DATAREST-1183] #1548

Closed
spring-projects-issues opened this issue Jan 19, 2018 · 2 comments
Assignees
Labels
in: repository status: declined type: bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Jan 19, 2018

Fernando Marino opened DATAREST-1183 and commented

Hi all,
I'm working on a very simple application that scan a public service for data and loads it into a cassandra database. Then I want to export it via a rest interface.
The code is available on github, and with it I have faced two major problem:

The first one is that this snippet cause the application to crash at startup.

@RepositoryRestResource(collectionResourceRel = "product", path = "product")
interface ProductRepository: PagingAndSortingRepository<Product, UUID>

org.springframework.data.mapping.PropertyReferenceException: No property findAll found for type Product!
	at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:77) ~[spring-data-commons-1.13.9.RELEASE.jar:na]
	at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:329) ~[spring-data-commons-1.13.9.RELEASE.jar:na]
...

Apparently while scanning the classpath it looks for a property named findAll into my persistent entity, but this property obviously does not exists and it fails.

If I switch to a CrudRepository the application starts correctly but still it gives me another error while I try to fetch something. Apparently during the serialization phase it try to resolve the start property of my persistent entity as it is a persistent entity, while instead is just a LocalDateTime value, and so it fails.

To reproduce, you have to provide your own cassandra instance. Also if you want some sample data, set autoStart to true into the DhusPolling class. The remote resource he is going to scan is public so there are no problems.

Thank you for your patience and your great work on this project!

Fernando


Affects: 3.0.2 (Kay SR2)

Reference URL: https://github.com/fer-marino/copernicus-statistics

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 19, 2018

Mark Paluch commented

Spring Data Cassandra does not support PagingAndSortingRepository, only CrudRepository. The error message reports that it cannot derive a query from PagingAndSortingRepository's findAll method. Please use CrudRepository instead

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 19, 2018

Mark Paluch commented

Can you please split the two issues? I'd propose to close this one as works as designed regarding PagingAndSortingRepository. Please include additional details such as stack trace and relevant code snippets in the new ticket to assist with discoverability

@spring-projects-issues spring-projects-issues added type: bug status: declined in: repository labels Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: repository status: declined type: bug
Projects
None yet
Development

No branches or pull requests

2 participants