Elastics search + morphia + playframework


(inforux) #1

hi.
well I do not use English well.

problem: " No datasource configured"

file:Aplication.conf

#db=mem
module.morphia=${play.path}/modules/morphia-1.2.3d
morphia.db.host=127.0.0.1
morphia.db.port=27017
morphia.db.name=DB-A1
#morphia.db.username=admin
#morphia.db.password=admin
morphia.id.type=Long
#elasticsearch
elasticsearch.local=true

file: User.java

package models;
import play.modules.morphia.Model;
import play.modules.elasticsearch.annotations.ElasticSearchIgnore;
import play.modules.elasticsearch.annotations.ElasticSearchable;
@ElasticSearchable
@Entity
public class User extends Model{
@Required
public String nombres;
@Required
public String apellidos;
@ElasticSearchIgnore
@Required
public String sexo;
public User(String name, String lastname, String sexo){
this.sexo=sexo;
this.nombres=name;
this.apellidos=lastname;
}
}

the outdisplay on play is: inforux@PC-LINUX:~$ play run netbookPlayA1 ~ _ _ ~ _ __ | | __ _ _ _| | ~ | '_ \| |/ _' | || |_| ~ | __/|_|\____|\__ (_) ~ |_| |__/ ~ ~ play! 1.2.3, http://www.playframework.org ~ ~ Ctrl+C to stop ~ Listening for transport dt_socket at address: 8000 17:48:19,357 INFO ~ Starting /home/inforux/netbookPlayA1 17:48:19,366 WARN ~ Declaring modules in application.conf is deprecated. Use dependencies.yml instead (module.secure) 17:48:19,367 INFO ~ Module secure is available (/home/inforux/play/ modules/secure) 17:48:19,367 WARN ~ Declaring modules in application.conf is deprecated. Use dependencies.yml instead (module.morphia) 17:48:19,378 INFO ~ Module morphia is available (/home/inforux/play/ modules/morphia-1.2.3d) 17:48:19,380 INFO ~ Module crud is available (/home/inforux/play/ modules/crud) 17:48:19,380 INFO ~ Module elasticsearch is available (/home/ inforux/ play/modules/elasticsearch-0.3) 17:48:20,737 WARN ~ You're running Play! in DEV mode 17:48:21,034 INFO ~ Listening for HTTP at /127.0.0.1:9000 (Waiting a first request to start) ... 07/11/2011 05:50:14 PM com.google.code.morphia.logging.MorphiaLoggerFactory chooseLoggerFactory INFO: LoggerImplFactory set to com.google.code.morphia.logging.jdk.JDKLoggerFactory 17:50:15,933 INFO ~ Starting Elastic Search for Play! in Local Mode 17:50:16,170 INFO ~ [Toro] {elasticsearch/0.17.6}[7354]: initializing ... 17:50:16,212 INFO ~ [Toro] loaded [], sites [] 17:50:19,801 INFO ~ [Toro] {elasticsearch/0.17.6}[7354]: initialized 17:50:19,802 INFO ~ [Toro] {elasticsearch/0.17.6}[7354]: starting ... 17:50:19,809 INFO ~ [Toro] bound_address {local[1]}, publish_address {local[1]} 17:50:19,819 INFO ~ [Toro] new_master [Toro][1][local[1]] {local=true}, reason: local-disco-initial_connect(master) 17:50:19,826 INFO ~ [Toro] elasticsearch/1 17:50:20,481 INFO ~ [Toro] bound_address {inet[/ 0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/192.168.40.105:9200]} 17:50:20,485 INFO ~ [Toro] {elasticsearch/0.17.6}[7354]: started 17:50:21,132 ERROR ~ @68b7hj8mo Internal Server Error (500) for request GET / JPA error A JPA error occurred (Cannot start a JPA manager without a properly configured database): No datasource configured play.exceptions.JPAException: Cannot start a JPA manager without a properly configured database at play.db.jpa.JPAPlugin.onApplicationStart(JPAPlugin.java: 108) at play.plugins.PluginCollection.onApplicationStart(PluginCollection.java: 425) at play.Play.start(Play.java:495) at play.Play.detectChanges(Play.java:599) at play.Invoker$Invocation.init(Invoker.java:186) at Invocation.HTTP Request(Play!) Caused by: java.lang.NullPointerException: No datasource configured ... 6 more well... I hope your help. thanks

the problem could be "river" for mongo? ....
In this page http://www.matt-reid.co.uk/blog_post.php?id=68#&slider1=4
.... but I do not know apply with playframework.

sorry for my English. but i'm peruvian


(system) #2