users@glassfish.java.net

Re: Datanucleus: java.lang.UnsupportedOperationException at java.util.Collecti

From: Mitesh Meswani <mitesh.meswani_at_oracle.com>
Date: Tue, 07 Sep 2010 17:35:26 -0700

  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.

-Mitesh
On 9/7/2010 4:08 AM, glassfish_at_javadesktop.org wrote:
> Hi,
>
> I have been trying to run datanucleus on top of glassfish 2.1 as a JPA persistence provider.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
> <persistence-unit name="keyservice" transaction-type="JTA">
> <provider>org.jpox.jpa.PersistenceProviderImpl</provider>
> <jta-data-source>jdbc/prototype</jta-data-source>
> <class>com.ericsson.edible.fasttrack.object.LargeKeyedObject</class>
> <class>com.ericsson.edible.fasttrack.object.SmallKeyedObject</class>
> </persistence-unit>
> </persistence>
>
> 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.
> java.lang.UnsupportedOperationException
> at java.util.Collections$UnmodifiableMap.put(Collections.java:1285)
> at org.jpox.jpa.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:168)
> at org.jpox.jpa.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.jav
> a:57)
> at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:149)
> at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:84)
> at com.sun.enterprise.server.AbstractLoader.loadPersistenceUnits(AbstractLoader.java:915)
> at com.sun.enterprise.server.ApplicationLoader.doLoad(ApplicationLoader.java:184)
> at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:126)
> at com.sun.enterprise.server.ExtendedApplicationLoader.doLoad(ExtendedApplicationLoader.java:134)
> at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:240)
> at com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:226)
> at com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:224)
> at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:449)
> at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:134)
> at com.sun.enterprise.server.PEMain.run(PEMain.java:409)
> at com.sun.enterprise.server.PEMain.main(PEMain.java:336)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at com.sun.enterprise.server.PELaunch.main(PELaunch.java:415)
> |#]
>
> 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());
> }
> }
> [Message sent by forum member 'baboune']
>
> http://forums.java.net/jive/thread.jspa?messageID=482023
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>