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

Neo4j bean classes are not loaded properly when I deploy the app using docker #211

Closed
linahovanessian opened this issue Jul 29, 2016 · 6 comments
Labels
Milestone

Comments

@linahovanessian
Copy link

My application is using spring boot and spring data neo4j-4… If I run the app via spring boot , everything works fine and all of my bean classes get loaded in the session factory without any problem. The problem shows up when I use the docker deployment version… for some reasons the packages are not loaded properly in “org.neo4j.ogm.metadata.DomainInfo” class … So the classNameToClassInfo map remains empty after initialization. In other words “return new SessionFactory(getConfiguration(), "XXX.XXX.XXX.beans");” does not work for docker deployment version. The bean packages path is not resolved properly.
I am deploying a war file in the docker container.

stackoverflow

@linahovanessian
Copy link
Author

I just tried another scenario and it worked ! so instead of putting a ".war" in docker container , I put a ".jar" version of my app in the container and it worked ! So to be more specific , we need to add "*.war" scan support in "org.neo4j.ogm.scanner.ClassPathScanner". Please see attached screenshot.

screen shot 2016-07-29 at 1 04 28 pm

@jasperblues
Copy link
Contributor

Thank you for the additional information @linahovanessian!

@vince-bickers
Copy link

@linahovanessian Renaming .war to .jar works because the scanner is able to recursively scan subdirectories of the archive: in this case WEB-INF/classes and WEB-INF/lib.

Of course a lot of non-domain class artefacts will also be scanned in a web archive when you do this, but in the interests of quickly fixing this issue we can add explicit support for .war, in the way you suggest. In future we can look at having smarter scanning for .war archives that inspects just WEB-INF/classes and WEB-INF/lib if we need to do this.

@vince-bickers
Copy link

@linahovanessian Latest 2.0.5-SNAPSHOT now contains a fix for this. Please let us know if this resolves your problem.

@linahovanessian
Copy link
Author

Thanks @vince-bickers . Will give it a try... Will keep you updated.

@linahovanessian
Copy link
Author

Works fine for me.... Thanks team !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants