Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-2077

WARs that deploy on JBoss AS 6 and GlassFish 3.1 fail on AS 7 because of classpath scanning changes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.1.0.Beta1
    • 7.0.0.Final
    • EE
    • None
    • Compatibility/Configuration
    • Workaround Exists
    • Hide

      Repackage your JARs to remove all optional dependencies. Metawidget does this. But it transfers the burden to the end-user.

      Show
      Repackage your JARs to remove all optional dependencies. Metawidget does this. But it transfers the burden to the end-user.

    Description

      To reproduce:

      1. Download attached minimal WAR (as7-2077.war)
      2. Deploy WAR to a fresh install of JBoss AS 6.0.0.Final. Hit http://localhost:8080/as7-2077. Should say 'success'
      3. Deploy WAR to a fresh install of GlassFish 3.1. Hit http://localhost:8080/as7-2077. Should say 'success'
      4. Deploy WAR to a fresh install of JBoss AS 7.0.0.Final. Deployment will fail

      The deployment error is:

      09:07:34,991 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."as7-2077.war".INSTALL
      : org.jboss.msc.service.StartException in service jboss.deployment.unit."as7-2077.war".INSTALL: Failed to process phase INSTALL of deployment "as7-2077.
      war"
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
      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.RuntimeException: Error getting reflective information for class org.metawidget.jsp.tagext.html.spring.SpringMetawidgetTag
      at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
      at org.jboss.as.ee.component.EEModuleClassDescription$DefaultConfigurator.configure(EEModuleClassDescription.java:144)
      at org.jboss.as.ee.component.EEClassConfigurationProcessor.deploy(EEClassConfigurationProcessor.java:100)
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
      ... 5 more
      Caused by: java.lang.NoClassDefFoundError: org/springframework/context/MessageSource
      at java.lang.Class.getDeclaredFields0(Native Method) [:1.6.0_25]
      at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [:1.6.0_25]
      at java.lang.Class.getDeclaredFields(Class.java:1743) [:1.6.0_25]
      at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57)
      at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66)
      ... 8 more
      Caused by: java.lang.ClassNotFoundException: org.springframework.context.MessageSource from [Module "deployment.as7-2077.war:main" from Service Module
      Loader]
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
      ... 13 more

      We understand the error. The new JBoss AS 7 classpath scanning code is looking for EE annotations (such as @Stateless) inside the WAR, but some of the JARs in the WAR have optional dependencies (ie. an optional dependency on Spring).

      However we don't believe this should fail the deployment. It didn't fail on JBoss AS 6 and it doesn't fail on GlassFish 3.1.

      This issue is affecting other projects, such as Vaadin, not just Metawidget. For further discussion, see AS7-708.

      Attachments

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            kennardconsulting Richard Kennard (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: