You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Janko Heilgeist (JIRA)" <ji...@apache.org> on 2008/12/15 13:59:44 UTC

[jira] Created: (GERONIMO-4468) elements are interpreted relatively to EAR root

<jar-file> elements are interpreted relatively to EAR root
----------------------------------------------------------

                 Key: GERONIMO-4468
                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
    Affects Versions: 2.1.3
            Reporter: Janko Heilgeist


The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.

EJB 3.0 persistence spec, section 6.2:
{quote}
[...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
{quote}

EJB 3.0 persistence spec, section 6.2:
{quote}
One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
{quote}

The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:

{quote}
<openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)

<openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
{quote}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Janko Heilgeist (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664122#action_12664122 ] 

Janko Heilgeist commented on GERONIMO-4468:
-------------------------------------------

I tried the patch and it seems to solve the issue (partially?). The referenced jar-files are now correctly resolved, but not all the entities inside of all jars are discovered. (In the following traces I replaced the path of the deployed EAR with $(EAR_ROOT) to make them more readable.)

1. EAR structure as before:
{noformat}
lib/my-pu-1.0-SNAPSHOT.jar
lib/my-entities1-1.0-SNAPSHOT.jar
my-entities2-1.0-SNAPSHOT.jar
{noformat}

During deployment only the entity in the jar on the same level as the persistence root is discovered:
{noformat}
2  myPU  TRACE  [Thread-62] openjpa.MetaData - Scanning jar "$(EAR_ROOT)/lib/my-pu-1.0-SNAPSHOT.jar" for persistent types.
2  myPU  TRACE  [Thread-62] openjpa.MetaData - Scanning jar file from URL "file:$(EAR_ROOT)/lib/my-entities1-1.0-SNAPSHOT.jar" for persistent types.
2  myPU  TRACE  [Thread-62] openjpa.MetaData - Scanning jar file from URL "file:$(EAR_ROOT)/my-entities2-1.0-SNAPSHOT.jar" for persistent types.
3  myPU  TRACE  [Thread-62] openjpa.MetaData - Scanning resource "META-INF/orm.xml" for persistent types.
5  myPU  TRACE  [Thread-62] openjpa.MetaData - Scan of "META-INF/orm.xml" found persistent types [Ljava.lang.String;@fe9034.
5  myPU  TRACE  [Thread-62] openjpa.MetaData - Mapping resource location "jar:file:$(EAR_ROOT)/lib/my-entities1-1.0-SNAPSHOT.jar!/META-INF/orm.xml" to persistent types "[com.heilgeist.testcase.geronimo.jarfile.MyEntity1]".
5  myPU  TRACE  [Thread-62] openjpa.MetaData - parsePersistentTypeNames() found [com.heilgeist.testcase.geronimo.jarfile.MyEntity1].
5  myPU  TRACE  [Thread-62] openjpa.MetaData - Found 1 classes with metadata in 3 milliseconds.
{noformat}

2. EAR with both jars next to the persistence root:
{noformat}
lib/my-pu-1.0-SNAPSHOT.jar
lib/my-entities1-1.0-SNAPSHOT.jar
lib/my-entities2-1.0-SNAPSHOT.jar
{noformat}

During deployment both entities are discovered:
{noformat}
2  myPU  TRACE  [Thread-61] openjpa.MetaData - Scanning jar "$(EAR_ROOT)/lib/my-pu-1.0-SNAPSHOT.jar" for persistent types.
2  myPU  TRACE  [Thread-61] openjpa.MetaData - Scanning jar file from URL "file:$(EAR_ROOT)/lib/my-entities2-1.0-SNAPSHOT.jar" for persistent types.
2  myPU  TRACE  [Thread-61] openjpa.MetaData - Scanning jar file from URL "file:$(EAR_ROOT)/lib/my-entities1-1.0-SNAPSHOT.jar" for persistent types.
2  myPU  TRACE  [Thread-61] openjpa.MetaData - Scanning resource "META-INF/orm.xml" for persistent types.
5  myPU  TRACE  [Thread-61] openjpa.MetaData - Scan of "META-INF/orm.xml" found persistent types [Ljava.lang.String;@1f0c908.
5  myPU  TRACE  [Thread-61] openjpa.MetaData - Mapping resource location "jar:file:$(EAR_ROOT)/lib/my-entities1-1.0-SNAPSHOT.jar!/META-INF/orm.xml" to persistent types "[com.heilgeist.testcase.geronimo.jarfile.MyEntity1]".
5  myPU  TRACE  [Thread-61] openjpa.MetaData - Scan of "META-INF/orm.xml" found persistent types [Ljava.lang.String;@11e3986.
5  myPU  TRACE  [Thread-61] openjpa.MetaData - Mapping resource location "jar:file:$(EAR_ROOT)/lib/my-entities2-1.0-SNAPSHOT.jar!/META-INF/orm.xml" to persistent types "[com.heilgeist.testcase.geronimo.jarfile.MyEntity2]".
5  myPU  TRACE  [Thread-61] openjpa.MetaData - parsePersistentTypeNames() found [com.heilgeist.testcase.geronimo.jarfile.MyEntity2, com.heilgeist.testcase.geronimo.jarfile.MyEntity1].
5  myPU  TRACE  [Thread-61] openjpa.MetaData - Found 2 classes with metadata in 4 milliseconds.
{noformat}

I am not sure, whether this is related to this issue (a consequence of the patch?) or a separate problem.

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (GERONIMO-4468) elements are interpreted relatively to EAR root instead of persistence unit

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods updated GERONIMO-4468:
-----------------------------------

    Summary: <jar-file> elements are interpreted relatively to EAR root instead of persistence unit  (was: <jar-file> elements are interpreted relatively to EAR root)

> <jar-file> elements are interpreted relatively to EAR root instead of persistence unit
> --------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: persistence
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>             Fix For: 2.1.4, 2.2
>
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Ivan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665054#action_12665054 ] 

Ivan commented on GERONIMO-4468:
--------------------------------

Maybe I do not express the issue clearly  :-(
For the classloader of the ear package, only those jars in the library folder (default is "lib") and those modules defined in the application.xml are loaded. While in the ear provided by Janko, he moved a jar file from the lib folder to its parent folder. The structure is like 
ear
---a.jar
lib3.jar <- (This jar is moved from the sub folder "lib")
---lib
    ---lib1.jar
    ---lib2.jar

For lib3.jar is not defined in the applications.xml via module element and not in the library folder, but the persistence.xml links it via a jar-file element,  and we just copy the temp classloader  from the ear classloader, so the entity classes in it  could not find by the OpenJPA. That is why I wish to pass the jars of the jar-file, and we could include those jars while building the temporary classloader.
About exclude-unlisted-classes, I just find the codes is somewhat conflict with some descriptions in an online document, so I mentioned it. Actually, even the jar files take no effect, we also need to pass the jar files for the reason above, if I do not miss anything :-)



> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Ivan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664448#action_12664448 ] 

Ivan commented on GERONIMO-4468:
--------------------------------

Another reason is that we may need it to build the tempclassloader, by default, only those jars in the lib directory will be added to the classloader of that ear. Or we will encounter the issue mentioned by Janko, not all the entity classes are found.
Thanks for giving a comment ! Wish I do not make a mistake :-)

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Ivan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665063#action_12665063 ] 

Ivan commented on GERONIMO-4468:
--------------------------------

Oops, :-(
I have not read the specs about this. 
So Janko, do you mean that specs defines that all the jar files in the jar-file elements could only be in the lib folder or defined as a module ? If so, only the first patch file is needed.
Thanks !

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Janko Heilgeist (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Janko Heilgeist updated GERONIMO-4468:
--------------------------------------

    Attachment:     (was: my-ear-1.0-SNAPSHOT.ear)

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>         Attachments: geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Ivan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan reassigned GERONIMO-4468:
------------------------------

    Assignee: Ivan

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Janko Heilgeist (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Janko Heilgeist updated GERONIMO-4468:
--------------------------------------

    Attachment:     (was: geronimo-jarfile.tar.gz)

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>         Attachments: my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Ivan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665041#action_12665041 ] 

Ivan commented on GERONIMO-4468:
--------------------------------

Thanks for your comments, David.
Yes, that is what is done in the past codes, we copied the parent classloader to be the temporary classloader used by OpenJPA.
Do you mean that we need to enhance the parent classloader to make all the jar files in the ear package visible ? And we should not add those jars in the jar-file elements while building the temporary classloader ?
I guess that only two ways are front of us, one is make the ear classloader could load all the jars in ear, another way is to make those jars visible in the temporary classloader.

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Janko Heilgeist (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Janko Heilgeist updated GERONIMO-4468:
--------------------------------------

    Attachment: geronimo-jarfile.tar.gz
                my-ear-1.0-SNAPSHOT.ear

Simplified sample EAR

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>         Attachments: geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Janko Heilgeist (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665079#action_12665079 ] 

Janko Heilgeist commented on GERONIMO-4468:
-------------------------------------------

I think "could only be in the lib folder or defined as a module" is to strict. The location of a jar-file can be anywhere in the EAR as long as it is on the classpath of the persistence unit (PU). What about jar files that are referenced with a {{Class-Path:}} entry in the PU's {{MANIFEST.MF}}?  I expect that all the ways that a class could possibly end up on a PU's classpath are already considered when the runtime classpath of a PU is determined.

If I understand David correctly, then it is sufficient to use the copy of the PU's runtime classpath as it is already done.

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods updated GERONIMO-4468:
-----------------------------------

      Component/s: persistence
       Patch Info: [Patch Available]
    Fix Version/s: 2.2
                   2.1.4

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: persistence
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>             Fix For: 2.1.4, 2.2
>
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Ivan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665085#action_12665085 ] 

Ivan commented on GERONIMO-4468:
--------------------------------

Thanks, Janko and David, I learned a lot about JPA through this issue :-)

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "David Jencks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664600#action_12664600 ] 

David Jencks commented on GERONIMO-4468:
----------------------------------------

I would trust the code more than the documentation :-)

The <jar-file> element doesn't change the contents of any runtime classloaders, so if a class is only visible by being in a jar in a jar-file element then it won't be available at run time.  I thought that we copied the run time classloader to obtain the temporary classloader.  Any class in a parent classloader will presumably have been already loaded so it would have needed to be pre-enhanced since  the runtime enhancement cant know to deal with it.  So only stuff in the current classloader can possibly be subject to runtime enhancement.  So, I'm stll pretty sure that passing the list of classes _or_ passing the list of jars but not both is the correct behavior.

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (GERONIMO-4468) elements are interpreted relatively to EAR root instead of persistence unit

Posted by "Forrest Xia (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Forrest Xia updated GERONIMO-4468:
----------------------------------

    Attachment: my-ear-1.0-SNAPSHOT_PUjarinwebclasses_ejbjarinweblib.ear

More tries:
1. To my self question 1, the answer is "conditional" yes. we need to add a ejb-module in application.xml, and set ejb jar manifest having a Class-Path entry to the PU jar file.
2. Tried put PU in web module library directory with attached "my-ear-1.0-SNAPSHOT_PUjarinwebclasses_ejbjarinweblib.ear", but seems Geronimo did not allow PU in web module. The exception as following. Is it a bug?

At least one deployment problem:[org.apache.geronimo.common.DeploymentException: Could not resolve reference at deploy time for query com.heilgeist.testcase.geronimo.jarfile/my-ear/1.0-SNAPSHOT/ear?J2EEApplication=com.heilgeist.testcase.geronimo.jarfile/my-ear/1.0-SNAPSHOT/ear,PersistenceUnitModule=WEB-INF/lib/my-pu-1.0-SNAPSHOT_inclasses.jar,WebModule=my-war-1.0-SNAPSHOT.war,j2eeType=PersistenceUnit,name=myPU#. No GBean references found.]
org.apache.geronimo.common.DeploymentException: At least one deployment problem:[org.apache.geronimo.common.DeploymentException: Could not resolve reference at deploy time for query com.heilgeist.testcase.geronimo.jarfile/my-ear/1.0-SNAPSHOT/ear?J2EEApplication=com.heilgeist.testcase.geronimo.jarfile/my-ear/1.0-SNAPSHOT/ear,PersistenceUnitModule=WEB-INF/lib/my-pu-1.0-SNAPSHOT_inclasses.jar,WebModule=my-war-1.0-SNAPSHOT.war,j2eeType=PersistenceUnit,name=myPU#. No GBean references found.]
	at org.apache.geronimo.persistence.builder.PersistenceUnitRefBuilder.buildNaming(PersistenceUnitRefBuilder.java:154)
	at org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
	at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.configureBasicWebModuleAttributes(AbstractWebModuleBuilder.java:842)
	at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.addGBeans(TomcatModuleBuilder.java:347)
	at org.apache.geronimo.j2ee.deployment.SwitchingModuleBuilder.addGBeans(SwitchingModuleBuilder.java:165)
	at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
	at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:254)
	at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:599)
	at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
	at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
	at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
	at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
	at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
	at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
	at java.lang.Thread.run(Thread.java:735)


> <jar-file> elements are interpreted relatively to EAR root instead of persistence unit
> --------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: persistence
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>             Fix For: 2.1.4, 2.2
>
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear, my-ear-1.0-SNAPSHOT_PUjarfileinEARroot.ear, my-ear-1.0-SNAPSHOT_PUjarinwebclasses_ejbjarinweblib.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Janko Heilgeist (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Janko Heilgeist updated GERONIMO-4468:
--------------------------------------

    Attachment: my-ear-1.0-SNAPSHOT.ear
                geronimo-jarfile.tar.gz

The EAR contains an empty servlet set to "load-on-startup" just to make the error visible on deployment.

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>         Attachments: geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Ivan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan updated GERONIMO-4468:
---------------------------

    Attachment: Geronimo-4468-01.patch

Thanks for the verification, Janko.
It was caused by another bug  ;-(, I update the patch file. It contains three changes :
a. Make the jar URL is related to the persistence unit root.
b. Add the jar URLs to the temp classloader, so that OpenJPA could find all entity classes.
c. Per the persistence doc, when exclude-unlisted-classes is set with true, it means only listed classes and jars in the persistence.xml will be scanned, otherwise, all will be scanned. So we always need to pass the jarFileUrls to OpenJPA.
Please help to review the patch, thanks !

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Ivan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664444#action_12664444 ] 

Ivan commented on GERONIMO-4468:
--------------------------------

I just refer to the doc in http://cwiki.apache.org/confluence/display/GMOxDOC22/persistence.xml, it writes :
<exclude-unlisted-classes>
When set to true, only listed classes and jars will be scanned for persistent classes. Otherwise the enclosing jar or directory will also be scanned. This is not applicable to Java SE persistence units. The following XML fragment illustrate the use of exclude-unlisted-classes element.
Is that doc wrong ? I will check the specification about how it says about the exclude-unlisted-classes.



> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (GERONIMO-4468) elements are interpreted relatively to EAR root instead of persistence unit

Posted by "Forrest Xia (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Forrest Xia updated GERONIMO-4468:
----------------------------------

    Attachment: my-ear-1.0-SNAPSHOT_PUjarfileinEARroot.ear

Tried putting PU jar file(attached "my-ear-1.0-SNAPSHOT_PUjarfileinEARroot.ear") in the EAR root and then deploy it, an exception happens:
At least one deployment problem:[org.apache.geronimo.common.DeploymentException: No default PersistenceUnit specified, and none located]
org.apache.geronimo.common.DeploymentException: At least one deployment problem:[org.apache.geronimo.common.DeploymentException: No default PersistenceUnit specified, and none located]
	at org.apache.geronimo.persistence.builder.PersistenceUnitRefBuilder.buildNaming(PersistenceUnitRefBuilder.java:154)
	at org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
	at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.configureBasicWebModuleAttributes(AbstractWebModuleBuilder.java:842)
	at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.addGBeans(TomcatModuleBuilder.java:347)
	at org.apache.geronimo.j2ee.deployment.SwitchingModuleBuilder.addGBeans(SwitchingModuleBuilder.java:165)
	at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
	at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:254)
	at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:599)
	at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
	at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
	at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
	at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
	at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
	at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
	at java.lang.Thread.run(Thread.java:735)

So,
Question 1: does Geronimo support put PU jar in the EAR root?

Question 2: Does Geronimo accept persistence.xml in EAR_ROOT/META-INF directory?
I also tried putting persistence.xml in EAR_ROOT/META_INF, it does not work in Geronimo as well. But I ever tried JBoss 5, it works!

> <jar-file> elements are interpreted relatively to EAR root instead of persistence unit
> --------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: persistence
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>             Fix For: 2.1.4, 2.2
>
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear, my-ear-1.0-SNAPSHOT_PUjarfileinEARroot.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (GERONIMO-4468) elements are interpreted relatively to EAR root instead of persistence unit

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods resolved GERONIMO-4468.
------------------------------------

    Resolution: Fixed

Applied only first patch Geronimo-4468.patch to branches/2.1 (2.1.4-SNAPSHOT) as Rev735769. 

> <jar-file> elements are interpreted relatively to EAR root instead of persistence unit
> --------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: persistence
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>             Fix For: 2.1.4, 2.2
>
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "David Jencks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664428#action_12664428 ] 

David Jencks commented on GERONIMO-4468:
----------------------------------------

Could you explain why we need to pass the list of jars to openjpa if exclude-unlisted-classes is set to true?  My recollection is that passing the list of jar files breaks the exclude-unlisted-classes behavior and that openjpa has no problem finding all the classes if you don't pass the list of jars but just the list of classes.  It has been a couple of years since I looked at this so my recollection might not be accurate.

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Ivan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan updated GERONIMO-4468:
---------------------------

    Attachment: Geronimo-4468.patch

Per the EJB 3.0 Persistence specification, now change the jar URL is related to the persistence unit root. 
Please help to review the patch, thanks !

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "Janko Heilgeist (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665060#action_12665060 ] 

Janko Heilgeist commented on GERONIMO-4468:
-------------------------------------------

David, I consulted the specification to refresh my memory on the persistence.xml file. You're right, the specification says in section 6.2.6.1:

bq. The classes and/or jars that are named as part of a persistence unit must be on the classpath; referencing them from the {{persistence.xml}} file does not cause them to be placed on the classpath.

So, the mistake was mine: OpenJPA was correct to ignore the entities not on the application classpath.

Regarding my use of the exclude-unlisted-classes property: I remembered its usage like it is shown in example 4, section 6.2.1.8, that is specifying the tag as {{<exclude-unlisted-classes/>}} sets the property to true; not specifying the tag sets the property to false. Looking through the schema of persistence.xml, I can see that it is actually used as {{<exclude-unlisted-classes>true</exclude-unlisted-classes>}} and, correspondingly, to set the property to false. The {{persistence.xml}} included in my sample code didn't do, what I expected it to do.

My apologies for complicating the whole issue...

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "David Jencks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665050#action_12665050 ] 

David Jencks commented on GERONIMO-4468:
----------------------------------------

I don't understand what the problem is yet, now that you've fixed the calculation of the jar file location.  IIUC the only problems that have been seen are when exclude-unlisted-classes is false and some jar-file elements are provided. If so we should not change the behavior when exclude-unlisted-classes is true.

IMO and AFAICT the jar-file elements have to refer to jars that are already in the application classpath so they will already be in the application classloader and temporary classloader.  Otherwise we would have to add these jars to the actual application classloader which AFAIK is not mentioned anywhere in any spec.

Finally, I have a very strong recollection that when I supplied jar files and a list of classes and exclude-unlisted-classes = true to openjpa nothing worked (or at least something important didn't work).  I don't remember too clearly what didn't work but it might have been that if you supply the jar files the list of classes is ignored.

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4468) elements are interpreted relatively to EAR root

Posted by "David Jencks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665152#action_12665152 ] 

David Jencks commented on GERONIMO-4468:
----------------------------------------

Just to be clear -- I agree with Janko, to get a non-lib jar avaliable for jpa you need to include it in the module's manifest class path.  As a warning note that if you include this jar in several web module manifest classpaths each web app will load the classes in its own classloader so transferring one of these objects from web app to web app will result in ClassCastExceptions.

> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: persistence
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>             Fix For: 2.1.4, 2.2
>
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4468) elements are interpreted relatively to EAR root instead of persistence unit

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665182#action_12665182 ] 

Donald Woods commented on GERONIMO-4468:
----------------------------------------

Applied only first patch Geronimo-4468.patch to trunk as Rev735768.

> <jar-file> elements are interpreted relatively to EAR root instead of persistence unit
> --------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: persistence
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>             Fix For: 2.1.4, 2.2
>
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, while on the console OpenJPA throws exceptions because it tries to resolve the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.