JCERTIFLab / jcertif-backend-2013

JCertif Back End 2013
0 stars 4 forks source link

Données référentielles absentes au démarrage de l'application #137

Closed roddet closed 11 years ago

roddet commented 11 years ago

Lorsque l'application démarre les données référentiels du fichier conf/referentiel.js ne sont pas accessibles via l'application.

Exemple : Ce fichier contient les données concernant les civilités mais lorsqu'on intéroge le service côté intégration, une liste vide est renvoyée : http://jcertif-backend.roddet.cloudbees.net/ref/title/list

martialsomda commented 11 years ago

huuum...pas évident ce bug..il n'y pas de raison évidente pour laquelle les données ne seraient pas insérées. As-ton la possibilité d'écrire sur le file système sous cloudbees? dans ce cas on pourrait configurer un Appender de type File pour l'appli et avoir plus d'infos

roddet commented 11 years ago

Reproduis-tu ce bug en local ? Pour ta question, oui on a accès aux logs avec du log standard Play.

Ci-dessous les logs. N'y a t-il pas un cache mis en place ? Il se peut que le cache soit chargé avant la mise à jour du référentiel.

:

Play server process ID is 13274 2013-05-10 07:11:18,730 - [INFO] - from application in main JCertif Backend Application running

2013-05-10 07:11:18,733 - [INFO] - from application in main Initialisation des données de référence

2013-05-10 07:11:18,736 - [INFO] - from application in main Enter MongoDB()

2013-05-10 07:11:18,739 - [DEBUG] - from application in main dbhost=linus.mongohq.com, dbname=tufw9szJxEZ0qJkeuwanXw, user=jcertif, password=***, dbport=10056

2013-05-10 07:11:18,810 - [INFO] - from application in main Enter getDBOptions()

2013-05-10 07:11:18,827 - [INFO] - from application in main Exit getDBOptions()

2013-05-10 07:11:19,092 - [INFO] - from application in main Exit MongoDB()

2013-05-10 07:11:19,092 - [INFO] - from application in main Enter loadDbWithData(referentiel.js)

2013-05-10 07:11:19,110 - [INFO] - from application in main Exit getDBOptions()

2013-05-10 07:11:19,119 - [INFO] - from play in main Application started (Prod)

2013-05-10 07:11:19,314 - [INFO] - from play in main Listening for HTTP on /0.0.0.0:8655

2013-05-10 07:11:25,386 - [INFO] - from application in play-akka.actor.default-dispatcher-4 JCertif Backend onHandlerNotFound Global Handler

2013-05-10 07:11:28,606 - [INFO] - from application in play-akka.actor.default-dispatcher-5 JCertif Backend onHandlerNotFound Global Handler

martialsomda commented 11 years ago

non il n'y a pas de cache mais la log "JCertif Backend onHandlerNotFound Global Handler" indique un problème de routage....Peux tu me copier/coller la log autour de l'appel à l'url /ref/title/list? Pour info je ne reproduit pas en local

roddet commented 11 years ago

Ce que je t'ai fourni représente l'intégralité des logs :) Pour aider au diagnostique, pourrais-tu ajouter des traces et commiter ?

martialsomda commented 11 years ago

Alors?..a-t-on plus de logs?

roddet commented 11 years ago

Ci-dessous les logs :

Play server process ID is 30498 [info] application - JCertif Backend Application running [info] application - Initialisation des données de référence [info] application - Enter MongoDB() [debug] application - dbhost=linus.mongohq.com, dbname=tufw9szJxEZ0qJkeuwanXw, user=jcertif, password=***, dbport=10056 [info] application - Enter getDBOptions() [info] application - Exit getDBOptions() [info] application - Exit MongoDB() [info] application - Enter loadDbWithData(referentiel.js) [info] application - Exit getDBOptions() [info] play - Application started (Prod) [info] play - Listening for HTTP on /0.0.0.0:8764 [info] application - JCertif Backend onHandlerNotFound Global Handler [info] application - JCertif Backend onHandlerNotFound Global Handler [debug] application - Requested URL : /ref/sponsorlevel/list [debug] application - list(collectionName=sponsor_level, query={ "deleted" : "false"}) [info] application - JCertif Backend onHandlerNotFound Global Handler [debug] application - Requested URL : / [debug] application - Requested URL : /session/list [debug] application - list(collectionName=session, query={ "deleted" : "false"}) [debug] application - Requested URL : /participant/list [debug] application - list(collectionName=participant, query={ "deleted" : "false"}) [debug] application - Requested URL : /speaker/list [debug] application - list(collectionName=speaker, query={ "deleted" : "false"}) [debug] application - Requested URL : /ref/sessionstatus/list [debug] application - Requested URL : /ref/category/list [debug] application - list(collectionName=session_status, query={ "deleted" : "false"}) [debug] application - list(collectionName=category, query={ "deleted" : "false"}) [debug] application - Requested URL : /ref/title/list [debug] application - list(collectionName=title, query={ "deleted" : "false"}) [debug] application - Requested URL : /ref/sponsorlevel/list [debug] application - list(collectionName=sponsor_level, query={ "deleted" : "false"}) [info] application - titles : [] [debug] application - Requested URL : /ref/category/list [debug] application - list(collectionName=category, query={ "deleted" : "false"}) [debug] application - Requested URL : /login/oauth/v2/authorize [debug] application - readOne(collectionName=client, query={ "client_id" : "backoffice" , "deleted" : "false"}) [info] application - state : xyz [info] application - redirect_uri : http://localhost:9000/backoffice/home [info] application - scope : user,admin [debug] application - Requested URL : /login/oauth/v2/authorize [debug] application - readOne(collectionName=client, query={ "client_id" : "backoffice" , "deleted" : "false"}) [info] application - state : xyz [info] application - redirect_uri : http://localhost:9000/backoffice/home [info] application - scope : user,admin [info] application - JCertif Backend onHandlerNotFound Global Handler [debug] application - Requested URL : /ref/category/list [debug] application - list(collectionName=category, query={ "deleted" : "false"}) [info] application - JCertif Backend onHandlerNotFound Global Handler [debug] application - Requested URL : /ref/title/list [debug] application - list(collectionName=title, query={ "deleted" : "false"}) [info] application - titles : [] [info] application - JCertif Backend onHandlerNotFound Global Handler

martialsomda commented 11 years ago

A priori la recherche ne remonte rien...soit elle est boguée soit rien n'a est inséré dans la base au démarrage de l'appli..peux tu m'envoyer par mail le login/pwd de la base?

martialsomda commented 11 years ago

La recherche de données n'est pas bogué, c'est l'initialisation via la fonction mongo $eval qui na marche pas..il faut que je refasse un peu de lecture mais de souvenir cette fonction ne marche pas dans une certaine configuration de base (quand elle est shardé je pense)...

roddet commented 11 years ago

Effectivement le $eval doit être désactivé en mode production de MongoDB. Il faut donc injecter les données proprement. Peut-être ne mettre que du JSON dans le fichier et le récupérer puis l'exécuter au démarrage de l'application.

Cela serait pas mal d'initier aussi à l'occasion un jeu de données complémentaire au referentiel.js que l'on n'exécuterait pas en production et qui contiendrait les données sur les sponsors, les speakers et l'agenda. Le site web en cours de développement en a besoin assez rapidement.

martialsomda commented 11 years ago

Au démarrage de l'appli, une class (DBInitializer) lit le contenu du fichier referentiel.js et crée les objet java correspondant aux insertion à effectuer puis les sauvegarde en base. http://jcertif-backend.msomda.cloudbees.net/ref/title/list Les données complémentaires concernant les sponsors, salles, agenda etc arrivent..