-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Unable to instantiate when on modulepath #358
Comments
It looks like, if I do the same thing from within a JUnit test, it does work. I tried figuring out the commandline parameters that Maven Surefire uses to run the tests, but when I apply them to this program, it doesn't fix the issue. Does Objenesis detect whether it's running inside a unit test and, based on that, decide to do something else? |
No. And normally it guesses the instantiator that should work. I am highly interested in the 2 command lines to compare. |
I did some more digging in the mean time, and I found out that if I add |
Hum... I'll look a bit more but I think it will become a usage requirement like many other projects have in order to work in the module path. |
That would be totally fair. BTW, an answer was posted to the stackoverflow question. It looks like Surefire (and I guess IntelliJ too) run on the classpath, but load the test module on the modulepath. So not the entire application runs on the modulepath. Because of this, the stuff on the classpath is accessible, and this includes a couple of "special" built-in modules, including |
Getting the same error when using inside OSGi bundle. |
I did a release yesterday. Can you please try 5.6.0? It is possible that is won't work because I haven't fixed this issue specifically. I'm only fixed the imports, exports. |
(Note that this is a follow-up to issue #160. I suspect it's also the underlying problem for #332.)
Despite the fix made for #160, I'm still unable to use Objenesis when it's running on the modulepath.
I'm not sure what I'm doing wrong, or how I can work around this.
I get this exception:
I've uploaded a complete reproducer here: https://github.com/jqno/objenesis-module-issue
Note: it needs to be run from within IntelliJ. I was unable to reproduce it with Maven.
The full code is also below:
Reproducer.java:
module-info.java:
pom.xml:
The text was updated successfully, but these errors were encountered: