DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Kiran Kumar
Votes: 0
Watchers: 0

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

Classloding in Jboss7

Created: 09/Aug/11 01:25 PM   Updated: 19/May/12 04:22 PM   Resolved: 14/Aug/11 01:25 PM
Component/s: None
Affects Version/s: 3.0.0.release
Fix Version/s: 3.0.1

File Attachments: 1. XML File jdopersistence.xml (1 kB)
2. Java Source File (10 kB)
3. XML File ra.xml (2 kB)
4. XML File resource-adapter-subsystem.xml (0.8 kB)

Environment: Jboss7, Jboss AS7

Forum Thread URL:,6798
Severity: Development

 Description  « Hide
When deploying datanucleus in jboss AS7 the JDOClassLoaderResolver properly loads the primitive datatypes but fails to load other datatypes resulting in a

Class "java.lang.Boolean" was not found in the CLASSPATH [Class resolver called from (line=607)

When jboss deploys the datanucleus adapter it does not provide Thread.currentThread().getContextClassLoader() is null.

The classloader used at the time of deployment needs to be same as the one subsequently used.

Sort Order: Ascending order - Click to sort in descending order
Kiran Kumar added a comment - 09/Aug/11 01:27 PM
To solve this issue we need to add a property to ManagedConnectionFactoryImpl which can be used to set the datanucleus.primaryClassLoader.

public synchronized void setPrimaryClassLoader(String name)
        ClassLoader thisClazzLoader = this.getClass().getClassLoader();
        ClassLoader primaryClassLoader = null;

            primaryClassLoader = thisClazzLoader.loadClass(name).getClassLoader();
        catch (Exception e)
            // ignore this error
            if (PersistenceManagerImpl.LOGGER.isInfoEnabled())
      "Exception while creating PrimaryClassLoader: ", e);

        properties.put("datanucleus.primaryClassLoader", primaryClassLoader);

Kiran Kumar added a comment - 09/Aug/11 01:32 PM - edited has a new method setPrimaryClassLoader() . The usage is defined in the ra.xml.

Sample configuration used in jboss standalone.xml is in resource-adapter-subsystem.xml

Sample persistence configuration is in jdopersistence.xml

Andy Jefferson added a comment - 14/Aug/11 01:25 PM
SVN trunk has this method now. thx