1 2 Previous Next 17 Replies Latest reply on Aug 11, 2011 11:41 AM by prasad.deshpande Go to original post
      • 15. Re: PersistenceUnit  Jboss7
        quynhbt

        Thank you for your help, Scott Marlow and Prasad Deshpande

         

        I haven't yet replied as my application has not been run. I had another error of classes generated from xsd file (http://community.jboss.org/message/620069).

         

        Concerning this error "AbstractMethodError: ca.edbc.jdbc.EdbcMetaData.supportsGetGeneratedKeys()Z", it was resolved by replacing the right version of atlasnet-domain.jar. This jar file contains the java classes (Entity Bean) generated by the database.

         

        Best regards

         

        TQB

        • 16. Re: PersistenceUnit  Jboss7
          quynhbt

          My problem is not resolved yet.

           

          I try to narrow down the application by creating a very simple example and I found that is due to JDBC.

           

          My example is a EAR:

           

          hello.ear

               + META-INF

                    + application.xml

                    + jboss-deployement-structure.xml

               + lib

                    + hibernate-annotations.jar

                    + hibernate-core.jar

                    + hibernate-common-annotations.jar

                    + hibernate-entitymanagement.jar

                    + hibernate-validator.jar

                     ......

               + hello.jar

                    + META-INF

                         + ejb-jar.xml

                         + persistence.xml

                         + standard-jaxws-endpoint-config.xml

                    + fr.datasystem.atlas.example.hello

                         + helloService.class

                         + helloServiceRemote.class

                         + atddelpfl.class  // Entity Bean

                         + .....

                    + import.sql

               + hello.war

           

          Here is my persistence.xml:

           

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

          <persistence 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_1_0.xsd"

                       version="1.0">

                       <persistence-unit name="helloDatabase">

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

                          <jta-data-source>java:jboss/datasources/atlasnetDatasource</jta-data-source>

                          <!--jta-data-source>java:/DefaultDS</jta-data-source-->

                          <properties>

                             <property name="hibernate.hbm2ddl.auto" value="create-drop"/>

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

                             <!-- These are the default for JBoss EJB3, but not for HEM: -->

                             <!--property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/-->

                             <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>

                </properties>

             </persistence-unit>

          </persistence>

           

          If I use the default datasource of AS7 (Java:/DefaultDS), my example runs well.

          But If I change to my datasource (java:jboss/datasources/atlasnetDatasource), The driver is installed as a module and it is enable in the Administration Console.

           

          I get this error:

           

          17:01:44,347 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.persistenceunit."hello.ear/hello.jar#helloDatabase": org.jboss.msc.service.StartException in service jboss.persistenceunit."hello.ear/hello.jar#helloDatabase": Failed to start service

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1786)

          at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_25]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_25]

          at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]

          Caused by: java.lang.AbstractMethodError

          at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:136)

          at org.hibernate.service.internal.BasicServiceRegistryImpl.configureService(BasicServiceRegistryImpl.java:80)

          at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:145)

          at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:118)

          at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:70)

          at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2251)

          at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2247)

          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1718)

          at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:76)

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:894)

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:879)

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

          at org.jboss.as.jpa.service.PersistenceUnitService.createContainerEntityManagerFactory(PersistenceUnitService.java:168)

          at org.jboss.as.jpa.service.PersistenceUnitService.start(PersistenceUnitService.java:80)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

          ... 4 more

          17:01:45,450 INFO [org.jboss.seam.init.Initialization] (MSC service thread 1-14) reading /WEB-INF/components.xml

          I attach here the standalone.xml and the server log.

          Help me please

          Thanks

          TQB

          • 17. Re: PersistenceUnit  Jboss7
            prasad.deshpande

            Can you try to write a simple Servlet/JSP that acceses a JDBC connection from your java:jboss/datasources/atlasnetDatasource & deploy that in EAR & see if you get any problem with it. If not, then next step would be just to deploy persistenceunit without any session bean. Need to narrow down problem area. Also, as Scott suggested, try enabling TRACE for "org.jboss.jpa".

            1 2 Previous Next