Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 9.0pe
    • Fix Version/s: 9.0pe_dev
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      228

      Description

      I have a web module with persistence unit like this:

      <?xml version="1.0" encoding="UTF-8"?>
      <persistence xmlns="http://java.sun.com/xml/ns/persistence">
      <persistence-unit name="pokus" transaction-type="JTA">
      <jta-data-source>jdbc/__default</jta-data-source>
      </persistence-unit>
      </persistence>

      I am using netbeans javaee5 build to deploy, i.e. using directory deployment.
      Testing with b37 (I think the same problem already exists in b35). If I build
      the module into c:\work\build and deploy from there it works. If I build/deploy
      from c:\Documents and Settings\.....etc I get:

      Exception Description: An exception was thrown while searching for entities at
      URL:
      file:/C:/Documents%20and%20Settings/pb97924/Relationships/build/web/WEB-INF/classes/
      Internal Exception: java.util.zip.ZipException: The system cannot find the path
      specified
      Local Exception Stack:
      Exception [TOPLINK-30006] (Oracle TopLink Essentials - 10g release 4
      (10.1.4.0.0) (Build 060124Dev)):
      oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
      Exception Description: An exception was thrown while searching for entities at
      URL:
      file:/C:/Documents%20and%20Settings/pb97924/Relationships/build/web/WEB-INF/classes/
      Internal Exception: java.util.zip.ZipException: The system cannot find the path
      specified
      at
      oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException.exceptionSearchingForEntities(PersistenceUnitLoadingException.java:116)
      at
      oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.getClassNamesFromJar(PersistenceUnitProcessor.java:341)
      at
      oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.getPersistentClassNamesFromJar(PersistenceUnitProcessor.java:433)

      and after that the persistence unit is not found, of course.
      This works OK in build 33.

        Activity

        Hide
        marina vatkina added a comment -

        Reassigned

        Show
        marina vatkina added a comment - Reassigned
        Hide
        tware added a comment -

        Reducing priority because easy workaround is available.

        Workaround is mentioned in the issue description - put persistence unit in a
        directory without spaces.

        Show
        tware added a comment - Reducing priority because easy workaround is available. Workaround is mentioned in the issue description - put persistence unit in a directory without spaces.
        Hide
        pkrogh added a comment -

        Reassigning issue to Marina

        Show
        pkrogh added a comment - Reassigning issue to Marina
        Hide
        marina vatkina added a comment -

        From Tim's email:

        Improper use of a URL in creating a File instance.

        I've also seen cases like this:

        URL url = ...;
        File f = new File(url.toString());

        The problem here is that url.toString can produce a string containing %20
        instead of spaces, for example. These encodings are not correct for specifying
        the path in a File constructor.
        One way around this is to use

        File f = new File(url.toURI())

        because File has a constructor with URI as an argument.

        What's really a pain in the neck is that these problems typically do not appear
        on Linux or Solaris because people rarely have paths with spaces but often
        appear on Windows (which few of us use) which many of our customer/developers
        use and which often have spaces in the path.

        ----------------
        Fixing all cases....

        Show
        marina vatkina added a comment - From Tim's email: Improper use of a URL in creating a File instance. I've also seen cases like this: URL url = ...; File f = new File(url.toString()); The problem here is that url.toString can produce a string containing %20 instead of spaces, for example. These encodings are not correct for specifying the path in a File constructor. One way around this is to use File f = new File(url.toURI()) because File has a constructor with URI as an argument. What's really a pain in the neck is that these problems typically do not appear on Linux or Solaris because people rarely have paths with spaces but often appear on Windows (which few of us use) which many of our customer/developers use and which often have spaces in the path. ---------------- Fixing all cases....
        Hide
        marina vatkina added a comment -

        The regression in PersistenceUnitProcessor happened beteen v 1.5 and 1.6 with
        fixing issue 184.
        While most of the cases in 1.5 used correctly file.toURI().toURL(),
        this particular place (processDirectory()) called file.toURL().
        The changes in v1.6 replaced all file/url access, fixing one case
        but causing regression in the others.

        Show
        marina vatkina added a comment - The regression in PersistenceUnitProcessor happened beteen v 1.5 and 1.6 with fixing issue 184. While most of the cases in 1.5 used correctly file.toURI().toURL(), this particular place (processDirectory()) called file.toURL(). The changes in v1.6 replaced all file/url access, fixing one case but causing regression in the others.
        Hide
        marina vatkina added a comment -

        Fixed targeted build

        Show
        marina vatkina added a comment - Fixed targeted build
        Hide
        pbuzek added a comment -

        verified in build 39. thanks for the fix.

        Show
        pbuzek added a comment - verified in build 39. thanks for the fix.

          People

          • Assignee:
            marina vatkina
            Reporter:
            pbuzek
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: