0 Replies Latest reply on May 30, 2015 4:43 PM by Elmar Babayev

    JBoss AS 7.1 persitence.xml and hibernate.cfg

    Elmar Babayev Newbie

      I have a problem while enabling the .war project in JBoss AS, here is the log from standalone/log/server.txt :

       

       

          21:34:14,766 INFO  [org.jboss.as.jpa] (MSC service thread 1-2) JBAS011401: Read persistence.xml for booking-warPU

          21:34:15,553 WARN  [org.jboss.as.ee] (MSC service thread 1-8) JBAS011006: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.springframework.http.server.ServletServerHttpAsyncRequestControl

              at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606)

              at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_79]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_79]

              at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_79]

         

          21:34:15,566 WARN  [org.jboss.as.ee] (MSC service thread 1-8) JBAS011006: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.springframework.web.context.request.async.StandardServletAsyncWebRequest

              at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606)

              at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_79]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_79]

              at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_79]

         

          21:34:15,794 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-8) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)

          21:34:15,797 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-8) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.fabric.jdbc.FabricMySQLDriver (version 5.1)

          21:34:15,882 INFO  [org.jboss.as.jpa] (MSC service thread 1-4) JBAS011402: Starting Persistence Unit Service 'booking-war.war#booking-warPU'

          21:34:16,277 INFO  [org.hibernate.annotations.common.Version] (MSC service thread 1-4) HCANN000001: Hibernate Commons Annotations {4.0.1.Final}

          21:34:16,301 INFO  [org.hibernate.Version] (MSC service thread 1-4) HHH000412: Hibernate Core {4.0.1.Final}

          21:34:16,309 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-4) HHH000206: hibernate.properties not found

          21:34:16,312 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-4) HHH000021: Bytecode provider name : javassist

          21:34:16,363 INFO  [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-4) HHH000204: Processing PersistenceUnitInfo [

              name: booking-warPU

              ...]

          21:34:16,730 INFO  [org.hibernate.cfg.Configuration] (MSC service thread 1-4) HHH000043: Configuring from resource: /resources/hibernate/hibernate.cfg.xml

          21:34:16,731 INFO  [org.hibernate.cfg.Configuration] (MSC service thread 1-4) HHH000040: Configuration resource: /resources/hibernate/hibernate.cfg.xml

          21:34:16,780 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.persistenceunit."booking-war.war#booking-warPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."booking-war.war#booking-warPU": Failed to start service

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_79]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_79]

              at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_79]

          Caused by: org.hibernate.HibernateException: Could not parse configuration: /resources/hibernate/hibernate.cfg.xml

              at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2010)

              at org.hibernate.cfg.Configuration.configure(Configuration.java:1922)

              at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1042)

              at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:692)

              at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              ... 3 more

          Caused by: org.dom4j.DocumentException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory Nested exception: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory

              at org.dom4j.io.SAXReader.read(SAXReader.java:484)

              at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2002)

              ... 11 more

         

          21:34:16,998 INFO  [org.jboss.as.server] (HttpManagementService-threads - 3) JBAS015870: Deploy of deployment "booking-war.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.persistenceunit.\"booking-war.war#booking-warPU\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"booking-war.war#booking-warPU\": Failed to start service"}}

          21:34:17,863 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment booking-war.war in 864ms

          21:34:17,864 INFO  [org.jboss.as.controller] (HttpManagementService-threads - 3) JBAS014774: Service status report

          JBAS014777:   Services which failed to start:      service jboss.persistenceunit."booking-war.war#booking-warPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."booking-war.war#booking-warPU": Failed to start service

       

       

       

      here is persistence.xml

       

       

          <?xml version="1.0" encoding="UTF-8"?>

          <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

            <persistence-unit name="booking-warPU">

              <provider>org.hibernate.ejb.HibernatePersistence</provider>

              <validation-mode>NONE</validation-mode>

              <properties>

                <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

                 <!--value='create' to build a new database on each run; value='update' to modify an existing database; value='create-drop' means the same as 'create' but also drops tables when Hibernate closes; value='validate' makes no changes to the database-->

                <property name="hibernate.hbm2ddl.auto" value="update"/>

                <property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.ImprovedNamingStrategy"/>

                <property name="hibernate.show_sql" value="true"/>   

                <property name="hibernate.ejb.cfgfile" value="/resources/hibernate/hibernate.cfg.xml"/>

              </properties>

            </persistence-unit>

          </persistence>

       

       

      here is hibernate.cfg:

       

          <?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>

              <!-- <mapping resource="resources/hibernate/user.hbm.xml"/> -->

              <property name="javax.persistence.validation.mode">none</property>

          </session-factory>

          </hibernate-configuration>

       

       

       

      Can anyone help me to configure this? Thanks in advance.