IntelliJ IDEA Ebean Enhancement Plugin leaves something in a project when Ebean is removed?

305 views
Skip to first unread message

Glen Peterson

unread,
Nov 26, 2018, 3:22:19 PM11/26/18
to Ebean ORM
If you've been reading this list, you know I did a partial conversion from Hibernate to eBean, then had to put it on hold.  I removed eBean from this project.  Now when I click, "Run All Tests" in IntelliJ, I get:

Exception in thread "main" java.lang.NoClassDefFoundError: io/ebean/bean/EntityBean

If I search for ebean and EntityBean in the main and test sources, there are no results.

If I run it from maven at the command line, there's no error.

If I go to File -> Settings -> Plugins
and disable "Ebean 11 Enhancement" and restart IDEA, the problem goes away.  Now when I go to my eBean project, I have to turn the plugin on and restart IDEA again.  Since I switch back and forth between projects for work, this will get annoying.  How do I tell the plugin not to enhance this project any more?  I still want to use it in my other project.

I'm using Ebean 11 Enhancement Plugin Version 11.24.1

IntelliJ IDEA 2018.2.6 (Ultimate Edition)
Build #IU-182.5107.16, built on November 6, 2018
Licensed to Glen Peterson
You have a perpetual fallback license for this version
Subscription is active until January 10, 2020
JRE: 1.8.0_152-release-1248-b22 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.0-39-generic

Rob Bygrave

unread,
Nov 26, 2018, 3:32:38 PM11/26/18
to ebean@googlegroups
>  How do I tell the plugin not to enhance this project any more?  I still want to use it in my other project.

It should only be enabled per project.  So you should be able to see that it's on for one project and not another.  

That is, the Idea plugin stores it's enabled state per project.



--

---
You received this message because you are subscribed to the Google Groups "Ebean ORM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Glen Peterson

unread,
Nov 26, 2018, 6:13:31 PM11/26/18
to Ebean ORM
Thank you for your quick response.  I just checked very carefully and it's not working that way for me.  I'll call my projects H and M.  I want H to have the ebean plugin Disabled and M to have it Enabled

1. Open project M in IntelliJ.
2. File -> Settings -> Plugins -> Ebean and see that it is Enabled
3. Open project H (from File -> Open Recent).
4. Close M.
5. Back in project H, see that ebean is Enabled.
6. Disable ebean in project H.
7. Click Apply -> OK -> Restart
8. After restart, see that File -> Settings -> Plugins -> Ebean is Disabled (as expected).  Cancel out of dialog.
9. File -> Open Recent -> M
10 File -> Settings -> Ebean:

EXPECTED RESULTS:
Ebean is still enabled in project M.

ACTUAL RESULTS:
Ebean is disabled in project M.

NOTES:
I also noticed that if I have Ebean 10 and Ebean 11 enhancement plugins installed, I have to use the same version for both projects, or else every time I change it for one project, it changes for the other as well.  This makes me think that the ebean plugin enable/disable settings are global and not per-project.  There's an update for IntelliJ today that I haven't installed yet (want to check my code in before I do that).

Glen Peterson

unread,
Nov 26, 2018, 6:56:34 PM11/26/18
to Ebean ORM
Additional info:
With ebean enhancement OFF, when I run the app from IntelliJ, I get this error the first time it tries to access the database (using Hibernate - there should be no ebean).  For the record, this is Project H from my previous example.

java.lang.NoClassDefFoundError: io/ebean/bean/EntityBean
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at planbase.hoshin.HoshinScorecard$Identification$Companion.of(HoshinScorecard.kt:1167)

Glen Peterson

unread,
Nov 26, 2018, 7:02:14 PM11/26/18
to Ebean ORM
Interesting results from running this at the command line:
$ fgrep -Ri ebean

HoshinScorecard.iws:      <find>ebean</find>
HoshinScorecard.iws:  <component name="ebeanEnhancement">
HoshinScorecard.iws:          <last-edited>Maven: io.ebean:persistence-api:2.2.1</last-edited>

HoshinScorecard.iml:    <orderEntry type="library" name="Maven: io.ebean:persistence-api:2.2.1" level="project" />
HoshinScorecard.ipr:    <library name="Maven: io.ebean:persistence-api:2.2.1">
HoshinScorecard.ipr:        <root url="jar://$MAVEN_REPOSITORY$/io/ebean/persistence-api/2.2.1/persistence-api-2.2.1.jar!/" />
HoshinScorecard.ipr:        <root url="jar://$MAVEN_REPOSITORY$/io/ebean/persistence-api/2.2.1/persistence-api-2.2.1-javadoc.jar!/" />
HoshinScorecard.ipr:        <root url="jar://$MAVEN_REPOSITORY$/io/ebean/persistence-api/2.2.1/persistence-api-2.2.1-sources.jar!/" />

Glen Peterson

unread,
Nov 26, 2018, 7:12:08 PM11/26/18
to Ebean ORM
I was able to solve my problem.

HoshinScorecard.iws: 
Deleted xml node:
  <component name="ebeanEnhancement">...</component>

Changed "true" to "false":
  <component name="ebeanEnhancement">
    <option name="enabled" value="false" />
  </component>


HoshinScorecard.iml:
Deleted xml node:
<orderEntry type="library" name="Maven: io.ebean:persistence-api:2.2.1" level="project" />

HoshinScorecard.ipr:
Deleted xml node:
<library name="Maven: io.ebean:persistence-api:2.2.1">...</library>

Problem seems to go away.  No idea about project M, but at least I can turn it off for project H.

Glen Peterson

unread,
Dec 6, 2018, 3:42:28 PM12/6/18
to Ebean ORM
Update: Today, I changed my $kotlin-version variable in my Maven .pom file to 1.3.11 then changed it back to 1.3.10.  Afterwards, the .iml and .ipr stuff for ebean mysteriously reappeared:

diff --git a/HoshinScorecard.iml b/HoshinScorecard.iml
index 6b2a8a2c7..469a6afe6 100644
--- a/HoshinScorecard.iml
+++ b/HoshinScorecard.iml
@@ -72,6 +72,7 @@
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="library" name="Maven: com.planbase:PbWebAppUtil:0.2.6" level="project" />
+    <orderEntry type="library" name="Maven: io.ebean:persistence-api:2.2.1" level="project" />
     <orderEntry type="library" name="Maven: org.organicdesign:Indented:0.0.3" level="project" />
     <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
     <orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.3" level="project" />
@@ -145,4 +146,4 @@
     <orderEntry type="library" scope="TEST" name="Maven: org.jetbrains.kotlin:kotlin-test:1.3.10" level="project" />
     <orderEntry type="library" scope="TEST" name="Maven: org.jetbrains.kotlin:kotlin-test-common:1.3.10" level="project" />
   </component>
-</module>
+</module>
\ No newline at end of file
diff --git a/HoshinScorecard.ipr b/HoshinScorecard.ipr
index 0fcad3a1c..50fdb0919 100644
--- a/HoshinScorecard.ipr
+++ b/HoshinScorecard.ipr
@@ -1221,6 +1221,17 @@
         <root url="jar://$MAVEN_REPOSITORY$/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar!/" />
       </SOURCES>
     </library>
+    <library name="Maven: io.ebean:persistence-api:2.2.1">
+      <CLASSES>
+        <root url="jar://$MAVEN_REPOSITORY$/io/ebean/persistence-api/2.2.1/persistence-api-2.2.1.jar!/" />
+      </CLASSES>
+      <JAVADOC>
+        <root url="jar://$MAVEN_REPOSITORY$/io/ebean/persistence-api/2.2.1/persistence-api-2.2.1-javadoc.jar!/" />
+      </JAVADOC>
+      <SOURCES>
+        <root url="jar://$MAVEN_REPOSITORY$/io/ebean/persistence-api/2.2.1/persistence-api-2.2.1-sources.jar!/" />
+      </SOURCES>
+    </library>
     <library name="Maven: javax.activation:activation:1.1">
       <CLASSES>

I had upgraded IDEA yesterday, but had checked in all my changes, rebooted, and started fresh today.  The Ebean 11 enhancement remains unchecked (disabled) in the settings dialog.

IntelliJ IDEA 2018.2.7 (Ultimate Edition)
Build #IU-182.5107.41, built on November 26, 2018
Licensed to Glen Peterson
You have a perpetual fallback license for this version
Subscription is active until January 10, 2020
JRE: 1.8.0_152-release-1248-b22 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.0-42-generic

Glen Peterson

unread,
Dec 7, 2018, 7:23:06 AM12/7/18
to Ebean ORM
Same changes to .iml and .ipr happened again, without any changes to the .pom on upgrade to:
IntelliJ IDEA 2018.3.1 (Ultimate Edition)
Build #IU-183.4588.61, built on December 4, 2018

I think I'm the only one noticing because no-one else adds Ebean to a project, then removes it (to go back to using only Hibernate).  I would still rather use Ebean long term, but it's going to take a while to convert 150K LOC (months or years) and I will probably switch back and forth between the two ORM's until I'm sure that the transition is complete.

Glen Peterson

unread,
Feb 25, 2019, 12:39:50 PM2/25/19
to Ebean ORM
I finally figured it out.  My project had a dependency on a second project which had a (unnecessary) dependency on ebean.  I changed the second project to use

<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>

And now my problem appears to be solved!  Sorry to bother you with something that was entirely my own fault.  It was really annoying to see ebean pop up and have the ebean plugin reactivate and cause problems and I couldn't figure out why.  If someone else makes the same mistake, now you can tell them to check the dependencies of their dependencies.

Rob Bygrave

unread,
Feb 25, 2019, 3:29:45 PM2/25/19
to ebean@googlegroups
Great stuff.  Thanks for following that up and posting back the findings.  One day someone will hit the same issue and this will help them I'm sure.

Cheers, Rob.
Reply all
Reply to author
Forward
0 new messages