11 Replies Latest reply on Jun 1, 2007 12:05 PM by cgrahamatip

    jboss 4.2 Hibernate 3.2 entity mapping problem

    cgrahamatip

      I am trying to get a test jsf application to work on the standard jboss 4.2.0 AS server. I am using eclipse as the IDE. I set the build path in my eclipse project to point to jboss/default/lib jar files for hibernate and other required jars.

      when I deployed the application everythings works as it should until I make a call from a backing bean to query or load a hibernate class. I get the following error: "org.hibernate.MappingException: Unknown entity: com.ipi.InformationPortal.model.People".

      The configuration snippets are:

      ########hibernate.cfg.xml###################
      <?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 name="mdp-sf">

      true

      <!-- Mapping files -->

      </session-factory>
      </hibernate-configuration>

      ############### hibernate.properties #################
      ..
      ## MySQL

      hibernate.dialect org.hibernate.dialect.MySQLDialect
      #hibernate.dialect org.hibernate.dialect.MySQLInnoDBDialect
      #hibernate.dialect org.hibernate.dialect.MySQLMyISAMDialect
      hibernate.connection.driver_class com.mysql.jdbc.Driver
      hibernate.connection.url jdbc:mysql://localhost/myDB
      hibernate.connection.username username
      hibernate.connection.password xxxxxxx
      ..

      ########### People.hbm.xml #######################
      <?xml version="1.0"?>
      <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
      <!-- Generated May 27, 2007 7:19:14 PM by Hibernate Tools 3.2.0.beta7 -->
      <hibernate-mapping package="com.ipi.InformationPortal.model">






















      </hibernate-mapping>

      ############# People.java ######################

      package com.ipi.InformationPortal.model;
      // Generated May 27, 2007 7:19:11 PM by Hibernate Tools 3.2.0.beta7



      /**
      * People generated by hbm2java
      */
      public class People implements java.io.Serializable {

      // Fields

      private int peopleid;
      private String firstName;
      private String middleInitial;
      private String lastName;

      // Constructors

      /** default constructor */
      public People() {
      }

      /** minimal constructor */
      public People(int peopleid) {
      this.peopleid = peopleid;
      }
      /** full constructor */
      public People(int peopleid, String firstName, String middleInitial, String lastName) {
      this.peopleid = peopleid;
      this.firstName = firstName;
      this.middleInitial = middleInitial;
      this.lastName = lastName;
      }

      // Property accessors
      public int getPeopleid() {
      return this.peopleid;
      }

      public void setPeopleid(int peopleid) {
      this.peopleid = peopleid;
      }
      public String getFirstName() {
      return this.firstName;
      }

      public void setFirstName(String firstName) {
      this.firstName = firstName;
      }
      public String getMiddleInitial() {
      return this.middleInitial;
      }

      public void setMiddleInitial(String middleInitial) {
      this.middleInitial = middleInitial;
      }
      public String getLastName() {
      return this.lastName;
      }

      public void setLastName(String lastName) {
      this.lastName = lastName;
      }

      }


      ############### backing bean call ####################

      public static suggestionBean getSuggestionBean() {

      int peopleid = 1;
      Configuration cfg = new Configuration();
      SessionFactory sf = cfg.buildSessionFactory();
      String address = randomString(suggestedAddresses);
      String password = randomString(chars, 8);
      /*
      * Insert some hibernate to get the user name from db.
      */
      People p = new People();
      Session session = sf.openSession();

      p = (People) session.load(People.class, peopleid);

      password = p.getFirstName();
      address = p.getLastName();
      session.close();
      return(new suggestionBean(address, password));
      }

      #############################################
      The hibernate configuration files are at the root of the jsf app.

      Any input would be greatly appreciated!!

        • 1. Re: jboss 4.2 Hibernate 3.2 entity mapping problem
          cgrahamatip

          The hibernate mapping file didn't display so I will try to cut and paste again.

          ########### People.hbm.xml #######################

          <?xml version="1.0"?>
          <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
          <!-- Generated May 27, 2007 7:19:14 PM by Hibernate Tools 3.2.0.beta7 -->
          <hibernate-mapping package="com.ipi.InformationPortal.model">
          <class name="People" table="people" catalog="myDB">
           <comment></comment>
           <id name="peopleid" type="int">
           <column name="peopleid" />
           <generator class="native" />
           </id>
           <property name="firstName" type="string">
           <column name="first_name" length="45">
           <comment></comment>
           </column>
           </property>
           <property name="middleInitial" type="string">
           <column name="middle_initial" length="1">
           <comment></comment>
           </column>
           </property>
           <property name="lastName" type="string">
           <column name="last_name" length="65">
           <comment></comment>
           </column>
           </property>
           </class>
          </hibernate-mapping>
          
          


          • 2. Re: jboss 4.2 Hibernate 3.2 entity mapping problem
            jaikiran

            Can you repost the contents of your hibernate.cfg.xml too?

            • 3. Re: jboss 4.2 Hibernate 3.2 entity mapping problem
              jaikiran

              And the entire exception stacktrace

              • 4. Re: jboss 4.2 Hibernate 3.2 entity mapping problem
                cgrahamatip

                 

                
                ############### hibernate.cfg.xml ####################
                <?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 name="mdp-sf">
                 <property name="show_sql">
                 true
                 </property>
                 <!-- Mapping files -->
                 <mapping resource="com/ipi/InformationPortal/model/People.hbm.xml"/>
                </session-factory>
                </hibernate-configuration>
                
                ############### stack tracy ########################
                
                HTTP Status 500 -
                
                type Exception report
                
                message
                
                description The server encountered an internal error () that prevented it from fulfilling this request.
                
                exception
                
                javax.servlet.ServletException: #{registrationBean.register}: org.hibernate.MappingException: Unknown entity: com.ipi.InformationPortal.model.People
                 javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
                 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                
                root cause
                
                javax.faces.FacesException: #{registrationBean.register}: org.hibernate.MappingException: Unknown entity: com.ipi.InformationPortal.model.People
                 com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)
                 javax.faces.component.UICommand.broadcast(UICommand.java:383)
                 javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
                 javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
                 com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                 com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                 com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                 javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                
                root cause
                
                javax.faces.el.EvaluationException: org.hibernate.MappingException: Unknown entity: com.ipi.InformationPortal.model.People
                 javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
                 com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
                 javax.faces.component.UICommand.broadcast(UICommand.java:383)
                 javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
                 javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
                 com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                 com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                 com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                 javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                
                root cause
                
                org.hibernate.MappingException: Unknown entity: com.ipi.InformationPortal.model.People
                 org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:550)
                 org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:68)
                 org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
                 org.hibernate.impl.SessionImpl.load(SessionImpl.java:795)
                 org.hibernate.impl.SessionImpl.load(SessionImpl.java:788)
                 com.ipi.InformationPortal.web.suggestionUtils.getSuggestionBean(suggestionUtils.java:39)
                 com.ipi.InformationPortal.web.registrationBean.register(registrationBean.java:36)
                 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 java.lang.reflect.Method.invoke(Method.java:597)
                 org.apache.el.parser.AstValue.invoke(AstValue.java:131)
                 org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                 org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
                 javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
                 com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
                 javax.faces.component.UICommand.broadcast(UICommand.java:383)
                 javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
                 javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
                 com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                 com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                 com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                 javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                
                note The full stack trace of the root cause is available in the JBossWeb/2.0.0.GA logs.
                JBossWeb/2.0.0.GA
                


                • 5. Re: jboss 4.2 Hibernate 3.2 entity mapping problem
                  jaikiran

                  The files look right to me. The exception you are seeing usually shows up when the class is not mapped through the hibernate.cfg.xml file. But i see, you have already done that. Are you sure, while creating the session factory, this hibernate.cfg.xml is being picked up? I mean, is there any other hibernate.cfg.xml in your classpath which might be getting picked up by the application

                  • 6. Re: jboss 4.2 Hibernate 3.2 entity mapping problem
                    cgrahamatip

                    I checked and it is the only hibernate.cfg.xml file in the war file and work sub-directory in jboss default sub-directory. I don't see any messages indicating that the hibernate configuration files are missing or have a problem. I hope someone can see what I am missing. Thanks you for your feedback.

                    • 7. Re: jboss 4.2 Hibernate 3.2 entity mapping problem
                      jaikiran

                      Could you try deleting the hibernate.properties and maintain just the hibernate.cfg.xml? Hibernate uses the hibernate.cfg.xml by overriding the hibernate.properties when both the files are present. Just want to make sure that the cfg.xml is being used and not the properties file. I guess that the hibernate.properties is being used because otherwise i would have expected some errors being thrown up since your cfg.xml does not contain any dialect/driver/connection url related information.

                      • 8. Re: jboss 4.2 Hibernate 3.2 entity mapping problem
                        cgrahamatip

                        So, I deleted the hibernate.properties file and added the jdbc connection info to the hibernate.cfg.xml file. The file is still at the root of the web app (same directory as the jsp/jsf files). There appears to be a problem with jboss 2.4.0 and hibernate.

                        you can see in the stack trace that it didn't find the hibernate.properties file however it doesn't seem to be reading the hibernate.cfg.xml file which has the dialect value set. Do you know for sure where the hibernate.cfg.xml file should be located on jboss?



                        ################# hibernate.cfg.xml ##################
                        
                        <?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>
                         <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
                         <property name="connection.password">xxxx</property>
                         <property name="connection.url">jdbc:mysql://localhost/myDB</property>
                         <property name="connection.username">username</property>
                         <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
                         <property name="show_sql">true</property>
                         <!-- Mapping files -->
                         <mapping resource="com/ipi/InformationPortal/model/People.hbm.xml"/>
                        </session-factory>
                        </hibernate-configuration>
                        
                        ############## stack trace #########################
                        
                        21:53:04,218 INFO [Environment] Hibernate 3.2.3
                        21:53:04,234 INFO [Environment] hibernate.properties not found
                        21:53:04,234 INFO [Environment] Bytecode provider name : javassist
                        21:53:04,250 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
                        21:53:04,359 WARN [UserSuppliedConnectionProvider] No connection properties specified - the user must supply JDBC conne
                        ctions
                        21:53:04,375 FATAL [application] org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
                        javax.faces.el.EvaluationException: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:9
                        1)
                         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
                         at javax.faces.component.UICommand.broadcast(UICommand.java:383)
                         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
                         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
                         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                         at java.lang.Thread.run(Thread.java:619)
                        Caused by: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
                         at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
                         at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
                         at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:422)
                         at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
                         at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
                         at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
                         at com.ipi.InformationPortal.web.suggestionUtils.getSuggestionBean(suggestionUtils.java:27)
                         at com.ipi.InformationPortal.web.registrationBean.register(registrationBean.java:36)
                         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:597)
                         at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
                         at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                         at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:7
                        7)
                         ... 25 more
                        21:53:04,375 WARN [lifecycle] #{registrationBean.register}: org.hibernate.HibernateException: Hibernate Dialect must be
                         explicitly set
                        javax.faces.FacesException: #{registrationBean.register}: org.hibernate.HibernateException: Hibernate Dialect must be ex
                        plicitly set
                         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)
                         at javax.faces.component.UICommand.broadcast(UICommand.java:383)
                         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
                         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
                         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                         at java.lang.Thread.run(Thread.java:619)
                        Caused by: javax.faces.el.EvaluationException: org.hibernate.HibernateException: Hibernate Dialect must be explicitly se
                        t
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:9
                        1)
                         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
                         ... 24 more
                        Caused by: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
                         at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
                         at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
                         at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:422)
                         at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
                         at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
                         at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
                         at com.ipi.InformationPortal.web.suggestionUtils.getSuggestionBean(suggestionUtils.java:27)
                         at com.ipi.InformationPortal.web.registrationBean.register(registrationBean.java:36)
                         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:597)
                         at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
                         at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                         at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:7
                        7)
                         ... 25 more
                        21:53:04,390 WARN [lifecycle] executePhase(INVOKE_APPLICATION 5,com.sun.faces.context.FacesContextImpl@d2e55e) threw ex
                        ception
                        javax.faces.FacesException: #{registrationBean.register}: org.hibernate.HibernateException: Hibernate Dialect must be ex
                        plicitly set
                         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:105)
                         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                         at java.lang.Thread.run(Thread.java:619)
                        Caused by: javax.faces.FacesException: #{registrationBean.register}: org.hibernate.HibernateException: Hibernate Dialect
                         must be explicitly set
                         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)
                         at javax.faces.component.UICommand.broadcast(UICommand.java:383)
                         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
                         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
                         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                         ... 20 more
                        Caused by: javax.faces.el.EvaluationException: org.hibernate.HibernateException: Hibernate Dialect must be explicitly se
                        t
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:9
                        1)
                         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
                         ... 24 more
                        Caused by: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
                         at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
                         at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
                         at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:422)
                         at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
                         at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
                         at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
                         at com.ipi.InformationPortal.web.suggestionUtils.getSuggestionBean(suggestionUtils.java:27)
                         at com.ipi.InformationPortal.web.registrationBean.register(registrationBean.java:36)
                         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:597)
                         at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
                         at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                         at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:7
                        7)
                         ... 25 more
                        21:53:04,390 ERROR [FacesServlet]] Servlet.service() for servlet javax.faces.FacesServlet threw exception
                        org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
                         at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
                         at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
                         at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:422)
                         at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
                         at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
                         at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
                         at com.ipi.InformationPortal.web.suggestionUtils.getSuggestionBean(suggestionUtils.java:27)
                         at com.ipi.InformationPortal.web.registrationBean.register(registrationBean.java:36)
                         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:597)
                         at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
                         at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                         at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:7
                        7)
                         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
                         at javax.faces.component.UICommand.broadcast(UICommand.java:383)
                         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
                         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
                         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                         at java.lang.Thread.run(Thread.java:619)
                        


                        • 9. Re: jboss 4.2 Hibernate 3.2 entity mapping problem
                          jaikiran

                          The hibernate.cfg.xml should be at the root of the application, the same place where your hibernate.properties was present earlier. Is your application an ear or a war file. If so can you post the output after following the steps below:

                          - Open a command prompt
                          - From the command prompt move to %JBOSS_HOME%/server/default/deploy
                          - Run the following command:

                          jar -tf myApp.war


                          where myApp.war is the name of your application. Post the output. The output will display the contents of your application.


                          • 10. Re: jboss 4.2 Hibernate 3.2 entity mapping problem
                            jaikiran

                            Additionally you can also have a look at http://www.hibernate.org/hib_docs/reference/en/html/session-configuration.html which explains how to configure hibernate.

                            • 11. Re: jboss 4.2 Hibernate 3.2 entity mapping problem
                              cgrahamatip

                              Its now working. I made the following change to the backing bean:

                              was
                               SessionFactory mdpsf = cfg.buildSessionFactory();
                              now
                               SessionFactory mdpsf = cfg.configure().buildSessionFactory();
                              


                              It appears the configuration parameter weren't being read in the first example of creating a SessionFactory. By adding the method configure() the mapping was found.

                              The URL you provided "http://www.hibernate.org/hib_docs/reference/en/html/session-configuration.html" was very helpful.

                              Again, thanks for all the help!