Bonjour,
Je n'ai pas trouvé beaucoup d'infos sur mon problèmes, peut être pourrez vous m'aider.
Je développe un web service avec CXF Spring et Hibernate.
Le problème c'est que je n'arrive pas à accéder à ma base de données.
L'application était indépendante, j'ai greffé un nouveau projet avec les managers du webservice et les fichiers de configs genre web.xml et beans.xml
Je ne sais pas où il faut déclarer que j'utilise hibernate, dans l'application toutes les connexions sont déjà faites.
Y'a t il un bean spécifique à déclarer ?
La compilation marche, le déploiement su service web également, ça plante juste à l'appel, lors de l'appel de l'entity manager :
voici la couche Dao qui appelle la BDD :
et mon beans.xml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 @Service public class DaoImpl implements Dao { @PersistenceContext(unitName = "defaultPersistentUnit") protected EntityManager em; public List<ReportCampaign> findReportCampaignByCampaignMaster( Long idCampaignMaster) { System.out.println("petite victoire !!"); System.out.println("je pense que em plante"); System.out.println(em.getClass()); Query query = this.em.createNativeQuery( "SELECT RC.TITLE " + " FROM REPORT_CAMPAIGN RC " + " WHERE CAMPAIGN_ID=:idcamp "); query.setParameter("idcamp", idCampaignMaster); List<ReportCampaign> list = query.getResultList(); return list; }
J'utilise Tomcat55, Java5, Eclipse 3.6, Spring 2.5.6, Hibernate 3.2.7
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> <import resource="classpath:META-INF/cxf/cxf.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor" /> <bean id="manager" class="com.atosorigin.megacamp.ws.service.impl.ManagerImpl" /> <bean id="rc_manager" class="com.atosorigin.megacamp.service.impl.ReportCampaignManagerImpl2" /> <bean id="daoImpl" class="com.atosorigin.megacamp.dao.hibernate.DaoImpl" /> <jaxws:endpoint id="managerImpl" implementor="#manager" address="/ManagerImpl" /> </beans>
Merci d'avance pour votre aide ou vos conseils.
Peipsy
Partager