glassfish
  1. glassfish
  2. GLASSFISH-20986

URISyntaxException when bundle contains file with spaces in name

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 4.0
    • Fix Version/s: None
    • Component/s: OSGi, OSGi-JavaEE
    • Labels:
      None

      Description

      When deploying an OSGi bundle containing files with spaces in the name I get the following error logged. In this case the bundle was an Apache FOP bundle.

      2014-02-14T09:56:00.357+0100|INFO: ERROR: Bundle org.glassfish.fighterfish.osgi-jpa [296] EventDispatcher: Error during dispatch. (java.lang.RuntimeException: java.net.URISyntaxException: Illegal character in path at index 40: bundle://402.0:0/org/apache/fop/pdf/sRGB Color Space Profile.icm)
      2014-02-14T09:56:00.358+0100|SEVERE: java.lang.RuntimeException: java.net.URISyntaxException: Illegal character in path at index 40: bundle://402.0:0/org/apache/fop/pdf/sRGB Color Space Profile.icm
      at org.glassfish.osgijavaeebase.OSGiBundleArchive.getEntryURI(OSGiBundleArchive.java:320)
      at org.glassfish.osgijavaeebase.OSGiBundleArchive$BundleResourceIterator.<init>(OSGiBundleArchive.java:718)
      at org.glassfish.osgijavaeebase.OSGiBundleArchive$BundleResourceIterator.<init>(OSGiBundleArchive.java:681)
      at org.glassfish.osgijavaeebase.OSGiBundleArchive.iterator(OSGiBundleArchive.java:329)
      at org.glassfish.osgijpa.JPABundleProcessor.discoverPxmls(JPABundleProcessor.java:99)
      at org.glassfish.osgijpa.JPABundleProcessor.isJPABundle(JPABundleProcessor.java:90)
      at org.glassfish.osgijpa.JPAExtender.bundleChanged(JPAExtender.java:117)
      at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:868)
      at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:789)
      at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:514)
      at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4408)
      at org.apache.felix.framework.Felix.installBundle(Felix.java:3048)
      at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:165)
      at org.apache.felix.fileinstall.internal.DirectoryWatcher.installOrUpdateBundle(DirectoryWatcher.java:981)
      at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:895)
      at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:808)
      at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:446)
      at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)
      Caused by: java.net.URISyntaxException: Illegal character in path at index 40: bundle://402.0:0/org/apache/fop/pdf/sRGB Color Space Profile.icm
      at java.net.URI$Parser.fail(URI.java:2829)
      at java.net.URI$Parser.checkChars(URI.java:3002)
      at java.net.URI$Parser.parseHierarchical(URI.java:3086)
      at java.net.URI$Parser.parse(URI.java:3034)
      at java.net.URI.<init>(URI.java:595)
      at java.net.URL.toURI(URL.java:938)
      at org.glassfish.osgijavaeebase.OSGiBundleArchive.getEntryURI(OSGiBundleArchive.java:318)
      ... 17 more

        Activity

        Hide
        Sanjeeb Sahoo added a comment -

        Seems like a bug in Felix. Bundle.getEntry() is returning a URL with space char in it. Let me see if we can work around it in our code.

        Show
        Sanjeeb Sahoo added a comment - Seems like a bug in Felix. Bundle.getEntry() is returning a URL with space char in it. Let me see if we can work around it in our code.
        Hide
        knut added a comment -

        I was actually first going to file this as a Felix bug, but then based on the stack trace elements I decided that it was probably more a Glassfish issue.

        Let me know if you want me to also report this as a Felix bug, so that it can also get fixed there.

        Show
        knut added a comment - I was actually first going to file this as a Felix bug, but then based on the stack trace elements I decided that it was probably more a Glassfish issue. Let me know if you want me to also report this as a Felix bug, so that it can also get fixed there.
        Hide
        Sanjeeb Sahoo added a comment -

        Yes, try reporting the issue in Felix. If they fix it, well and good, else let me know so that we can think of a work around in our end.

        Show
        Sanjeeb Sahoo added a comment - Yes, try reporting the issue in Felix. If they fix it, well and good, else let me know so that we can think of a work around in our end.
        Hide
        knut added a comment -

        Please note that i filed issue https://issues.apache.org/jira/browse/FELIX-4429 against Felix.

        Meanwhile I am wondering what the exact impact is of this problem. AFAICT the bundle was still resolved. But will this mean that some entries won't be accessible or are you aware of any problems this might cause? If so it may make sense to create a temporary workaround in Glassfish until a Felix version is used which fixes this problem.

        Show
        knut added a comment - Please note that i filed issue https://issues.apache.org/jira/browse/FELIX-4429 against Felix. Meanwhile I am wondering what the exact impact is of this problem. AFAICT the bundle was still resolved. But will this mean that some entries won't be accessible or are you aware of any problems this might cause? If so it may make sense to create a temporary workaround in Glassfish until a Felix version is used which fixes this problem.
        Hide
        Sanjeeb Sahoo added a comment -

        If the bundle contained any META-INF/persistence.xml files and if you wanted them to be processed by GlassFish OSGi/JPA module, then that won't happen due to this exception. Otherwise there is not any issue. Since you are not activating the bundle, I doubt you wanted its persistence.xml to be processed. So, I would say it's not a serious issue for now.

        Show
        Sanjeeb Sahoo added a comment - If the bundle contained any META-INF/persistence.xml files and if you wanted them to be processed by GlassFish OSGi/JPA module, then that won't happen due to this exception. Otherwise there is not any issue. Since you are not activating the bundle, I doubt you wanted its persistence.xml to be processed. So, I would say it's not a serious issue for now.
        Hide
        knut added a comment -

        Thank you for the explanation. At least in my case this is not a problem.

        Show
        knut added a comment - Thank you for the explanation. At least in my case this is not a problem.

          People

          • Assignee:
            Sanjeeb Sahoo
            Reporter:
            knut
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: