Issue Details (XML | Word | Printable)

Key: NUCCORE-863
Type: Bug Bug
Status: Closed Closed
Resolution: Incomplete
Priority: No Testcase No Testcase
Assignee: Unassigned
Reporter: Branden Visser
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Core

JNDI lookups should be done with "primary class loader" as context

Created: 26/Jun/12 03:30 AM   Updated: 24/Jul/12 03:50 PM   Resolved: 13/Jul/12 10:54 AM
Component/s: Transactions
Affects Version/s: 3.0.11, 3.1.0.m4
Fix Version/s: None

Environment: Felix OSGi container


 Description  « Hide
JNDI hard-codes use of the thread's context classloader when looking up the InitialContext factory. This is problematic for OSGi where the thread's context class loader is, well, usually not the one you want doing dynamic class lookups.

We can make this better by swapping in the configured "primary class loader" (if exists) as the context class loader for the lookup, then swapping it back afterward.

Only org.datanucleus.JTATransactionImpl is impacted by this:

~/Source/datanucleus$ find . -name "*.java" -exec grep -l ".lookup(\"" {} \;
./platform/core/branches/1.0/src/java/org/datanucleus/JTATransactionImpl.java
./platform/core/branches/1.1/src/java/org/datanucleus/JTATransactionImpl.java
./platform/core/branches/2.0/src/java/org/datanucleus/JTATransactionImpl.java
./platform/core/branches/2.1/src/java/org/datanucleus/JTATransactionImpl.java
./platform/core/branches/2.2/src/java/org/datanucleus/JTATransactionImpl.java
./platform/core/branches/3.0/src/java/org/datanucleus/JTATransactionImpl.java
./platform/core/trunk/src/java/org/datanucleus/JTATransactionImpl.java
./test/accessplatform/branches/1.0/test.jdo.jta/src/java/org/datanucleus/tests/jta/GeneralTest.java
./test/accessplatform/branches/1.0/testrunner.j2ee/src/java/org/datanucleus/tests/jdo/jta/jboss/AnIntegrationTest.java
./test/accessplatform/branches/1.1/test.jdo.jta/src/java/org/datanucleus/tests/jta/GeneralTest.java
./test/accessplatform/branches/1.1/testrunner.j2ee/src/java/org/datanucleus/tests/jdo/jta/jboss/AnIntegrationTest.java
./test/accessplatform/branches/2.0/test.jdo.jta/src/java/org/datanucleus/tests/jta/GeneralTest.java
./test/accessplatform/branches/2.0/testrunner.j2ee/src/java/org/datanucleus/tests/jdo/jta/jboss/AnIntegrationTest.java
./test/accessplatform/branches/2.2/test.jdo.jta/src/java/org/datanucleus/tests/jta/GeneralTest.java
./test/accessplatform/branches/2.2/testrunner.j2ee/src/java/org/datanucleus/tests/jdo/jta/jboss/AnIntegrationTest.java
./test/accessplatform/branches/3.0/test.jdo.jta/src/java/org/datanucleus/tests/jta/GeneralTest.java
./test/accessplatform/branches/3.0/testrunner.j2ee/src/java/org/datanucleus/tests/jdo/jta/jboss/AnIntegrationTest.java
./test/accessplatform/trunk/test.jdo.jta/src/java/org/datanucleus/tests/jta/GeneralTest.java
./test/accessplatform/trunk/testrunner.j2ee/src/java/org/datanucleus/tests/jdo/jta/jboss/AnIntegrationTest.java
~/Source/datanucleus$

Will attach a patch for this tomorrow morning.



Branden Visser added a comment - 26/Jun/12 03:42 AM
(tomorrow morning is about 10 hours from now)

Andy Jefferson made changes - 02/Jul/12 01:05 PM
Field Original Value New Value
Priority Major [ 3 ] Incomplete [ 6 ]
Andy Jefferson added a comment - 13/Jul/12 10:54 AM
As much as there may be some problem there, you provide no way to see it nor any patch so closing.

Andy Jefferson made changes - 13/Jul/12 10:54 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Incomplete [ 4 ]
Andy Jefferson made changes - 24/Jul/12 03:50 PM
Status Resolved [ 5 ] Closed [ 6 ]