Uploaded image for project: 'WINDUPRULE - Red Hat Application Migration Toolkit rules'
  1. WINDUPRULE - Red Hat Application Migration Toolkit rules
  2. WINDUPRULE-105

Windup is not able to migrate Seam applications to EAP7

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • 2.4.1
    • 2.4.1
    • EAP6 -> EAP7
    • None
    • Hide

      1- Run windup using the following command :
      windup --input JBTravel.war --source eap --source javaee --source seam --source hibernate --target eap7 --output /tmp/jbtravel
      Check the output provided.
      2- Update the JBTravel.war with the jboss-deployment-structure-jsf.xml.
      3-Update EAP 7 to include the contents from the zip file provided.
      4- Deploy the app again
      5- Update the JBTravel.war with the jboss-deployment-structure-weld.xml

      It is needed to deploy the following Datasource:
      <subsystem xmlns="urn:jboss:domain:datasources:4.0">
      <datasources>
      <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
      <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
      <driver>h2</driver>
      <security>
      <user-name>sa</user-name>
      <password>sa</password>
      </security>
      </datasource>
      <xa-datasource jndi-name="java:jboss/JBTravelDatasource" pool-name="PostgresXADS" enabled="true" use-ccm="true">
      <xa-datasource-property name="ServerName">
      localhost
      </xa-datasource-property>
      <xa-datasource-property name="PortNumber">
      5432
      </xa-datasource-property>
      <xa-datasource-property name="DatabaseName">
      postgres
      </xa-datasource-property>
      <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
      <driver>postgresql</driver>
      <security>
      <user-name>postgres</user-name>
      <password>postgres</password>
      </security>
      <validation>
      <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"/>
      <background-validation>true</background-validation>
      <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"/>
      </validation>
      </xa-datasource>
      <drivers>
      <driver name="h2" module="com.h2database.h2">
      <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
      </driver>
      <driver name="postgresql" module="org.postgresql">
      <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
      </driver>
      </drivers>
      </datasources>
      </subsystem>
      Postgresql script is provided as attached.

      Show
      1- Run windup using the following command : windup --input JBTravel.war --source eap --source javaee --source seam --source hibernate --target eap7 --output /tmp/jbtravel Check the output provided. 2- Update the JBTravel.war with the jboss-deployment-structure-jsf.xml. 3-Update EAP 7 to include the contents from the zip file provided. 4- Deploy the app again 5- Update the JBTravel.war with the jboss-deployment-structure-weld.xml It is needed to deploy the following Datasource: <subsystem xmlns="urn:jboss:domain:datasources:4.0"> <datasources> <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true"> <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url> <driver>h2</driver> <security> <user-name>sa</user-name> <password>sa</password> </security> </datasource> <xa-datasource jndi-name="java:jboss/JBTravelDatasource" pool-name="PostgresXADS" enabled="true" use-ccm="true"> <xa-datasource-property name="ServerName"> localhost </xa-datasource-property> <xa-datasource-property name="PortNumber"> 5432 </xa-datasource-property> <xa-datasource-property name="DatabaseName"> postgres </xa-datasource-property> <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class> <driver>postgresql</driver> <security> <user-name>postgres</user-name> <password>postgres</password> </security> <validation> <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"/> <background-validation>true</background-validation> <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"/> </validation> </xa-datasource> <drivers> <driver name="h2" module="com.h2database.h2"> <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class> </driver> <driver name="postgresql" module="org.postgresql"> <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class> </driver> </drivers> </datasources> </subsystem> Postgresql script is provided as attached.
    • None

      The attached application is provided by Red Hat Training and used by the JBoss EAP 6 Administration Course to show how to migrate applications from EAP5 to EAP6 using the migration guide provided by https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7
      It is a Seam application accessing a database and it is basically a CRUD app. Running the Windup tool (windup --input JBTravel.war --source eap --source javaee --source seam --source hibernate --target eap7 --output /tmp/jbtravel) problems related to classloading are mentioned. In fact the JSF is provided by EAP 7 is not compatible and the jboss-deployment-structure.xml was updated ( (see jboss-deployment-structure-jsf.xml for details) as well as the EAP 7 modules directory. Deploying it, the following error is raised:
      14:10:14,239 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool – 92) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./JBTravel: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./JBTravel: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Class javax.faces.FactoryFinder can not access a member of class org.jboss.as.jsf.injection.weld.WeldApplicationFactory with modifiers "private"
      at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      at org.jboss.threads.JBossThread.run(JBossThread.java:320)
      Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Class javax.faces.FactoryFinder can not access a member of class org.jboss.as.jsf.injection.weld.WeldApplicationFactory with modifiers "private"
      at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:225)
      at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
      at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
      ... 6 more
      Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Class javax.faces.FactoryFinder can not access a member of class org.jboss.as.jsf.injection.weld.WeldApplicationFactory with modifiers "private"
      at com.sun.faces.config.ConfigManager.initialize(Unknown Source)
      at com.sun.faces.config.ConfigureListener.contextInitialized(Unknown Source)
      at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
      at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:196)
      ... 8 more
      Caused by: java.lang.IllegalAccessException: Class javax.faces.FactoryFinder can not access a member of class org.jboss.as.jsf.injection.weld.WeldApplicationFactory with modifiers "private"
      at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
      at java.lang.Class.newInstance(Class.java:436)
      at javax.faces.FactoryFinder.getImplGivenPreviousImpl(Unknown Source)
      at javax.faces.FactoryFinder.getImplementationInstance(Unknown Source)
      at javax.faces.FactoryFinder.access$400(Unknown Source)
      at javax.faces.FactoryFinder$FactoryManager.getFactory(Unknown Source)
      at javax.faces.FactoryFinder.getFactory(Unknown Source)
      at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(Unknown Source)
      at com.sun.faces.config.processor.FactoryConfigProcessor.process(Unknown Source)
      ... 12 more
      From the output it seems like that Weld be downgraded as well. In order to fix it, the weld APIs provided by EAP 6.4 were used and appended to the EAP 7 modules directory. However the following error is raised after including the APIs to EAP 7 and updating the jboss-deployment-structure.xml (see jboss-deployment-structure-weld.xml for details). This raises a different error:
      12:52:48,443 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.unit."JBTravel.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."JBTravel.war".WeldStartService: Failed to start service
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: org.jboss.weld.exceptions.WeldException: WELD-001524: Unable to load proxy class for bean Session bean [class org.jboss.seam.transaction.EjbSynchronizations with qualifiers [@Any @Default]; local interfaces are [LocalEjbSynchronizations] with class class org.jboss.seam.transaction.EjbSynchronizations using classloader ModuleClassLoader for Module "deployment.JBTravel.war:main" from Service Module Loader
      at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:364)
      at org.jboss.weld.injection.producer.ejb.SessionBeanProxyInstantiator.<init>(SessionBeanProxyInstantiator.java:51)
      at org.jboss.weld.bean.SessionBean.initializeAfterBeanDiscovery(SessionBean.java:265)
      at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$AfterBeanDiscoveryInitializerFactory.doWork(ConcurrentBeanDeployer.java:136)
      at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$AfterBeanDiscoveryInitializerFactory.doWork(ConcurrentBeanDeployer.java:127)
      at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
      at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      at org.jboss.threads.JBossThread.run(JBossThread.java:320)
      Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/jboss/weld/bean/proxy/ProxyObject
      at org.jboss.weld.util.bytecode.ClassFileUtils.toClass(ClassFileUtils.java:101)
      at org.jboss.weld.bean.proxy.ProxyFactory.createProxyClass(ProxyFactory.java:484)
      at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:357)
      ... 11 more
      Caused by: java.lang.NoClassDefFoundError: org/jboss/weld/bean/proxy/ProxyObject
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
      at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.jboss.weld.util.bytecode.ClassFileUtils.toClass2(ClassFileUtils.java:108)
      at org.jboss.weld.util.bytecode.ClassFileUtils.toClass(ClassFileUtils.java:97)
      ... 13 more
      Caused by: java.lang.ClassNotFoundException: org.jboss.weld.bean.proxy.ProxyObject from [Module "deployment.JBTravel.war:main" from Service Module Loader]
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)
      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)
      ... 20 more

      12:52:48,452 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "JBTravel.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"JBTravel.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"JBTravel.war\".WeldStartService: Failed to start service
      Caused by: org.jboss.weld.exceptions.WeldException: WELD-001524: Unable to load proxy class for bean Session bean [class org.jboss.seam.transaction.EjbSynchronizations with qualifiers [@Any @Default]; local interfaces are [LocalEjbSynchronizations] with class class org.jboss.seam.transaction.EjbSynchronizations using classloader ModuleClassLoader for Module \"deployment.JBTravel.war:main\" from Service Module Loader
      Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/jboss/weld/bean/proxy/ProxyObject
      Caused by: java.lang.NoClassDefFoundError: org/jboss/weld/bean/proxy/ProxyObject
      Caused by: java.lang.ClassNotFoundException: org.jboss.weld.bean.proxy.ProxyObject from [Module \"deployment.JBTravel.war:main\" from Service Module Loader]"}}

      This error seems like that something from weld is missing, however all the weld APIs were added to the EAP7. The migration then was not successfully migrated.

      The JBTravel.war file can be downloaded from: https://drive.google.com/open?id=0B2ymD9RcUUMWalE4N1RmSC1wYW8

        1. postgres-setup.sh
          0.8 kB
        2. libraries.zip
          925 kB
        3. jboss-deployment-structure-weld.xml
          1 kB
        4. jboss-deployment-structure-jsf.xml
          0.8 kB
        5. JB248.sql
          344 kB

              mnovotny@redhat.com Marek Novotny
              rhn-gls-rtaniguchi Ricardo Taniguchi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: