Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The default EbeanServer has not been defined?

PersistenceException: The default EbeanServer has not been defined? This is normally set via the ebean.datasource.default property. Otherwise it should be registered programatically via registerServer()

Hi, I am getting above exception.i am trying to write sql query like

String sql = "select r.cpu as cpu, r.ram as ram, r.core as core"+"from res r,env e,env_reser"+"where e.node =1 and e.host= 1 and e.apps= 1 and er.eid=e.eid and r.rid=er.rid";
SqlRow bug = Ebean.createSqlQuery(sql)
.setParameter("h",1)
.setParameter("n",1 )
.setParameter("a",1 )
.findUnique();

in Models package res.java file.

If i comment above code error disappears. Can anybody plz help me.

Thanku

like image 378
Juhi Jariwala Avatar asked Mar 27 '26 21:03

Juhi Jariwala


1 Answers

As said in the docs under the section Persist Tasks in the Database (the section is about 3/4's down the page), the ebean default server can be connected to the models packages by adding the following line to you conf/application.conf file:

ebean.default = "models.*"
like image 150
2manyprojects Avatar answered Apr 02 '26 22:04

2manyprojects