1 Reply Latest reply on Jan 25, 2013 3:34 AM by Nicklas Karlsson

    Linkage Error

    akash bansal Newbie

      <?xml version="1.0"?>

      <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_2_0.xsd"

         version="2.0">

            <persistence-unit name="floodDatabase">     

            <jta-data-source>java:jboss/jdbc/AccountingDB</jta-data-source>     

            <jar-file>entity-2.1.jar</jar-file>

            <jar-file>ar-entity-3.09-SNAPSHOT.jar</jar-file>

            <jar-file>ar-web-billing-entity-3.09-SNAPSHOT.jar</jar-file>

            <properties>                   

               <property name="hibernate.connection.autocommit" value="false"/>

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

               <property name="hibernate.transaction.flush_before_completion" value="true"/>

               <property name="jboss.entity.manager.factory.jndi.name" value="java:jboss/persistence/floodDatabaseEntityManagerFactory"/>

               <property name="jboss.as.jpa.providerModule" value="hibernate3-bundled"></property>

            </properties>

         </persistence-unit>

      </persistence>

       

      And I am using following jar files for hibernate:

      hibernate-annotations-3.4.0.GA.jar

      hibernate-commons-annotations-3.1.0.GA.jar

      hibernate-core-3.3.0.SP1.jar

      hibernate-entitymanager-3.4.0.GA.jar

      hibernate-validator-3.1.0.GA.jar

       

      When I deploy my EAR, I am getting following error:

      13:45:18,970 WARN  [org.jboss.modules] (MSC service thread 1-5) Failed to define class org.jboss.as.jpa.hibernate3.HibernateAnnotationScanner in Module "deployment.acctrecv.ear:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/jboss/as/jpa/hibernate3/HibernateAnnotationScanner (Module "deployment.acctrecv.ear:main" from Service Module Loader)

          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.modules.Module.loadModuleClass(Module.java:527) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.as.jpa.hibernate3.HibernatePersistenceProviderAdaptor.addAnnotationScanner(HibernatePersistenceProviderAdaptor.java:68)

          at org.jboss.as.jpa.hibernate3.HibernatePersistenceProviderAdaptor.addProviderProperties(HibernatePersistenceProviderAdaptor.java:57)

          at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deployPersistenceUnit(PersistenceUnitDeploymentProcessor.java:305)

          at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuService(PersistenceUnitDeploymentProcessor.java:260)

          at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.handleEarDeployment(PersistenceUnitDeploymentProcessor.java:218)

          at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deploy(PersistenceUnitDeploymentProcessor.java:121)

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]

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

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

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

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

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_37]

      Caused by: java.lang.NoClassDefFoundError: org/hibernate/ejb/packaging/Scanner

          at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_37]

          at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [rt.jar:1.6.0_37]

          at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [rt.jar:1.6.0_37]

          at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [rt.jar:1.6.0_37]

          at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391) [jboss-modules.jar:1.1.2.GA-redhat-1]

          ... 20 more

      Caused by: java.lang.ClassNotFoundException: org.hibernate.ejb.packaging.Scanner from [Module "deployment.acctrecv.ear:main" from Service Module Loader]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.2.GA-redhat-1]

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.2.GA-redhat-1]

          ... 26 more

       

      Please help me to resolve this issue.