Spring Framework
  1. Spring Framework
  2. SPR-7197

Spring 3 classpath scanning fails on JBoss AS 6.0.0.M3

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 3.0.2
    • Fix Version/s: 3.0.3
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      Context scanning fails in JBoss AS 6.0.0.M3 due to VFS issues. The VFS classes have moved from org.jboss.virtual to org.jboss.vfs. As well, a few methods have changed their names. Therefore, the fixes provided for SPR-5120 need an update to match the current package structure.

      I will attached a patch that abstracts the VFS2 and VFS3 code so that Spring 3 can detect the VFS version and run in either environments (JBoss AS 5 and JBoss AS 6).

      1. vfs.patch
        140 kB
        Marius Bogoevici

        Activity

        Hide
        Marius Bogoevici added a comment -

        An explanatory note about the issue: After deploying on JBoss AS 6.0.0.M3, applications that use CP scanning will fail with an error like:

        04:48:24,881 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed: java.lang.NoClassDefFoundError: org/jboss/virtual/VirtualFileVisitor

        which indicates the package renaming that took place in the server (should be org/jboss/vfs/VirtualFileVisitor

        Show
        Marius Bogoevici added a comment - An explanatory note about the issue: After deploying on JBoss AS 6.0.0.M3, applications that use CP scanning will fail with an error like: 04:48:24,881 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed: java.lang.NoClassDefFoundError: org/jboss/virtual/VirtualFileVisitor which indicates the package renaming that took place in the server (should be org/jboss/vfs/VirtualFileVisitor
        Hide
        Marius Bogoevici added a comment -

        Attached a patch for fixing the issue. Introduces an abstraction layer that detects the VFS version on the CP. As the operations are performed by reflection, it is not necessary to compile against the JBoss VFS jars anymore. The patch is produced by svn diff and has picked up some ipr changes as well. The latter can be discarded.

        Show
        Marius Bogoevici added a comment - Attached a patch for fixing the issue. Introduces an abstraction layer that detects the VFS version on the CP. As the operations are performed by reflection, it is not necessary to compile against the JBoss VFS jars anymore. The patch is produced by svn diff and has picked up some ipr changes as well. The latter can be discarded.
        Hide
        Juergen Hoeller added a comment -

        Thomas, any chance that you could have a look at this for 3.0.3 still? At least for an initial cut that works across JBoss AS 5 and 6?

        Juergen

        Show
        Juergen Hoeller added a comment - Thomas, any chance that you could have a look at this for 3.0.3 still? At least for an initial cut that works across JBoss AS 5 and 6? Juergen
        Hide
        Marius Bogoevici added a comment -

        Jürgen, Thomas,

        Thanks for looking into this so quickly. If the fix could be done for 3.0.3 it would be awesome. Let me know if I can be of any help.

        Marius

        Show
        Marius Bogoevici added a comment - Jürgen, Thomas, Thanks for looking into this so quickly. If the fix could be done for 3.0.3 it would be awesome. Let me know if I can be of any help. Marius
        Hide
        Juergen Hoeller added a comment -

        I've changed this issue to an improvement since it's not really Spring's fault that JBoss AS changed its VFS package - and we didn't have a chance know about it upfront (i.e. at 3.0 GA time). JBoss 6 simply wasn't fully supported before.

        In any case, it would be great if we could provide a painless user experience on JBoss 6 for Spring 3.0.3 already. That said - I am concerned that the integration testing effort might not easily fit into the 3.0.3 timeframe anymore...

        Juergen

        Show
        Juergen Hoeller added a comment - I've changed this issue to an improvement since it's not really Spring's fault that JBoss AS changed its VFS package - and we didn't have a chance know about it upfront (i.e. at 3.0 GA time). JBoss 6 simply wasn't fully supported before. In any case, it would be great if we could provide a painless user experience on JBoss 6 for Spring 3.0.3 already. That said - I am concerned that the integration testing effort might not easily fit into the 3.0.3 timeframe anymore... Juergen
        Hide
        Costin Leau added a comment -

        Committed the fix - tested it on JBoss 6 M3 and 5.1. Additional testing is welcome.

        Show
        Costin Leau added a comment - Committed the fix - tested it on JBoss 6 M3 and 5.1. Additional testing is welcome.
        Hide
        Juergen Hoeller added a comment -

        I'll consider this as finished, with just some smoke re-testing to be done from our side before the 3.0.3 release.

        Would be great to have this tested in others' JBoss environments as well, of course...

        Juergen

        Show
        Juergen Hoeller added a comment - I'll consider this as finished, with just some smoke re-testing to be done from our side before the 3.0.3 release. Would be great to have this tested in others' JBoss environments as well, of course... Juergen
        Hide
        Marius Bogoevici added a comment -

        Costin, Juergen,

        I have tested tonight's trunk version of Spring 3 against JBoss AS 5.1 and 6(M3/trunk) and it everything looks fine.

        Thanks for applying the patch!

        Show
        Marius Bogoevici added a comment - Costin, Juergen, I have tested tonight's trunk version of Spring 3 against JBoss AS 5.1 and 6(M3/trunk) and it everything looks fine. Thanks for applying the patch!
        Hide
        Nick Williams added a comment -

        Just for the benefit of replication, I have confirmed that this is no longer a problem. I had 3.0.1 and was getting this error, but when I upgraded the libraries to 3.0.5 the error went away.

        Show
        Nick Williams added a comment - Just for the benefit of replication, I have confirmed that this is no longer a problem. I had 3.0.1 and was getting this error, but when I upgraded the libraries to 3.0.5 the error went away.

          People

          • Assignee:
            Costin Leau
            Reporter:
            Marius Bogoevici
            Last updater:
            Trevor Marshall
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 10 weeks, 6 days ago