eclipse hibernate JSF 1.2
Bonjour a tous,
j'ai un petit soucis que j'ai bien du mal à résoudre.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
| 156 [http-80-1] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
156 [http-80-1] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
266 [http-80-1] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : hibernate/Affaire.hbm.xml
8 avr. 2009 14:37:13 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: "Servlet.service()" pour la servlet Faces Servlet a g�n�r� une exception
org.hibernate.MappingNotFoundException: resource: hibernate/Affaire.hbm.xml not found
at org.hibernate.cfg.Configuration.addResource(Configuration.java:596)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1621)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1589)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1568)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1542)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1448)
at util.HibernateUtil.<clinit>(HibernateUtil.java:13)
at hibernate.bean.ProjetBean.<init>(ProjetBean.java:13)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:188)
at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:105)
at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:369)
at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:222)
at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:88)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:73)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:61)
at org.apache.el.parser.AstValue.getValue(AstValue.java:107)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
at javax.faces.component.UIData.getValue(UIData.java:608)
at javax.faces.component.UIData.getDataModel(UIData.java:1112)
at javax.faces.component.UIData.setRowIndex(UIData.java:450)
at com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:77)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:802)
at javax.faces.component.UIData.encodeBegin(UIData.java:950)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:934)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:273)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:204)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source) |
étant sous éclipse, voilà le découpage de mon projet
Projet
|
|-- src
| |-- hibernate
| | |--besoin.hdm.xml (et tous les autres)
| | |--besoin.java (et tous les autres)
| |-- hibernate.bean
| | |--BesoinBean.java (et tous les autres)
| |-- hibernate.base
| | |--Basebesoin.java (et tous les autres)
|- webContent
| |-- META-INF
| |-- WEB-INF(etc)
mon web.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>SPAJSF</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
</web-app> |
mon faces-config.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| <?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
version="1.2">
<managed-bean>
<managed-bean-name>ProjetBean</managed-bean-name>
<managed-bean-class>hibernate.bean.ProjetBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config> |
mon hibernate.cfg.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory >
<!-- local connection properties -->
<property name="hibernate.connection.url">jdbc:mysql://localhost/spa</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.username">spa</property>
<property name="hibernate.connection.password">spa</property>
<!-- property name="hibernate.connection.pool_size"></property -->
<!-- dialect for MySQL -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.current_session_context_class">org.hibernate.context.ThreadLocalSessionContext</property>
<mapping resource="hibernate/Affaire.hbm.xml" />
<mapping resource="hibernate/Associer.hbm.xml" />
<mapping resource="hibernate/Avancer.hbm.xml" />
<mapping resource="hibernate/Besoin.hbm.xml" />
<mapping resource="hibernate/Cde.hbm.xml" />
<mapping resource="hibernate/Commenter.hbm.xml" />
<mapping resource="hibernate/Contrat.hbm.xml" />
<mapping resource="hibernate/Critere.hbm.xml" />
<mapping resource="hibernate/Da.hbm.xml" />
<mapping resource="hibernate/Detailha.hbm.xml" />
<mapping resource="hibernate/Dpi.hbm.xml" />
<mapping resource="hibernate/Echellenote.hbm.xml" />
<mapping resource="hibernate/Etatbesoin.hbm.xml" />
<mapping resource="hibernate/Fournisseur.hbm.xml" />
<mapping resource="hibernate/Grouputilisateur.hbm.xml" />
<mapping resource="hibernate/Jalonpaiment.hbm.xml" />
<mapping resource="hibernate/Livreblanc.hbm.xml" />
<mapping resource="hibernate/Noter.hbm.xml" />
<mapping resource="hibernate/Passer.hbm.xml" />
<mapping resource="hibernate/Presentir.hbm.xml" />
<mapping resource="hibernate/Produit.hbm.xml" />
<mapping resource="hibernate/Prtc.hbm.xml" />
<mapping resource="hibernate/Qualimetrie.hbm.xml" />
<mapping resource="hibernate/Recevoir.hbm.xml" />
<mapping resource="hibernate/Sow.hbm.xml" />
<mapping resource="hibernate/Suivre.hbm.xml" />
<mapping resource="hibernate/T.hbm.xml" />
<mapping resource="hibernate/Utilisateur.hbm.xml" />
</session-factory>
</hibernate-configuration> |
Pouvez-vous m'aider*?
Dernière info
lorsque je fais un test en mode console cela fonctionne bien.
Et pour le JSF quand je fais une page de test, genre, hello World cela fonctionne aussi.