-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
DatabaseFactory.create() fails with java.lang.InstantiationError: io.ebean.bean.EntityBeanIntercept in multi-module gradle setup #2888
Comments
Very likely that the issue is that the gradle plugin version is older than the ebean version. The gradle plugin version should be equal to or later than the ebean version. If we are using ebean 13.10.1 we should be using that version of the gradle plugin or higher. We can use the latest gradle plugin with older versions of ebean (it is backwards compatible). |
Hi, thanks for the reply, but I don't think so - as you can see here https:/Incanus3/ebean-test/blob/multi-module-intercept-error/build.gradle.kts on lines 7 and 22, I'm using the same version to define the plugin and the dependency itself. I've also tried to add explicit versions to submodules (although it shouldn't be needed, because it just inherits the plugin version from the parent module) and checked the output of both |
I also checked this again with both versions set to 13.10.1 and the result is the same (I mean the new versions are correctly installed and used by gradle, but the instantiation still fails with the same problem). |
@Incanus3 Ebean has changed I have used your example project and added to the Then I have decompiled the class file and it indeed shows
with I also verified ebean versions and Ebean Gradle Plugin and Ebean dependencies are indeed all the same version 13.6.5. So I skimmed a bit through the code. The Ebean Gradle Plugin calls a class named public String interceptNew() {
return enhancementVersion >= 140 ? C_INTERCEPT_RW : C_INTERCEPT_I;
} which either returns However that This situation is also logged to console if you add to your build.gradle.kts file
Then you see
Now when using the
Suddenly there is an So it seems like in your multi module build
So you do not have any @rbygrave If the Ebean Gradle Plugin can enhance classes with just |
@jnehlmeier that's some great detective work, thank you so much. I can confirm that replacing I'm sorry I didn't think of setting the We used the Thank you again, this is a great library with an even greater community around it. I can't stop being amazed how quickly all reported problems get resolved. Best of regards. |
…ror: io.ebean.bean.EntityBeanIntercept in multi-module gradle setup
Yes. We should move
ebean-agent is released with every version of ebean (even if it hasn't changed) but this is not sufficient in that it needs to be backwards compatible (support older versions of ebean).
We don't take this option because we want ebean-agent to support older versions of ebean. In particular this means that people can install and use the latest IntelliJ Ebean plugin (which includes the latest ebean-agent) with older versions of ebean going back to version 11.x. |
Expected behavior
create and return a
Database
instanceActual behavior
DatabaseFactory.create()
call fails withSteps to reproduce
ea/db/src/test/kotlin/cz/sentica/qwazar/ea/db/ObjectConnectorRelationsTest.kt
there's a test to reproduce thisjdk.internal.reflect.NativeConstructorAccessorImpl.newInstance()
and hit a native method I can't step intoThe text was updated successfully, but these errors were encountered: