Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.3
    • Fix Version/s: unscheduled
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      1,799

      Description

      On WLS 10.3b the managed beans annotated with @ManagedBean are not recognized.
      The problem is that WLS classloader delivers the URLs to the jars with "zip:"
      protocol. In line 293-295 the url is prefixed with "jar:" if it is not already
      "jar:" protocol - on WLS that leads to "jar:zip:C:/path/to/the.jar" and getting
      the JarFile from JarURLConnection (line 298-299) fails.

      My patch is very simple - if the URL has zip: protocol teh zip: path is changed
      to file: - resulting in URL "jar:file:C:/path/to/the.jar".

      It works in WLS 10.3b on Windows - need additional tests with non-exploded
      deployment and on Solaris though.

      regards
      Hanspeter

      1. AnnotationScanner-1799.patch
        1 kB
        Hanspeter Duennenberger
      2. AnnotationScanner-1799.patch
        1 kB
        Hanspeter Duennenberger
      3. AnnotationScanner-1799.patch
        0.9 kB
        Hanspeter Duennenberger

        Activity

        Hide
        Hanspeter Duennenberger added a comment -

        Created an attachment (id=1272)
        proposed patch to get AnnotationScanner working on WLS

        Show
        Hanspeter Duennenberger added a comment - Created an attachment (id=1272) proposed patch to get AnnotationScanner working on WLS
        Hide
        Ed Burns added a comment -

        I'm exploring if this issue is related to <https://glassfish.dev.java.net/issues/show_bug.cgi?id=11636>.

        Show
        Ed Burns added a comment - I'm exploring if this issue is related to < https://glassfish.dev.java.net/issues/show_bug.cgi?id=11636 >.
        Hide
        Ed Burns added a comment -

        Applying patch now.

        Show
        Ed Burns added a comment - Applying patch now.
        Hide
        Ed Burns added a comment -

        Committed revision 8590.

        Show
        Ed Burns added a comment - Committed revision 8590.
        Hide
        Hanspeter Duennenberger added a comment -

        Hi Ed.
        I did some more investigation about this JarURLConnection - see
        http://download.oracle.com/javase/6/docs/api/java/net/JarURLConnection.html.
        JarURLConnection only supports jar:file: and jar:http: (maybe also jar:https:?),
        but for annotation scanning we only need to support local jars, so we should be
        fine by always using jar:file:. Therefore I'll add another patch to this issue -
        it always sets jar:file: and then the url.getPath() and the "!/" marker. It
        works fine on my side.

        I still have another issue with Weblogic: managed beans defined by Annotation
        @ManagedBean are only loaded when using the exploded deployment mode of WLS. In
        non-exploded mode the managed bean is silently not loaded even with
        WeblogicInjectionProvider added. But I guess that is a different issue

        regards
        Hanspeter

        Show
        Hanspeter Duennenberger added a comment - Hi Ed. I did some more investigation about this JarURLConnection - see http://download.oracle.com/javase/6/docs/api/java/net/JarURLConnection.html . JarURLConnection only supports jar:file: and jar:http: (maybe also jar:https:?), but for annotation scanning we only need to support local jars, so we should be fine by always using jar: file: . Therefore I'll add another patch to this issue - it always sets jar:file: and then the url.getPath() and the "!/" marker. It works fine on my side. I still have another issue with Weblogic: managed beans defined by Annotation @ManagedBean are only loaded when using the exploded deployment mode of WLS. In non-exploded mode the managed bean is silently not loaded even with WeblogicInjectionProvider added. But I guess that is a different issue regards Hanspeter
        Hide
        Hanspeter Duennenberger added a comment -

        Created an attachment (id=1277)
        AnnotationScanner patch to always use jar:file: for the JarUrlConnection

        Show
        Hanspeter Duennenberger added a comment - Created an attachment (id=1277) AnnotationScanner patch to always use jar:file: for the JarUrlConnection
        Hide
        Hanspeter Duennenberger added a comment -

        Created an attachment (id=1278)
        real AnnotationScanner patch - using always jar:file: protocol

        Show
        Hanspeter Duennenberger added a comment - Created an attachment (id=1278) real AnnotationScanner patch - using always jar:file: protocol
        Hide
        Hanspeter Duennenberger added a comment -

        Sorry, I was a bit too hasty with my previous patch file. The one from 10:54
        does'nt work, the last patch really works.

        And we also found the problem why in our case on WLS with packaged deployment
        the annotation scanning did not work - that is a packaging issue on our side:
        with exploded deployment all web app classes end up on WEB-INF/classes, but
        packaged deployment produces a jar from the web app classes and there of course
        the META-INF/faces-config.xml file was missing. With that added it works fine now.

        regards
        Hanspeter

        Show
        Hanspeter Duennenberger added a comment - Sorry, I was a bit too hasty with my previous patch file. The one from 10:54 does'nt work, the last patch really works. And we also found the problem why in our case on WLS with packaged deployment the annotation scanning did not work - that is a packaging issue on our side: with exploded deployment all web app classes end up on WEB-INF/classes, but packaged deployment produces a jar from the web app classes and there of course the META-INF/faces-config.xml file was missing. With that added it works fine now. regards Hanspeter
        Hide
        Manfred Riem added a comment -

        Closing resolved issue out

        Show
        Manfred Riem added a comment - Closing resolved issue out

          People

          • Assignee:
            Ed Burns
            Reporter:
            Hanspeter Duennenberger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: