Announcement Announcement Module
Collapse
No announcement yet.
GRAVE: Context initialization failed Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • GRAVE: Context initialization failed

    hello

    I'm using jsf2 , spring , hibernate to devalope web application . in my Databases I have 13 tables for example I have utilisateur ---(UtilisateurPartenaire)---partenaire
    Tb utilisateur is for user and partenaire is for partner and I have association with the both UtilisateurPartenaire which have they both primary key of the utilisateur and partenaire . when I try to run application I get this error and I don't know what I should make !!


    HTML Code:
    
    INFO: Initializing Spring root WebApplicationContext
    1 sept. 2011 16:19:59 org.springframework.web.context.ContextLoader initWebApplicationContext
    INFO: Root WebApplicationContext: initialization started
    1 sept. 2011 16:19:59 org.springframework.context.support.AbstractApplicationContext prepareRefresh
    INFO: Refreshing [email protected]11dba45: display name [Root WebApplicationContext]; startup date [Thu Sep 01 16:19:59 WET 2011]; root of context hierarchy
    1 sept. 2011 16:19:59 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
    1 sept. 2011 16:19:59 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
    INFO: Bean factory for application context [[email protected]11dba45]: org.springframework.beans.factory.support.
    1 sept. 2011 16:20:01 org.hibernate.cfg.HbmBinder bindCollection
    INFO: Mapping collection: com.restaurants.model.Plat.partenaires -> partenaireplat
    1 sept. 2011 16:20:01 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
    INFO: Mapping class: com.restaurants.model.Quartier -> quartier
    1 sept. 2011 16:20:01 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
    INFO: Mapping class: com.restaurants.model.Utilisateur -> utilisateur
    1 sept. 2011 16:20:01 org.hibernate.cfg.HbmBinder bindCollection
    INFO: Mapping collection: com.restaurants.model.Utilisateur.partenaires -> partenaireutilisateur
    1 sept. 2011 16:20:01 org.hibernate.cfg.HbmBinder bindCollection
    INFO: Mapping collection: com.restaurants.model.Utilisateur.partenaires_1 -> partenaireutilisateur
    1 sept. 2011 16:20:01 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
    INFO: Mapping class: com.restaurants.model.Ville -> ville
    1 sept. 2011 16:20:01 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
    INFO: Mapping collection: com.restaurants.model.Utilisateur.lignedecommandes -> lignedecommande
    1 sept. 2011 16:20:01 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
    INFO: Mapping collection: com.restaurants.model.Utilisateur.commenatires -> commenatire
    1 sept. 2011 16:20:01 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
    INFO: Mapping collection: com.restaurants.model.Utilisateur.alertes -> alerte
    1 sept. 2011 16:20:01 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
    INFO: Mapping collection: com.restaurants.model.Ville.quartiers -> quartier
    [COLOR="#FF0000"]1 sept. 2011 16:20:01 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
    INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@61736e: defining beans [propertyConfigurer,dataSource,sessionFactory,jdbcExceptionTranslator,hibernateTemplate,transactionManager,alerteDao,alerteService,commandeDao,commandeService,fraisdelivraisonDao,fraisdelivraisonService,gestionCommandeDao,gestionCommandeService,gestioncompteDao,gestioncompteService,gestionPartenaireDao,gestionPartenaireService,gestionPlatDao,gestionPlatService,horaireDao,horaireService,loginDao,loginService,lignedeCommandedao,lignedeCommandeService,partenaireDao,partenaireService,platDao,platService,quartierDao,quartierService,utilisateurDao,utilisateurService,villeDao,villeService]; root of factory hierarchy
    1 sept. 2011 16:20:01 org.springframework.web.context.ContextLoader initWebApplicationContext
    GRAVE: Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: An association from the table partenaireplat refers to an unmapped class: com.restaurants.model.hbm.Partenaire
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
    Caused by: org.hibernate.MappingException: An association from the table partenaireplat refers to an unmapped class: com.restaurants.model.hbm.Partenaire
    	at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1252)
    	at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1170)
    	at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
    	at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:673)
    	at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
    	... 30 more
    1 sept. 2011 16:20:01 org.apache.catalina.core.StandardContext listenerStart
    GRAVE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: An association from the table partenaireplat refers to an unmapped class: com.restaurants.model.hbm.Partenaire
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    	
    
    [/COLOR]

  • #2
    Have actually read the stack trace?

    Code:
    Caused by: org.hibernate.MappingException: An association from the table partenaireplat refers to an unmapped class: com.restaurants.model.hbm.Partenaire
    Which means that that class isn't known by hibernate to be an Entity...

    Comment


    • #3
      404 page

      hello




      I m using jsf2 , spring ; hibernate when I run my programme I don't get any exception but its show me 404 page here is the result of the run
      <code>
      2 sept. 2011 19:38:28 org.apache.catalina.core.AprLifecycleListener init
      INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;C:\Windows\Sun\Java\bin;C:\Win dows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\Sys tem32\Wbem;C:\Windows\System32\WindowsPowerShell\v 1.0\;C:\Program Files\TortoiseSVN\bin;C:\Users\FUTUR\Desktop\eclip se;;.
      2 sept. 2011 19:38:29 org.apache.tomcat.util.digester.SetPropertiesRule begin
      ATTENTION: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ENSIAS' did not find a matching property.
      2 sept. 2011 19:38:29 org.apache.coyote.http11.Http11Protocol init
      .....

      2 sept. 2011 19:38:30 org.hibernate.connection.ConnectionProviderFactory newConnectionProvider
      INFO: Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSource ConnectionProvider
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: RDBMS: MySQL, version: 5.5.8-log
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.15 ( Revision: ${bzr.revision-id} )
      2 sept. 2011 19:38:31 org.hibernate.dialect.Dialect <init>
      INFO: Using dialect: org.hibernate.dialect.MySQLDialect
      2 sept. 2011 19:38:31 org.hibernate.transaction.TransactionFactoryFactor y buildTransactionFactory
      INFO: Transaction strategy: org.springframework.orm.hibernate3.SpringTransacti onFactory
      2 sept. 2011 19:38:31 org.hibernate.transaction.TransactionManagerLookup Factory getTransactionManagerLookup
      INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Automatic flush during beforeCompletion(): disabled
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Automatic session close at end of transaction: disabled
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: JDBC batch size: 15
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: JDBC batch updates for versioned data: disabled
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Scrollable result sets: enabled
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: JDBC3 getGeneratedKeys(): enabled
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Connection release mode: auto
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Maximum outer join fetch depth: 2
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Default batch fetch size: 1
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Generate SQL with comments: disabled
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Order SQL updates by primary key: disabled
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Order SQL inserts for batching: disabled
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
      INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
      2 sept. 2011 19:38:31 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
      INFO: Using ASTQueryTranslatorFactory
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Query language substitutions: {}
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: JPA-QL strict compliance: disabled
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Second-level cache: enabled
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Query cache: disabled
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory createCacheProvider
      INFO: Cache provider: org.hibernate.cache.HashtableCacheProvider
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Optimize cache for minimal puts: disabled
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Structured second-level cache entries: disabled
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Echoing all SQL to stdout
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Statistics: disabled
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Deleted entity synthetic identifier rollback: disabled
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Default entity-mode: pojo
      2 sept. 2011 19:38:31 org.hibernate.cfg.SettingsFactory buildSettings
      INFO: Named query checking : enabled
      2 sept. 2011 19:38:31 org.hibernate.impl.SessionFactoryImpl <init>
      INFO: building session factory
      2 sept. 2011 19:38:32 org.hibernate.impl.SessionFactoryObjectFactory addInstance
      INFO: Not binding factory to JNDI, no JNDI name configured
      2 sept. 2011 19:38:32 org.springframework.beans.factory.xml.XmlBeanDefin itionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
      2 sept. 2011 19:38:32 org.springframework.jdbc.support.SQLErrorCodesFact ory <init>
      INFO: SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
      2 sept. 2011 19:38:32 org.springframework.orm.hibernate3.HibernateTransa ctionManager afterPropertiesSet
      INFO: Using DataSource [org.springframework.jdbc.datasource.DriverManagerD ataSource@179a49f] of Hibernate SessionFactory for HibernateTransactionManager
      2 sept. 2011 19:38:32 org.springframework.web.context.ContextLoader initWebApplicationContext
      INFO: Root WebApplicationContext: initialization completed in 2581 ms
      2 sept. 2011 19:38:32 com.sun.faces.config.ConfigureListener contextInitialized
      INFO: Initialisation de Mojarra 2.0.3 (FCS b03) pour le contexte '/ENSIAS'
      2 sept. 2011 19:38:33 org.apache.coyote.http11.Http11Protocol start
      INFO: Démarrage de Coyote HTTP/1.1 sur http-8080
      2 sept. 2011 19:38:33 org.apache.jk.common.ChannelSocket init
      INFO: JK: ajp13 listening on /0.0.0.0:8009
      2 sept. 2011 19:38:33 org.apache.jk.server.JkMain start
      INFO: Jk running ID=0 time=0/28 config=null
      2 sept. 2011 19:38:33 org.apache.catalina.startup.Catalina start
      INFO: Server startup in 4338 ms

      </code>

      Comment

      Working...
      X