1 Reply Latest reply on Jul 7, 2006 5:15 PM by Brian Smith

    JBoss 4.04GA and Hibernate Config error

    Brian Smith Apprentice

      I have an error I can't seem to solve. It occurs when trying to create a Session from a SessionFactory. Here is the StrackTrace

      The first set of errors look like a JSF issue (which I can't totally rule out - still learning :-) ). But toward the bottom of the stack trace there is some refernce to hibernate mapping errors which makes me think the jsf is not the issue.

      2006-07-07 14:03:06,812 ERROR [STDERR] Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap
      2006-07-07 14:03:06,812 ERROR [com.sun.faces.lifecycle.InvokeApplicationPhase] #{account.act}: javax.faces.el.EvaluationException: java.lang.ExceptionInInitializerError
      javax.faces.FacesException: #{account.act}: javax.faces.el.EvaluationException: java.lang.ExceptionInInitializerError
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)
      at javax.faces.component.UICommand.broadcast(UICommand.java:312)
      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
      at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
      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.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)
      Caused by: javax.faces.el.EvaluationException: java.lang.ExceptionInInitializerError
      at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
      ... 25 more
      Caused by: java.lang.ExceptionInInitializerError
      at com.stlouiscity.util.HibernateUtil.(HibernateUtil.java:28)
      at com.stlouiscity.budget.database.dao.AccountDAOHibernateImpl.insert(AccountDAOHibernateImpl.java:170)
      at com.stlouiscity.budget.jsf.beans.AccountBacking.act(AccountBacking.java:75)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
      ... 26 more
      Caused by: java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap
      at org.hibernate.mapping.Table.(Table.java:33)
      at org.hibernate.cfg.Mappings.addTable(Mappings.java:165)
      at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:288)
      at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:271)
      at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:142)
      at org.hibernate.cfg.Configuration.add(Configuration.java:419)
      at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:460)
      at org.hibernate.cfg.Configuration.addResource(Configuration.java:515)
      at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1506)
      at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1474)
      at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1453)
      at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1427)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:1347)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:1333)
      at com.stlouiscity.util.HibernateUtil.(HibernateUtil.java:25)
      ... 33 more
      2006-07-07 14:03:06,828 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/BudgetApplication].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
      javax.faces.FacesException: #{account.act}: javax.faces.el.EvaluationException: java.lang.ExceptionInInitializerError
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)
      at javax.faces.component.UICommand.broadcast(UICommand.java:312)
      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
      at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
      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.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)
      Caused by: javax.faces.el.EvaluationException: java.lang.ExceptionInInitializerError
      at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
      ... 25 more
      Caused by: java.lang.ExceptionInInitializerError
      at com.stlouiscity.util.HibernateUtil.(HibernateUtil.java:28)
      at com.stlouiscity.budget.database.dao.AccountDAOHibernateImpl.insert(AccountDAOHibernateImpl.java:170)
      at com.stlouiscity.budget.jsf.beans.AccountBacking.act(AccountBacking.java:75)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
      ... 26 more
      Caused by: java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap
      at org.hibernate.mapping.Table.(Table.java:33)
      at org.hibernate.cfg.Mappings.addTable(Mappings.java:165)
      at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:288)
      at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:271)
      at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:142)
      at org.hibernate.cfg.Configuration.add(Configuration.java:419)
      at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:460)
      at org.hibernate.cfg.Configuration.addResource(Configuration.java:515)
      at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1506)
      at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1474)
      at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1453)
      at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1427)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:1347)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:1333)
      at com.stlouiscity.util.HibernateUtil.(HibernateUtil.java:25)
      ... 33 more


      Here is my Hibernate.cfg.xml file

      <?xml version="1.0" encoding="UTF-8"?>
      
      <!DOCTYPE hibernate-configuration PUBLIC
       '-//Hibernate/Hibernate Configuration DTD 3.0//EN'
       'http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd'>
      <hibernate-configuration>
       <!-- <session-factory name="java:comp/env/hibernate/SessionFactory"> -->
       <session-factory name="MySessionFactory">
       <!-- properties -->
       <property name="connection.datasource">java:OracleDS</property>
      
      
       <property name="connection.pool_size">1</property>
       <property name="current_session_context_class">thread</property>
       <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
       <property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
       <property name="show_sql">true</property>
      
       <!-- mapping files -->
       <mapping resource="com/stlouiscity/budget/database/beans/AccountBean.hbm.xml"/>
       </session-factory>
      
      </hibernate-configuration>
      

      I know my OracleDS datasource file is ok because I tested it with plain JDBC and it seems to work.