4 Replies Latest reply on Jan 21, 2008 10:56 AM by Nick de Graeve

    Problems migrating from 4.0.4 to 5.0.0B3

    Nick de Graeve Newbie

      We're currently using JBoss 4.0.4 but we want to migrate to JBoss 5. We know, the 5 is still beta but we want to do some tests anyway.

      We think we modified the necessary config files, for datasources, JMS, ... but our EJBs won't deploy. We're getting a ClassCastException because of org.jboss.metadata.ejb.spec.EjbJar20MetaData.

      Any idea what might be wrong?

      Are there docs yet about the migration from 4.0 to 5.0?

      Thanks,

      Nick.

      Stacktrace:

      [...]
      2008-01-17 13:41:52,523 DEBUG [org.jboss.ejb.deployers.MergedJBossMetaDataDeployer] Error during deploy: vfsfile:/C:/java/jboss-5.0.0.Beta3/server/nokeos-production/deploy/0-nokeoscore-server.jar
      java.lang.ClassCastException: org.jboss.metadata.ejb.spec.EjbJar20MetaData
      at org.jboss.ejb.deployers.MergedJBossMetaDataDeployer.deploy(MergedJBossMetaDataDeployer.java:79)
      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
      at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
      at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
      at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
      at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
      at java.lang.Thread.run(Thread.java:595)
      2008-01-17 13:41:52,539 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to PostClassLoader: name=vfsfile:/C:/java/jboss-5.0.0.Beta3/server/nokeos-production/deploy/0-nokeoscore-server.jar state=ClassLoader mode=Manual requiredState=PostClassLoader
      org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/C:/java/jboss-5.0.0.Beta3/server/nokeos-production/deploy/0-nokeoscore-server.jar
      at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:175)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
      at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
      at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
      at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
      at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.ClassCastException: org.jboss.metadata.ejb.spec.EjbJar20MetaData
      at org.jboss.ejb.deployers.MergedJBossMetaDataDeployer.deploy(MergedJBossMetaDataDeployer.java:79)
      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
      ... 22 more
      2008-01-17 13:41:52,648 DEBUG [org.jboss.mx.loading.UnifiedLoaderRepository3] UnifiedLoaderRepository removed(true) org.jboss.mx.loading.UnifiedClassLoader3@1ba9aca{ url=vfsfile:/C:/java/jboss-5.0.0.Beta3/server/nokeos-production/deploy/0-nokeoscore-server.jar ,addedOrder=50}
      2008-01-17 13:41:52,648 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] Unregistering cl=org.jboss.mx.loading.UnifiedClassLoader3@1ba9aca{ url=vfsfile:/C:/java/jboss-5.0.0.Beta3/server/nokeos-production/deploy/0-nokeoscore-server.jar ,addedOrder=50}
      2008-01-17 13:41:52,648 DEBUG [org.jboss.mx.loading.UnifiedLoaderRepository3] UnifiedLoaderRepository removed(false) org.jboss.mx.loading.UnifiedClassLoader3@1ba9aca{ url=vfsfile:/C:/java/jboss-5.0.0.Beta3/server/nokeos-production/deploy/0-nokeoscore-server.jar ,addedOrder=50}
      2008-01-17 13:41:52,648 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] Added url: file:/C:/java/jboss-5.0.0.Beta3/server/nokeos-production/tmp/aopdynclasses/ucl10087/?dynamic=true, to ucl: org.jboss.mx.loading.UnifiedClassLoader3@1fbdf57{ url=vfsfile:/C:/java/jboss-5.0.0.Beta3/server/nokeos-production/deploy/z-rules-engine-server.jar ,addedOrder=51}
      [...]


        • 1. Re: Problems migrating from 4.0.4 to 5.0.0B3
          Peter Johnson Master

          Are you starting the app server with your application already in the deploy directory, or are you hot-deploying (starting the app server first and then copying your application to the deploy directory after the app server is started)?

          The reason I ask is that about 1/2 of my applications will not deploy correctly if they are in the deploy directory when the app server starts, but these same applications deploy just fine if I hot deploy them.

          Of course, this is not a solution but will could get you by until the deployment issues are fixed.

          • 2. Re: Problems migrating from 4.0.4 to 5.0.0B3
            Nick de Graeve Newbie

            We get the same error regardless whether we deploy them from start-up or use hot-deploy.
            We have several JARs with EJBs and so far only 1 of them was successfully deployed.

            • 3. Re: Problems migrating from 4.0.4 to 5.0.0B3
              Peter Johnson Master

              You might try deploying your EJBs to JBossAS 4.2.2. That will at least tell you if the problem is one of configuration (if the EJBs do not successfully deploy to 4.2.2) or a problem with the rewrite of the deployers for 5.0 (if the EJBs deploy successfully to 4.2.2).

              • 4. Re: Problems migrating from 4.0.4 to 5.0.0B3
                Nick de Graeve Newbie

                We did some more testing and we found out that the problem is caused by Hibernate. If we remove all Hibernate POJOs from the archive it deploys.

                Even with a simple POJO it fails. We have no clue as to why. Do you?

                Thanks.

                POJO:

                Entity
                @Table(name = "allowed_locales")
                public class AllowedLocale implements Serializable {
                
                 /** Primary key. */
                 private Integer allowedLocaleId;
                
                 private String allowedLocale;
                
                 private Boolean usedForLogging;
                
                 public AllowedLocale() {
                 }
                
                 @Id @GeneratedValue
                 public Integer getAllowedLocaleId() {
                 return allowedLocaleId;
                 }
                
                 public void setAllowedLocaleId(Integer allowedLocaleId) {
                 this.allowedLocaleId = allowedLocaleId;
                 }
                
                 @Column(updatable = true, name = "allowedLocale", nullable = true, length = 5)
                 public String getAllowedLocale() {
                 return allowedLocale;
                 }
                
                 public void setAllowedLocale(String allowedLocale) {
                 this.allowedLocale = allowedLocale;
                 }
                
                 @Column(updatable = true, name = "usedForLogging", nullable = true, length = 1)
                 public Boolean getUsedForLogging() {
                 return usedForLogging;
                 }
                
                 public void setUsedForLogging(Boolean usedForLogging) {
                 this.usedForLogging = usedForLogging;
                 }
                
                }
                Hibernate config:
                <?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>
                 <property name="hibernate.connection.datasource">java:/NokeosCoreDS</property>
                 <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
                 <property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
                 <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
                 <property name="show_sql">false</property>
                 <property name="jdbc.batch_size">0</property>
                 <mapping class="com.fpc.nokeos.core.common.beans.persistent.AllowedLocale" />
                 </session-factory>
                </hibernate-configuration>


                PS. Should I start a new thread here in the Hibernate section or on the Hibernate forum?