Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2892

persistence.xml: <jar-file> should take directory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.2.0
    • None
    • jpa, usability
    • None

    Description

      This is a legal statement in hibernate and eclipselink, but not in OpenJPA:

      setup

      <jar-file>file://${project.build.directory}</jar-file>
      

      This will resolve to something like:

      <jar-file>file:////home/user/git/apache/project/target/classes</jar-file>
      

      Expected output

      classes will be loaded

      actual output

      java.lang.IllegalArgumentException: The jar resource "file:////home/user/git/apache/project/target/classes" cannot be loaded

      where to change

      org/apache/openjpa/meta/AbstractCFMetaDataFactory.java:700

      rmannibucau found this snippet which does not take directories into account:

                          for (Object obj : urls) {
                              url = (URL) obj;
                              clss = cparser.parseTypeNames(new URLMetaDataIterator
                                      (url));
                              List<String> newNames = Arrays.asList(clss);
                              if (log.isTraceEnabled())
                                  log.trace(_loc.get("scan-found-names", newNames,
                                          rsrc));
                              names.addAll(newNames);
                              mapPersistentTypeNames(url, clss);
                          }
      
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            bmarwell Benjamin Marwell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: