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

Missing dependencies with grails persistent engine type "mapping" #2

Open
dforegger opened this issue Feb 12, 2018 · 0 comments
Open

Comments

@dforegger
Copy link

When running with the Mongo GORM Persistence Engine to "mapping" using grails:engine:mongodb:mapping, a ClassNotFound exception is thrown for FileUtils from apache-commons:io

h2. Steps to reproduce

  1. On grails 3.3.2, run "grails create-app "
  2. Per the set-up instructions: add
    compile 'org.grails.plugins:mongodb:6.1.2' and testCompile "org.grails.plugins:embedded-mongodb:1.0.2" to the dependencies { ... } block and configure the grails-app/init/Application.groovy class with @EnableAutoConfiguration(exclude = [EmbeddedMongoAutoConfiguration])
  3. Modify application.yml to include environments: test: grails: mongodb: engine: "mapping"
  4. Create a new domain object: grails create-domain-class Foo and add a property to it String bar
  5. Create a new integration test: grails create-integration-test Foo
  6. Update the integration test to save and flush an instance of Foo
  7. Run tests: grails test-app -integration

Expect: Tests pass without error
Result: Console prints:

embedded.mongo.transitive.test.FooSpec > classMethod FAILED
java.lang.IllegalArgumentException
Exception in thread "Thread-5" java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
at de.flapdoodle.embed.process.io.file.Files.forceDelete(Files.java:119)
at de.flapdoodle.embed.mongo.MongodProcess.deleteTempFiles(MongodProcess.java:92)
at de.flapdoodle.embed.mongo.AbstractMongoProcess.cleanupInternal(AbstractMongoProcess.java:124)
at de.flapdoodle.embed.process.runtime.AbstractProcess.stop(AbstractProcess.java:172)
at de.flapdoodle.embed.process.runtime.Executable.stop(Executable.java:73)
at de.flapdoodle.embed.process.runtime.Executable$JobKiller.run(Executable.java:90)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more

Final notes:

  • I'm seeing mixed results with this - sometimes this prints and tests fail, sometimes it prints and they pass, and sometimes it doesn't print at all. I'm still working to figure out each case, but ran out of time.
  • I was also seeing a similar issues with a dependency on commons-compress, which is what I was originally trying to reproduce, but I haven't been able to successfully reproduce it in a clean application yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant