Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bean is not enhanced?

If I try to run my project, via Intellij or terminal, my application works fine. However, when I tried to run only my tests, they break with the following exception:

com.google.inject.CreationException: Unable to create injector, see the following errors:

1) Error injecting constructor, java.lang.IllegalStateException: Bean class models.Project is not enhanced?
...


2) Error injecting constructor, java.lang.IllegalStateException: Bean class models.Project is not enhanced?
  at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:35)
  at play.db.ebean.EbeanDynamicEvolutions.class(EbeanDynamicEvolutions.java:32)

I think it might be something with how my project setup. However, I don't have any idea of what might be.

This is my build.sbt, plugins.sbt, and application.conf.

The strange think is that, if I start my application normally, and run my tests, they work, but I need to stop/start my application every time that I need to run my tests,and this is annoying :)

Any idea, or suggestion would be very much appreciate!

like image 229
Valter Silva Avatar asked Mar 16 '26 06:03

Valter Silva


1 Answers

Well, for those who might have the same problem as I had. If you're using IntelliJ, go to Settings, Plugins and type Ebean, several options will show it to you. I chose the Ebean 4x Enhancement option, install it and restart Intellij. Now, go to Build and make sure that 'Ebean 4x Enhancement' is enabled. Now you can run your tests with Intellij!

like image 147
Valter Silva Avatar answered Mar 19 '26 10:03

Valter Silva



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!