Issue Details (XML | Word | Printable)

Key: NUCJPA-77
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Erik Bengtson
Reporter: nicolas
Votes: 0
Watchers: 0

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

UnsupportedOperationException at java.util.Collections$UnmodifiableMap.put(

Created: 10/Sep/10 04:45 PM   Updated: 20/Oct/10 09:30 AM   Resolved: 12/Sep/10 09:10 AM
Component/s: None
Affects Version/s: 2.1.0.release, 2.1.1
Fix Version/s: 2.1.2

Environment: Windows/Linux Suse on top of Glassfish 2.1 or 3.1.

Forum Thread URL:,6283_offset,0
Datastore: MySQL
Severity: Development

 Description  « Hide
I have been trying to run datanucleus on top of glassfish 2.1 as a JPA persistence provider. It seems I am running into a map problem when datanucleus is handling the properties.

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns=""
<persistence-unit name="keyservice" transaction-type="JTA">

In the glassfish/domains/domain/lib, I added the following jars: jpox-core-1.2.0-beta-5.jar, jpox-enhancer-1.2.0-beta-5.jar, jpox-java5-1.2.0-beta-5.jar, jpox-rdbms-1.2.0-beta-5.jar and jpox-spatial-1.2.0-beta-5.jar.

When I deployed my ear, I get this exception:

[#|2010-09-03T16:50:40.827+0200|WARNING|sun-glassfish-comms-server2.0|javax.enterprise.system.core.classloading|_ThreadID=10;_ThreadName=main;_RequestID=d8be0761-49ee-429c-beda-d11c8d5b7419;|The log message is null.
at java.util.Collections$UnmodifiableMap.put(
at org.jpox.jpa.EntityManagerFactoryImpl.<init>(
at org.jpox.jpa.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.jav
at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(
at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(
at com.sun.enterprise.server.AbstractLoader.loadPersistenceUnits(
at com.sun.enterprise.server.ApplicationLoader.doLoad(
at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(
at com.sun.enterprise.server.ExtendedApplicationLoader.doLoad(
at com.sun.enterprise.server.AbstractLoader.load(
at com.sun.enterprise.server.AbstractManager.load(
at com.sun.enterprise.server.ApplicationLifecycle.onStartup(
at com.sun.enterprise.server.ApplicationServer.onStartup(
at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(
at com.sun.enterprise.server.PEMain.main(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at com.sun.enterprise.server.PELaunch.main(

I also tried with the latest datanucleus release (2.1.1):
commons-collections-3.1.jar, commons-pool-1.2.jar, datanucleus-core-2.1.1.jar, datanucleus-enhancer-2.1.0-release.jar, datanucleus-googlecollections-2.1.0-release.jar, datanucleus-jpa-2.1.0-release.jar, datanucleus-management-1.0.2.jar, datanucleus-rdbms-2.1.1.jar, geronimo-jpa_2.0_spec-1.0.jar, geronimo-jta_1.1_spec-1.1.jar, jdo-api-3.0.jar, slf4j-log4j12-1.5.6.jar

Got the same thing,

I moved on and tried on Galssfish 3.1, and for the same error.

What am I doing wrong? Does anyone have any ideas?

It fails when the Persistence is read and the properties are updated:

else if (type == PersistenceUnitTransactionType.JTA)
// Assumed to have jta datasource for connections
if (unitInfo.getJtaDataSource() != null)
overridingProps.put("datanucleus.ConnectionFactory", unitInfo.getJtaDataSource()); // line 214
if (unitInfo.getNonJtaDataSource() != null)
// Use non-jta for non-tx connections
overridingProps.put("datanucleus.ConnectionFactory2", unitInfo.getNonJtaDataSource());

Accordign to the Glassfish forums:

"The stack seems to suggest that Datanucleus is expecting map passed by container through createContainerEMF() is modifiable. This is obviously wrong. I would suggest you to file a bug against Datanucleus. "


Sort Order: Ascending order - Click to sort in descending order
nicolas added a comment - 10/Sep/10 05:28 PM
Same problem occurs with Jpox 1.2, Access Platform 2.1.1 Release and Access Platform 2.2.0 M1 Release

nicolas added a comment - 12/Sep/10 09:19 AM
Can I test/verify this?

Erik Bengtson added a comment - 12/Sep/10 10:12 AM
wait for nightly build, or buld the datanucleus-jpa yourself

nicolas added a comment - 12/Sep/10 12:18 PM
Seems to work.. Tested with latest from the trunk. I got passed this problem and onto a different one.

Good. Thanks.