Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325798 - NullPointerException when enabling weaving in J2SE application
Summary: NullPointerException when enabling weaving in J2SE application
Status: CLOSED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-20 16:42 EDT by Nicolas PENINGUY CLA
Modified: 2022-06-09 10:10 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas PENINGUY CLA 2010-09-20 16:42:28 EDT
Build Identifier: 2.1.1.v20100817-r8050

I get this stacktrace when running a J2SE application when enabling weaving with the eclipselink agent :

[EL Info]: 2010-09-20 22:07:57.751--ServerSession(993921722)--EclipseLink, version: Eclipse Persistence Services - 2.1.1.v20100817-r8050[EL Warning]: 2010-09-20 

22:08:00.214--UnitOfWork(127616840)--java.lang.NullPointerException

Exception in thread "main" java.lang.NullPointerException
        at org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor.getAttributeValueFromObject(MethodAttributeAccessor.java:84)
        at org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor.getAttributeValueFromObject(MethodAttributeAccessor.java:53)
        at org.eclipse.persistence.mappings.DatabaseMapping.getAttributeValueFromObject(DatabaseMapping.java:497)
        at org.eclipse.persistence.mappings.ForeignReferenceMapping.getAttributeValueFromObject(ForeignReferenceMapping.java:792)
        at org.eclipse.persistence.mappings.OneToOneMapping.writeFromObjectIntoRow(OneToOneMapping.java:1634)
        at org.eclipse.persistence.mappings.ObjectReferenceMapping.extractPrimaryKeyRowForSourceObject(ObjectReferenceMapping.java:885)
        at org.eclipse.persistence.mappings.ObjectReferenceMapping.createUnitOfWorkValueHolder(ObjectReferenceMapping.java:858)
        at org.eclipse.persistence.internal.indirection.BasicIndirectionPolicy.cloneAttribute(BasicIndirectionPolicy.java:125)
        at org.eclipse.persistence.mappings.ForeignReferenceMapping.buildCloneFromRow(ForeignReferenceMapping.java:205)
        at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildAttributesIntoWorkingCopyClone(ObjectBuilder.java:1338)
        at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneFromRow(ObjectBuilder.java:1466)
        at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork(ObjectBuilder.java:558)
        at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:502)
        at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:454)
        at org.eclipse.persistence.queries.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:721)
        at org.eclipse.persistence.queries.ReadAllQuery.registerResultInUnitOfWork(ReadAllQuery.java:723)
        at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:420)
        at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1074)
        at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:736)
        at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1034)
        at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:380)
        at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1112)
        at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2909)
        at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1291)
        at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1273)
        at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1247)
        at org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:479)

It seems that a join fetch is responsible of this problem (no crash if I remove it) :

select r from recette_objet r
join fetch r.objet
where r.lot=:lot and r.objet.fichier=:nom


Reproducible: Always
Comment 1 Tom Ware CLA 2010-09-21 09:27:55 EDT
Please post the details of how your objects are mapped, especially recette_objet and r.objet.
Comment 2 Tom Ware CLA 2010-09-23 13:14:24 EDT
Closing as INVALID.  Without the requested information it will be impossible to tell what is going wrong.  We regularly run a large number of tests in JSE with weaving without that kind of failure.

Please reopen when you provide the information.
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:10:33 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink