You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Rick Curtis (JIRA)" <ji...@apache.org> on 2009/02/20 20:51:01 UTC

[jira] Created: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
---------------------------------------------------------------------------------------------------

                 Key: OPENJPA-932
                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
             Project: OpenJPA
          Issue Type: Bug
          Components: kernel
    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
            Reporter: Rick Curtis


I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 

After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Rick Curtis updated OPENJPA-932:
--------------------------------

    Attachment: OPENJPA-932-unitTest.patch

Modified slightly to build the bad-persistence.jar rather than check it into svn.

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932-2.0.patch, OPENJPA-932-2.0.patch, OPENJPA-932-unitTest.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Rick Curtis updated OPENJPA-932:
--------------------------------

    Attachment:     (was: OPENJPA-932-unitTest-resources.jar)

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932-2.0.patch, OPENJPA-932-2.0.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Donald Woods updated OPENJPA-932:
---------------------------------

    Fix Version/s:     (was: 2.0.0)
                   2.0.0-M3

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0-M2
>            Reporter: Rick Curtis
>            Assignee: Michael Dick
>             Fix For: 1.3.0, 2.0.0-M3
>
>         Attachments: OPENJPA-932.patch, OPENJPA-932.patch, OPENJPA932.test.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Commented: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

Posted by "Jeremy Bauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12708970#action_12708970 ] 

Jeremy Bauer commented on OPENJPA-932:
--------------------------------------

OPENJPA932.test.patch committed for Rick under revision 774393.  Nice work, Rick.  The code you've added to dynamically create and load a persistence jar on the fly would be a great addition to a general test utility.

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932.patch, OPENJPA-932.patch, OPENJPA932.test.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Commented: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

Posted by "Jeremy Bauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704293#action_12704293 ] 

Jeremy Bauer commented on OPENJPA-932:
--------------------------------------

Committed patch(es) for Rick to trunk under revision 769901.

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932.patch, OPENJPA-932.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Commented: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

Posted by "Jeremy Bauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681373#action_12681373 ] 

Jeremy Bauer commented on OPENJPA-932:
--------------------------------------

Comments on patches dated 2009-03-10 07:49 AM and 2009-03-11 08:41 AM.

1) PUNameCollision and related methods in ProductDerivations should be moved to PersistenceProductDerivation to keep openjpa-lib free of persistence artifacts.

2) Creating a jar is much preferred to checking one in, but I'm not sold on that yet either since (unless I'm mistaken) it is always in the classpath when running tests.  Anyone have other ideas for testing this scenario?

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932-2.0.patch, OPENJPA-932-2.0.patch, OPENJPA-932-unitTest.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Commented: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

Posted by "Jeremy Bauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679657#action_12679657 ] 

Jeremy Bauer commented on OPENJPA-932:
--------------------------------------

Comments on patch dated 2009-03-06 08:24 AM:

- I don't think a new trace group should be added specifically for this warning.  (OpenJPA trace groups are well documented in the manual, so if a new group would need to be doc'd if consensus is that a new group should be added.).  While this exception shows up during enhancement, it is in product derivation code so openjpa.Runtime may be better?

- I'm still struggling a bit with constructing a new config to get a logger, but OpenJPA doesn't really have anything configured at this point and I can't think of a cleaner way to get this important warning out there without other potentially messy changes.  The null check is good, IMHO.  The comment regarding its necessity can be removed.

- The error message isn't completely clear as to what the problem is or how to fix it.  I think wording which includes the notion that "persistence unit names should be unique" may help.  (I'd say must, but as this problem points out, we don't enforce it)

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932-2.0.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Rick Curtis updated OPENJPA-932:
--------------------------------

    Attachment: OPENJPA-932.patch

Looks like I forgot add my test case to SVN when I built the previous patch. 

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932.patch, OPENJPA-932.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Rick Curtis updated OPENJPA-932:
--------------------------------

    Attachment: OPENJPA-932.patch

* Refactored the code in response to comment one from above.

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Rick Curtis updated OPENJPA-932:
--------------------------------

    Attachment:     (was: OPENJPA-932.patch)

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932-2.0.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Commented: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

Posted by "Jeremy Bauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700293#action_12700293 ] 

Jeremy Bauer commented on OPENJPA-932:
--------------------------------------

Rick - I applied this patch and have a few comments/issues.

- I'm OK with loading an additional jar to the test classpath in the openjpa-persistence sub-project since there are very few tests that run in that package.  The code is only testing a warning path and shouldn't affect the behavior of those tests.

- I could not force the production of the new warning message using the provided code (which I think is the intent of bad-persistence.xml) since the persistence.xml's all use unique pu names.  Also, there was no test code to drive the code where the warning is logged.  Is one of the names used in bad-persistence supposed to be a duplicate?  Based on the code changes, the warning does not get logged unless one tries to create an emf with pu name that is a duplicate.  I created a simple test program to force the condition and it worked fine, but I think a test needs to be provided in order to produce and validate the warning condition, if possible.

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Resolved: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Michael Dick resolved OPENJPA-932.
----------------------------------

    Resolution: Fixed

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0-M2
>            Reporter: Rick Curtis
>            Assignee: Michael Dick
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-932.patch, OPENJPA-932.patch, OPENJPA932.test.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Rick Curtis updated OPENJPA-932:
--------------------------------

    Attachment: OPENJPA-932.patch

The bug is that we parse all URLs matching the provided resource name, but only return the PU names from the last URL that was parsed. We should be saving the results after each time we parse a URL and returning ALL results.

In addition to the bug fix I added some error detection. If there are persistence unit name collisions for the provided resource name, a WARNING message will be logged.  See below for a snippet from a test run.

...
     [java] 297  WARN   [main] openjpa.Persistence - The persistence unit "jpa.connection-pool" was found in the following resources "[file:/C:/jpa/workspace-samples/projects/j
pa.connection.pool/bin/META-INF/persistence.xml, jar:file:/C:/jpa/workspace-samples/projects/lib/test-bad.jar!/META-INF/persistence.xml]". Please correct the problem as it may
have unexpected results.
...

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Rick Curtis updated OPENJPA-932:
--------------------------------

    Attachment: OPENJPA932.test.patch

The attached file removes changes I introduced in the pom.xml to test this patch. All of the *magic* is now contained within the test.

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932.patch, OPENJPA-932.patch, OPENJPA932.test.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Rick Curtis updated OPENJPA-932:
--------------------------------

    Attachment: OPENJPA-932.patch

Updated the patch to get a logger in a different manner. This patch is for trunk.

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932.patch, OPENJPA-932.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Michael Dick updated OPENJPA-932:
---------------------------------

    Fix Version/s: 2.0.0
                   1.3.0
         Assignee: Michael Dick

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0-M2
>            Reporter: Rick Curtis
>            Assignee: Michael Dick
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-932.patch, OPENJPA-932.patch, OPENJPA932.test.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Rick Curtis updated OPENJPA-932:
--------------------------------

    Attachment:     (was: OPENJPA-932-unitTest.patch)

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Rick Curtis updated OPENJPA-932:
--------------------------------

    Attachment:     (was: OPENJPA-932-unitTest.patch)

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932-2.0.patch, OPENJPA-932-2.0.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Rick Curtis updated OPENJPA-932:
--------------------------------

    Attachment: OPENJPA-932-unitTest-resources.jar
                OPENJPA-932-unitTest.patch

For the unit test I needed to have multiple META-INF/persistence.xml files on my classpath and the test validates that all PUs are found that exist in those xml files. I wasn't quite sure what the 'proper' way was to do this, but what I posted works... Please correct me if there is a better way.

Note: The attached jar file needs to be expanded into openjpa-parent\openjpa-persistence\src\test.

-Rick

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932-2.0.patch, OPENJPA-932-2.0.patch, OPENJPA-932-unitTest-resources.jar, OPENJPA-932-unitTest.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Rick Curtis updated OPENJPA-932:
--------------------------------

    Attachment:     (was: OPENJPA-932-2.0.patch)

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Rick Curtis updated OPENJPA-932:
--------------------------------

    Attachment: OPENJPA-932-2.0.patch

Changed the way I obtained a logger once again. 

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932-2.0.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Updated: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

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

Rick Curtis updated OPENJPA-932:
--------------------------------

    Attachment: OPENJPA-932-2.0.patch

The new patch has the following updates:
* Removed the Persistence trace group.
* The previous PU name collision detection and logging was removed as it would only detect collisions when using the PCEnhancerAgent.
* PU name collisions are now detected and saved away, but not logged until an EMF is created for that PU.  The capability to make a PU name collision a fatal error exists, but I decided that course action is a bit extreme. I think new message is verbose enough that a user should be able to figure out what's going on if they're having problems.

One question - Do I need a separate Jira for the PU name collision detection/logging since it is pretty much separate from the bug that this Jira was opened for?

-Rick

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932-2.0.patch, OPENJPA-932-2.0.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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


[jira] Commented: (OPENJPA-932) Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.

Posted by "Michael Dick (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679652#action_12679652 ] 

Michael Dick commented on OPENJPA-932:
--------------------------------------

Hi Rick,

The current patch will *always* log to StdErr. I think we'd be better off saving the fact that there was a name collision and logging it after we've parsed the configuration.

I'm also not sure we need a new logging level for this issue. Wouldn't one of the other levels, ie Runtime have sufficed? 

> Runtime enhancer doesn't work propery if there is a trailing persistence.xml file on the classpath.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-932
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-932
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0, 2.0.0-M1, 2.0.0
>            Reporter: Rick Curtis
>         Attachments: OPENJPA-932-2.0.patch
>
>
> I have an application where I am using runtime class enhancement via the javaagent and I set openjpa.RuntimeUnenhancedClasses=unsupported. My application works fine when running on 1.1.0 but when I moved to 1.2.0 (and 2.0.0) I started getting errors because my classes aren't being enhanced. 
> After debugging I determined that I had a jar on the end of my classpath that had a META-INF/persistence.xml file in it. The extra persistence.xml file has no PUs defined, and should have been ignored. When I removed that jar from my classpath things starting working again. It also works if I put my META-INF/persistence.xml file on the end of my classpath.

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