2 Replies Latest reply on Jan 30, 2007 2:57 PM by xiaobo chen

    Hibernate NOT working for me with JBoss--Please Help!  #$%%^

    Russ Newbie

      I have a simple Struts application which uses Hibernate, MySQL, eclipse 3.1, MyEclipse workbench 4.1. The application is running on JBOSS 4.0.3SP1

      When I call the jsp, everything seems to be working fine, but Hibernate is not locating some specific file. I have not made any unique changes to the normal configuration. I've follow the basic setup instructions for adding Struts and Hibernate capabilities to my project.

      I am getting the following error from the server.

      [09:35:24,109] [INFO ] [PropertyMessageResources] Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
      [09:35:24,125] [INFO ] [PropertyMessageResources] Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
      [09:35:24,125] [INFO ] [PropertyMessageResources] Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
      [09:35:24,125] [INFO ] [PropertyMessageResources] Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
      [09:35:24,234] [INFO ] [Environment] Hibernate 3.1
      [09:35:24,250] [INFO ] [Environment] hibernate.properties not found
      [09:35:24,265] [INFO ] [Environment] using CGLIB reflection optimizer
      [09:35:24,265] [INFO ] [Environment] using JDK 1.4 java.sql.Timestamp handling
      [09:35:24,515] [INFO ] [Configuration] configuring from resource: /hibernate.cfg.xml
      [09:35:24,515] [INFO ] [Configuration] Configuration resource: /hibernate.cfg.xml
      [09:35:24,531] [INFO ] [Configuration] Reading mappings from resource: com/rrcorp/hibernate/Catalog.hbm.xml
      [09:35:24,734] [INFO ] [HbmBinder] Mapping class: com.rrcorp.hibernate.Catalog -> catalog
      [09:35:24,781] [INFO ] [Configuration] Configured SessionFactory: null
      [09:35:24,781] [INFO ] [Configuration] processing extends queue
      [09:35:24,781] [INFO ] [Configuration] processing collection mappings
      [09:35:24,781] [INFO ] [Configuration] processing association property references
      [09:35:24,781] [INFO ] [Configuration] processing foreign key constraints
      [09:35:25,015] [INFO ] [DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
      [09:35:25,015] [INFO ] [DriverManagerConnectionProvider] Hibernate connection pool size: 20
      [09:35:25,015] [INFO ] [DriverManagerConnectionProvider] autocommit mode: false
      [09:35:25,031] [INFO ] [DriverManagerConnectionProvider] using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/test
      [09:35:25,031] [INFO ] [DriverManagerConnectionProvider] connection properties: {user=root, password=root}
      [09:35:25,859] [INFO ] [SettingsFactory] RDBMS: MySQL, version: 5.0.16-nt
      [09:35:25,859] [INFO ] [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.11 ( $Date: 2005-09-21 18:20:03 +0000 (Wed, 21 Sep 2005) $, $Revision: 4287 $ )
      [09:35:25,953] [INFO ] [Dialect] Using dialect: org.hibernate.dialect.MySQLDialect
      [09:35:25,968] [INFO ] [TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions)
      [09:35:25,984] [INFO ] [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
      [09:35:25,984] [INFO ] [SettingsFactory] Automatic flush during beforeCompletion(): disabled
      [09:35:25,984] [INFO ] [SettingsFactory] Automatic session close at end of transaction: disabled
      [09:35:25,984] [INFO ] [SettingsFactory] JDBC batch size: 15
      [09:35:25,984] [INFO ] [SettingsFactory] JDBC batch updates for versioned data: disabled
      [09:35:25,984] [INFO ] [SettingsFactory] Scrollable result sets: enabled
      [09:35:25,984] [INFO ] [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
      [09:35:25,984] [INFO ] [SettingsFactory] Connection release mode: auto
      [09:35:26,000] [INFO ] [SettingsFactory] Maximum outer join fetch depth: 2
      [09:35:26,000] [INFO ] [SettingsFactory] Default batch fetch size: 1
      [09:35:26,000] [INFO ] [SettingsFactory] Generate SQL with comments: disabled
      [09:35:26,000] [INFO ] [SettingsFactory] Order SQL updates by primary key: disabled
      [09:35:26,000] [INFO ] [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
      [09:35:26,015] [INFO ] [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
      [09:35:26,015] [INFO ] [SettingsFactory] Query language substitutions: {}
      [09:35:26,015] [INFO ] [SettingsFactory] Second-level cache: enabled
      [09:35:26,015] [INFO ] [SettingsFactory] Query cache: disabled
      [09:35:26,015] [INFO ] [SettingsFactory] Cache provider: org.hibernate.cache.EhCacheProvider
      [09:35:26,046] [ERROR] [[jsp]] Servlet.service() for servlet jsp threw exception
      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:327)
       at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:219)
       at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1823)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1143)
       at com.rrcorp.hibernate.SessionFactory.currentSession(SessionFactory.java:49)
       at com.rrcorp.hibernate.CatalogService.getCatalogList(CatalogService.java:28)
       at org.apache.jsp.AddJournal_jsp._jspService(org.apache.jsp.AddJournal_jsp:126)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       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:81)
       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.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       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:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       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)
      [09:36:25,984] [INFO ] [DriverManagerConnectionProvider] cleaning up connection pool: jdbc:mysql://localhost:3306/test
      


      Any suggestions or hints will be greatly appreciated.

      Russ