IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Hibernate Java Discussion :

eclipse hibernate JSF 1.2


Sujet :

Hibernate Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Novembre 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : France, Finistère (Bretagne)

    Informations forums :
    Inscription : Novembre 2006
    Messages : 33
    Par défaut eclipse hibernate JSF 1.2
    Bonjour a tous,
    j'ai un petit soucis que j'ai bien du mal à résoudre.

    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
    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 : 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
    <?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 : Sélectionner tout - Visualiser dans une fenêtre à part
    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 : 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
    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.

  2. #2
    Membre Expert Avatar de willoi
    Profil pro
    Développeur informatique
    Inscrit en
    Décembre 2006
    Messages
    1 355
    Détails du profil
    Informations personnelles :
    Âge : 52
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Décembre 2006
    Messages : 1 355
    Par défaut
    Cela veut dire que ton appli ne trouve pas le fichier Affaire.hbm.xml dans le dossier hibernate.

    As-tu vérifier qu'il y est ?

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Novembre 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : France, Finistère (Bretagne)

    Informations forums :
    Inscription : Novembre 2006
    Messages : 33
    Par défaut
    Oui.
    Que se soit dans le répertoire hibernate du répertoire src ou du répertoire généré après compilation c'est à dire build\classes\hibernate.

  4. #4
    Membre averti
    Profil pro
    Inscrit en
    Novembre 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : France, Finistère (Bretagne)

    Informations forums :
    Inscription : Novembre 2006
    Messages : 33
    Par défaut
    bon j'ai reussi a faire fonctionné mon projet.

    j'ai recrée un nouveau projet dans eclipse et j'ai refait toute les manip de génération de fichiers j'ai ensuite copié mais fichier de code dans le workspace et sa fonctionne maintenant.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [SGBD] Connexion de Eclipse (Hibernate) vers SQL Server
    Par Michel38 dans le forum Hibernate
    Réponses: 4
    Dernier message: 11/03/2012, 16h39
  2. Eclipse-Hibernate-erreur Execution
    Par Invité dans le forum Hibernate
    Réponses: 18
    Dernier message: 22/06/2006, 09h37
  3. Hibernate-JSF
    Par zakjo_developper dans le forum Hibernate
    Réponses: 7
    Dernier message: 10/05/2006, 11h32
  4. [Install] Eclipse hibernate synchroniser
    Par bonododo dans le forum Eclipse Java
    Réponses: 3
    Dernier message: 08/02/2006, 13h13
  5. [hibernate] Tutoriel eclipse+hibernate synchronizer
    Par Didier69 dans le forum Eclipse Java
    Réponses: 4
    Dernier message: 06/10/2005, 16h19

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo