jersey
  1. jersey
  2. JERSEY-2085

nested jar can't find class path resource.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: core
    • Labels:
    • Sprint:
      Triaged

      Description

      nested jar files structured in the following way:

       
        nested.jar
          ||-- lib
             ||--jersey-server2.2.jar
             ||--
             ||-- jersey-spring3-2.2.jar
                ||-- org.glassfish..... 
      

       
      ResourceFinderException occurs.
      This is exception stacktrace.

       
        org.glassfish.jersey.server.internal.scanning.ResourceFinderException: java.io.FileNotFoundException: .../boot-jetty.jar!/lib/jersey-spring3-2.2.jar (No such file or directory)
      	at org.glassfish.jersey.server.internal.scanning.JarZipSchemeResourceFinderFactory.create(JarZipSchemeResourceFinderFactory.java:86)
      	at org.glassfish.jersey.server.internal.scanning.JarZipSchemeResourceFinderFactory.create(JarZipSchemeResourceFinderFactory.java:64)
      	at org.glassfish.jersey.server.internal.scanning.PackageNamesScanner.addResourceFinder(PackageNamesScanner.java:280)
      	at org.glassfish.jersey.server.internal.scanning.PackageNamesScanner.init(PackageNamesScanner.java:196)
      	at org.glassfish.jersey.server.internal.scanning.PackageNamesScanner.<init>(PackageNamesScanner.java:153)
      	at org.glassfish.jersey.server.internal.scanning.PackageNamesScanner.<init>(PackageNamesScanner.java:110)
      	at org.glassfish.jersey.server.ResourceConfig.packages(ResourceConfig.java:665)
      

      This exception happends because JarZipSchemeResourceFinderFactory is one time split(! last index only).

        Activity

        Hide
        hay_dave added a comment -

        There is a work around, but it would be nice not to have to enumerate each JAR file that has packages we want to scan.

        https://github.com/spring-projects/spring-boot/issues/1345#issuecomment-51502294

        Show
        hay_dave added a comment - There is a work around, but it would be nice not to have to enumerate each JAR file that has packages we want to scan. https://github.com/spring-projects/spring-boot/issues/1345#issuecomment-51502294
        Hide
        cowwoc added a comment -

        According to https://github.com/spring-projects/spring-boot/issues/1468#issuecomment-84110173 this bug affects JAR files embedded in normal WAR files. Consider increasing the priority of this bug.

        Show
        cowwoc added a comment - According to https://github.com/spring-projects/spring-boot/issues/1468#issuecomment-84110173 this bug affects JAR files embedded in normal WAR files. Consider increasing the priority of this bug.
        Hide
        qunfei added a comment -

        I have fix this problem on my person jersey verison clone from jersery tag 2.14.(git checkout -b JERSEY-2085 2.14)

        https://github.com/wuqunfei/jersey/commit/2effce3fea521dee026a9d7103ee4e7099d9dbf9
        But I don't which jersery branch I could pull request. @cowwoc @hay_dave linusf @d0lphin @Marek Potociar

        Show
        qunfei added a comment - I have fix this problem on my person jersey verison clone from jersery tag 2.14.(git checkout -b JERSEY-2085 2.14) https://github.com/wuqunfei/jersey/commit/2effce3fea521dee026a9d7103ee4e7099d9dbf9 But I don't which jersery branch I could pull request. @cowwoc @hay_dave linusf @d0lphin @Marek Potociar
        Hide
        Stepan Vavra added a comment -

        We'll take a look at it (hopefully soon).
        If possible, create a pull request against the master branch (and possibly 2.x).

        Show
        Stepan Vavra added a comment - We'll take a look at it (hopefully soon). If possible, create a pull request against the master branch (and possibly 2.x ).
        Hide
        qunfei added a comment -

        the bug was fixed, please merge it.
        https://github.com/jersey/jersey/pull/196

        Show
        qunfei added a comment - the bug was fixed, please merge it. https://github.com/jersey/jersey/pull/196

          People

          • Assignee:
            Unassigned
            Reporter:
            otkmnb2783
          • Votes:
            6 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:

              Agile