6 Replies Latest reply on May 20, 2011 12:30 PM by Ales Justin

    Problem JBoss 6 and Javaassist

    Markus Liebsch Newbie

      Hello,

      I try to deploy an EAR in JBoss 6 and get following error:

       

      16:30:50,257 INFO  [AbstractJBossASServerBase] Server Configuration:

       

          JBOSS_HOME URL: file:/C:/EigeneProgramme/jboss-6.0.0.Final/

          Bootstrap: $JBOSS_HOME\server/vpi/conf/bootstrap.xml

          Common Base: $JBOSS_HOME\common/

          Common Library: $JBOSS_HOME\common/lib/

          Server Name: vpi

          Server Base: $JBOSS_HOME\server/

          Server Library: $JBOSS_HOME\server/vpi/lib/

          Server Config: $JBOSS_HOME\server/vpi/conf/

          Server Home: $JBOSS_HOME\server/vpi/

          Server Data: $JBOSS_HOME\server/vpi/data/

          Server Log: $JBOSS_HOME\server/vpi/log/

          Server Temp: $JBOSS_HOME\server/vpi/tmp/

       

      16:30:50,261 INFO  [AbstractServer] Starting: JBossAS [6.0.0.Final "Neo"]

      16:30:52,164 INFO  [ServerInfo] Java version: 1.6.0_25,Sun Microsystems Inc.

      16:30:52,165 INFO  [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_25-b06)

      16:30:52,165 INFO  [ServerInfo] Java VM: Java HotSpot(TM) 64-Bit Server VM 20.0-b11,Sun Microsystems Inc.

      16:30:52,165 INFO  [ServerInfo] OS-System: Windows 7 6.1,amd64

      16:30:52,166 INFO  [ServerInfo] VM arguments: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:53207 -Dprogram.name=JBossTools: JBoss 6.0 Runtime -Xms256m -Xmx768m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.endorsed.dirs=C:\EigeneProgramme\jboss-6.0.0.Final\lib\endorsed -Djava.library.path=C:\EigeneProgramme\jboss-6.0.0.Final\bin\native; -Dfile.encoding=Cp1252

      16:30:52,239 INFO  [JMXKernel] Legacy JMX core initialized

      16:31:16,749 INFO  [AbstractServerConfig] JBoss Web Services - Stack CXF Server 3.4.1.GA

      16:31:17,750 INFO  [JSFImplManagementDeployer] Initialized 3 JSF configurations: [Mojarra-1.2, MyFaces-2.0, Mojarra-2.0]

      ...

       

      16:31:36,631 INFO  [BasicTypeRegistry] Type registration [clob] overrides previous : org.hibernate.type.ClobType@71f61b6a

      16:31:36,631 INFO  [BasicTypeRegistry] Type registration [java.sql.Clob] overrides previous : org.hibernate.type.ClobType@71f61b6a

      16:31:36,631 INFO  [BasicTypeRegistry] Type registration [wrapper_characters_clob] overrides previous : org.hibernate.type.CharacterArrayClobType@54820699

      16:31:36,824 ERROR [BasicLazyInitializer] Javassist Enhancement failed: de.BerichtsstelleImpl: java.lang.RuntimeException: by java.lang.NoClassDefFoundError: de/ZentraleBerichtsstelle

          at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:509) [javassist.jar:3.14.0.GA]

          at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:486) [javassist.jar:3.14.0.GA]

          at javassist.util.proxy.ProxyFactory.createClass1(ProxyFactory.java:422) [javassist.jar:3.14.0.GA]

          at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:394) [javassist.jar:3.14.0.GA]

          at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxyFactory(JavassistLazyInitializer.java:162) [:3.6.1.Final]

          at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.postInstantiate(JavassistProxyFactory.java:65) [:3.6.1.Final]

          at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:185) [:3.6.1.Final]

          at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:167) [:3.6.1.Final]

          at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:77) [:3.6.1.Final]

          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_25]

          at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [:1.6.0_25]

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [:1.6.0_25]

          at java.lang.reflect.Constructor.newInstance(Unknown Source) [:1.6.0_25]

          at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:105) [:3.6.1.Final]

          at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:133) [:3.6.1.Final]

          at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:80) [:3.6.1.Final]

          at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:322) [:3.6.1.Final]

          at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:485) [:3.6.1.Final]

          at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:133) [:3.6.1.Final]

          at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84) [:3.6.1.Final]

          at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:286) [:3.6.1.Final]

          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1842) [:3.6.1.Final]

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:902) [:3.6.0.Final]

          at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74) [:3.6.0.Final]

          at org.jboss.jpa.builder.DefaultCEMFBuilder.build(DefaultCEMFBuilder.java:47) [:1.0.2-alpha-3]

          at org.jboss.as.jpa.scanner.HackCEMFBuilder.build(HackCEMFBuilder.java:49) [:6.0.0.Final]

          at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:275) [:1.0.2-alpha-3]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_25]

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_25]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_25]

          at java.lang.reflect.Method.invoke(Unknown Source) [:1.6.0_25]

          at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60) [jboss-reflect.jar:2.2.0.GA]

          at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168) [jboss-reflect.jar:2.2.0.GA]

          at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) [jboss-reflect.jar:2.2.0.GA]

          at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257) [jboss-kernel.jar:2.2.0.GA]

          at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47) [jboss-kernel.jar:2.2.0.GA]

          at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125) [jboss-kernel.jar:2.2.0.GA]

          at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72) [jboss-kernel.jar:2.2.0.GA]

          at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:202) [jboss-kernel.jar:2.2.0.GA]

          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]

          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:894) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:641) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:182) [:2.2.0.GA]

          at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58) [:2.2.0.GA]

          at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) [:2.2.0.GA]

          at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.GA]

          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.GA]

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.GA]

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1571) [:2.2.0.GA]

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1603) [:2.2.0.GA]

          at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]

          at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]

          at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]

          at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]

          at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]

          at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2]

          at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]

          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]

          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]

          at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]

          at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2]

          at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2]

          at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2]

          at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:112) [:0.2.2]

          at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:87) [:0.2.2]

          at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:91) [:0.2.2]

          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:132) [:6.0.0.Final]

          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]

          at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

          at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

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

      Caused by: javassist.CannotCompileException: by java.lang.NoClassDefFoundError: de/ZentraleBerichtsstelle

          at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:169) [javassist.jar:3.14.0.GA]

          at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:501) [javassist.jar:3.14.0.GA]

          ... 101 more

      Caused by: java.lang.NoClassDefFoundError: de/ZentraleBerichtsstelle

          at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_25]

          at java.lang.ClassLoader.defineClassCond(Unknown Source) [:1.6.0_25]

          at java.lang.ClassLoader.defineClass(Unknown Source) [:1.6.0_25]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_25]

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_25]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_25]

          at java.lang.reflect.Method.invoke(Unknown Source) [:1.6.0_25]

          at javassist.util.proxy.FactoryHelper.toClass2(FactoryHelper.java:181) [javassist.jar:3.14.0.GA]

          at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:163) [javassist.jar:3.14.0.GA]

          ... 102 more

      ...

       

      16:31:37,321 INFO  [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.0.0.Final "Neo"] Started in 47s:56ms

       

       

      I use inheritance with two classes “de.BerichtsstelleImpl” and “de.ZentraleBerichtsstelleImpl”.

      ZentraleBerichtsstelleImpl is the sub-class.

      Both classes implement their own interface (“de.Berichtsstelle” and “de.ZentraleBerichtsstelle”).

      The hibernate-mapping:

       

      <hibernate-mapping>

          <class name="de.BerichtsstelleImpl"

              table="BERICHTSSTELLE" proxy="de.Berichtsstelle"

              abstract="true">

              <id name="id" type="long">

                  <column name="ID" precision="22" scale="0" />

                  <generator class="sequence-identity">

                      <param name="sequence">S_Berichtsstelle</param>

                  </generator>

              </id>

       

              <discriminator column="TYP" type="string" />

       

              <version column="version" name="version" access="field" />

       

              <subclass name="de.ZentraleBerichtsstelleImpl"

                  proxy="de.ZentraleBerichtsstelle"

                  discriminator-value="ZEN">

       

              </subclass>

          </class>

      </hibernate-mapping>

       

      I put the classes and the hbm-file in a JAR (persistence.jar) and then in an EAR(VpiEar.ear).

      The EAR has the following structure:

       

      META-INF/

      META-INF/MANIFEST.MF

      META-INF/application.xml

      META-INF/jboss-app.xml

      persistence.jar

       

       

      Structure of persistence.jar:

       

      META-INF/

      META-INF/MANIFEST.MF

      META-INF/jboss.xml

      META-INF/persistence.xml

      de/

      de/Berichtsstelle.class

      de/Berichtsstelle.hbm.xml

      de/BerichtsstelleImpl.class

      de/ZentraleBerichtsstelle.class

      de/ZentraleBerichtsstelleImpl.class

       

       

      The application.xml:

       

      <?xmlversion="1.0" encoding="UTF-8"?>

      <applicationxmlns="http://java.sun.com/xml/ns/javaee"

                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

                  http://java.sun.com/xml/ns/javaee/application_6.xsd"

                  version="6">

                  <display-name>VpiEar</display-name>

       

                  <module>

                              <java>persistence.jar</java>

                  </module>

      </application>

       

      Sometimes the deployment works – sometimes not.

       

      If I deploy the persistence.jar alone everything works fine – but not within an EAR.

       

      It works with JBoss 4.2.3.

       

      Can anybody help me?

       

      Thanks!

       

      ----------------------------

      Environment:

      JBossAS[6.0.0.Final]

      Java1.6.0_25

      Oracle 10g

      WindowsXP/7