0 Replies Latest reply on Aug 21, 2006 8:08 PM by Eric Ray

    cannot create an EntityManagerFactory

    Eric Ray Novice

       

      Persistence.createEntityManagerFactory("unitName");
      


      This code does not work an JBoss. This is logged
      19:00:56,046 INFO [NamingHelper] JNDI InitialContext properties:{}
      19:00:56,046 INFO [DatasourceConnectionProvider] Using datasource: java:/PostgresDCAP
      19:00:56,046 INFO [SettingsFactory] RDBMS: PostgreSQL, version: 8.1.4
      19:00:56,046 INFO [SettingsFactory] JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.2devel JDBC3 with SSL (build 503)
      19:00:56,046 INFO [Dialect] Using dialect: org.hibernate.dialect.PostgreSQLDialect
      19:00:56,046 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
      19:00:56,046 INFO [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
      19:00:56,046 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
      19:00:56,046 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
      19:00:56,046 INFO [SettingsFactory] JDBC batch size: 15
      19:00:56,046 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
      19:00:56,046 INFO [SettingsFactory] Scrollable result sets: enabled
      19:00:56,046 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
      19:00:56,046 INFO [SettingsFactory] Connection release mode: auto
      19:00:56,046 INFO [SettingsFactory] Default batch fetch size: 1
      19:00:56,046 INFO [SettingsFactory] Generate SQL with comments: disabled
      19:00:56,046 INFO [SettingsFactory] Order SQL updates by primary key: disabled
      19:00:56,046 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
      19:00:56,046 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
      19:00:56,046 INFO [SettingsFactory] Query language substitutions: {}
      19:00:56,046 INFO [SettingsFactory] Second-level cache: enabled
      19:00:56,046 INFO [SettingsFactory] Query cache: disabled
      19:00:56,046 INFO [SettingsFactory] Cache provider: org.hibernate.cache.EhCacheProvider
      

      and then the following exception is thrown:
      java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
       at java.lang.Class.getDeclaredConstructors0(Native Method)
       at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
       at java.lang.Class.getConstructor0(Class.java:2640)
       at java.lang.Class.newInstance0(Class.java:321)
       at java.lang.Class.newInstance(Class.java:303)
       at org.hibernate.cfg.SettingsFactory.createCacheProvider(SettingsFactory.java:346)
       at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:220)
       at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1928)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
       at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631)
       at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760)
       at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:151)
       at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:205)
       at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114)
       at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
       at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
       at com.vicor.distributedcapture.session.CodeEntityConverter.getAsObject(CodeEntityConverter.java:20)
       at org.apache.myfaces.renderkit.RendererUtils.getConvertedUIOutputValue(RendererUtils.java:658)
       at org.apache.myfaces.renderkit.html.HtmlMenuRendererBase.getConvertedValue(HtmlMenuRendererBase.java:111)
       at javax.faces.component.UIInput.getConvertedValue(UIInput.java:289)
       at javax.faces.component.UIInput.validate(UIInput.java:265)
       at javax.faces.component.UIInput.processValidators(UIInput.java:144)
       at javax.faces.component.UIData.process(UIData.java:514)
       at javax.faces.component.UIData.processColumnChildren(UIData.java:498)
       at javax.faces.component.UIData.processValidators(UIData.java:403)
       at javax.faces.component.UIForm.processValidators(UIForm.java:68)
       at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:417)
       at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:142)
       at org.apache.myfaces.lifecycle.LifecycleImpl.processValidations(LifecycleImpl.java:240)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      

      Any ideas why?