| Summary: | weaving fails in server for application managed persistence units | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | James Sutherland <jamesssss> | ||||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | gordon.yorke, michael.f.obrien | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
James Sutherland
Fixed in two parts, first record that are in container and assume weaving can be done for any persistence units. Second, fix the zip: protocol urls to instead use file:. svn commit trunk/ 2.3.1 - Bug#353606 - Weaving fails in server for application managed https://bugs.eclipse.org/bugs/show_bug.cgi?id=353606 Fixes an issue that weaving is not enabled in the server if an application managed persistence unit is used. Issue was the persistence unit URL was different for container vs application. Changes: - Changed PersistenceUnitProcessor to process zip: protocol URLs and convert them to file:. - Added a flag to JavaSECMPInitializer to set if in the server and allow weaving with no agent. - test case in JPA EntityManager test suite to check session is that same for container vs application managed persistence units. forgot to get patch, so here is the change,
Index: C:/Engineering/EclipseLink/svn/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/deployment/PersistenceUnitProcessor.java
===================================================================
--- C:/Engineering/EclipseLink/svn/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/deployment/PersistenceUnitProcessor.java (revision 9268)
+++ C:/Engineering/EclipseLink/svn/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/deployment/PersistenceUnitProcessor.java (revision 9817)
@@ -159,6 +159,15 @@
JarURLConnection conn =
JarURLConnection.class.cast(pxmlURL.openConnection());
result = conn.getJarFileURL();
+ } else if("zip".equals(protocol)) { // NOI18N
+ // e.g. zip:/tmp/a_ear/b.jar!/META-INF/persistence.xml
+ // stolen from java.net.JarURLConnection.parseSpecs method
+ String spec = pxmlURL.getFile();
+ int separator = spec.lastIndexOf("!/");
+ if (separator == -1) {
+ separator = spec.length() - 1;
+ }
+ result = new URL("file", "", spec.substring(0, separator++));
// mkeith - add bundle protocol cases
} else if ("bundleentry".equals(protocol)) {
result = new URL("bundleentry://" + pxmlURL.getAuthority());
fixed Fix is causing issue with static deployment (jar in on servers classpath so can't be weaved) Created attachment 203678 [details]
fix to revert lazy one-to-ones if weaving did not occur
SVN 2.3.1,trunk commit: Bug#353606 - weaving fails in server https://bugs.eclipse.org/bugs/show_bug.cgi?id=353606 Fix to revert lazy in mapping's initialize if the class was not weaved. The previous fixed cause errors to occur for static libraries that do not allow weaving when deployed in the server. Code review: Gord Changes: - changed ForeignReferenceMapping to revert weaved indirection if the class was not weaved, and log a warning. - changed ObjectAccessor to never disable LAZY. The patch also includes the changes in revision : https://fisheye2.atlassian.com/changelog/eclipselink?cs=9867 Created attachment 203784 [details]
additional fix to patch to avoid changing mappings when weaving
fixed The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |