You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
On grails 3.3.2, run "grails create-app "
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])
Modify application.yml to include environments: test: grails: mongodb: engine: "mapping"
Create a new domain object: grails create-domain-class Foo and add a property to it String bar
Create a new integration test: grails create-integration-test Foo
Update the integration test to save and flush an instance of Foo
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.
The text was updated successfully, but these errors were encountered:
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
compile 'org.grails.plugins:mongodb:6.1.2'
andtestCompile "org.grails.plugins:embedded-mongodb:1.0.2"
to thedependencies { ... }
block and configure thegrails-app/init/Application.groovy
class with@EnableAutoConfiguration(exclude = [EmbeddedMongoAutoConfiguration])
environments: test: grails: mongodb: engine: "mapping"
grails create-domain-class Foo
and add a property to itString bar
grails create-integration-test Foo
grails test-app -integration
Expect: Tests pass without error
Result: Console prints:
Final notes:
The text was updated successfully, but these errors were encountered: