Spring Data Neo4J repository findAll() results in a nullpointerexception

好久不见. 提交于 2019-12-01 07:16:00

Try mark your personRepository.findAll() as @Transactional.

If it still doesn't work, can you post your personRepository.findAll() method plz?

Thanks for the answers! I have managed to solve the problem by adding

"<tx:annotation-driven mode="proxy"/>

to my application context xml file. It's working perfectly now! However i'm still not sure what this statemant does and why i only need it for the findAll() method and not any of the other's i've used. (count(), findOne(), findBySchemaPropertyValue() etc)

ChoppyTheLumberjack

I tried the mode="proxy" and it didn't work for me, this should only have an impact if you are using non-injected transactional methods to call each other (explanation here).

This 'TransactionFailureException' is probably related to the issue: https://jira.spring.io/browse/DATAGRAPH-531. If that's the case, you need to change

service.findAll()

to:

service.findAll().as(Collection.class)

... and the it should go away.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!