Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-1217

toUrl in PerisstenceUnitInfoImpl can create weird url when file is not a file but a jar link

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.7.0
    • None
    • None

    Description

      Index: src/main/java/org/apache/openejb/persistence/PersistenceUnitInfoImpl.java
      ===================================================================
      — src/main/java/org/apache/openejb/persistence/PersistenceUnitInfoImpl.java (revision 1596160)
      +++ src/main/java/org/apache/openejb/persistence/PersistenceUnitInfoImpl.java (working copy)
      @@ -250,6 +250,13 @@
      }

      private URL toUrl(final File root) throws MalformedURLException {
      + if (!root.isFile() && root.getPath().startsWith("jar:file:")) {
      + try

      { + return new URL(root.getPath()); + }

      catch (final MalformedURLException me)

      { + // no-op: keep previous behavior + }

      + }
      return root.toURI().toURL();
      }

      Attachments

        Activity

          People

            romain.manni-bucau Romain Manni-Bucau
            romain.manni-bucau Romain Manni-Bucau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: