Reputation: 65
I've ran into some strange issue trying to configure access to two oracle databases. Here is what my config file looks like:
db.default.url="jdbc:oracle:thin:@db1:1521:DB1"
db.default.driver=oracle.jdbc.driver.OracleDriver
db.default.user=username1
db.default.password=password1
db.db2.url="jdbc:oracle:thin:@db2:1521:DB2"
db.db2.driver=oracle.jdbc.driver.OracleDriver
db.db2.user=username2
db.db2.password=password2
ebean.default="model.db.Class1,model.db.Class2"
ebean.db2="model.db2.Class3,model.db2.Class4"
Class1 has declaration of an enum that is used for one of the class's properties.
At the runtime upon application start I get an exception:
play.api.UnexpectedException: Unexpected exception [NoClassDefFoundError: models/db Class1$myEnum] at lay.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3$$anonfun$1.apply(ApplicationProvider.scala:134) ~[play_2.9.1.jar:2.0.4]
...
It looks like Ebean can not find declaration of my enum when classes are listed individually in the configuration file. If I remove configuration of the second database from my application.conf and replace definition of ebean.default with "models.*", everything works fine.
Any help would be greatly appreciated.
Vlad.
Upvotes: 1
Views: 438
Reputation: 922
As far as I know, you have to put the model classes into separate packages, you can't reference single classes.
So in your case it would be:
ebean.default="model.db.*"
ebean.db2="model.db2.*"
Upvotes: 1