Bug 996417 - NPE when querying BPMActivityType
NPE when querying BPMActivityType
Status: CLOSED CURRENTRELEASE
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: RT Governance (Show other bugs)
6.0.0 GA
Unspecified Unspecified
unspecified Severity high
: ER4
: 6.0.0
Assigned To: Gary Brown
Jiri Pechanec
:
Depends On: 996030
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-13 02:57 EDT by Jiri Pechanec
Modified: 2014-07-02 05:19 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker RTGOV-278 Major Closed Activty server query on context causes npe 2014-07-02 05:19:38 EDT

  None (edit)
Description Jiri Pechanec 2013-08-13 02:57:27 EDT
Execute bpm-service quickstart

Run a query 
{"expression": "SELECT act FROM ActivityType act LEFT JOIN FETCH act.context LEFT JOIN FETCH act.properties" }

on http://localhost:8080/overlord-rtgov/activity/query

An exception is thrown
java.lang.NullPointerException
	at org.hibernate.engine.internal.StatefulPersistenceContext.getLoadedCollectionOwnerOrNull(StatefulPersistenceContext.java:859) [hibernate-core-4.2.0.Final-redhat-1.jar:4.2.0.Final-redhat-1]
	at org.hibernate.event.spi.AbstractCollectionEvent.getLoadedOwnerOrNull(AbstractCollectionEvent.java:75) [hibernate-core-4.2.0.Final-redhat-1.jar:4.2.0.Final-redhat-1]
	at org.hibernate.event.spi.InitializeCollectionEvent.<init>(InitializeCollectionEvent.java:36) [hibernate-core-4.2.0.Final-redhat-1.jar:4.2.0.Final-redhat-1]
	at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1846) [hibernate-core-4.2.0.Final-redhat-1.jar:4.2.0.Final-redhat-1]
	at org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:549) [hibernate-core-4.2.0.Final-redhat-1.jar:4.2.0.Final-redhat-1]
	at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:234) [hibernate-core-4.2.0.Final-redhat-1.jar:4.2.0.Final-redhat-1]
	at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:545) [hibernate-core-4.2.0.Final-redhat-1.jar:4.2.0.Final-redhat-1]
	at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:124) [hibernate-core-4.2.0.Final-redhat-1.jar:4.2.0.Final-redhat-1]
	at org.hibernate.collection.internal.PersistentBag.iterator(PersistentBag.java:266) [hibernate-core-4.2.0.Final-redhat-1.jar:4.2.0.Final-redhat-1]
	at org.overlord.rtgov.activity.model.bpm.BPMActivityType.updateEndpointContext(BPMActivityType.java:105) [activity-1.0.0.Final-redhat-1.jar:1.0.0.Final-redhat-1]
	at org.overlord.rtgov.activity.model.bpm.BPMActivityType.setInstanceId(BPMActivityType.java:85) [activity-1.0.0.Final-redhat-1.jar:1.0.0.Final-redhat-1]
	... 58 more

If only BPMActivityType collection is queried the reuslt is the same.

If the query is modified to
{"expression": "SELECT act FROM BPMActivityType act LEFT JOIN FETCH act.properties" } 

then it passes
Comment 1 Gary Brown 2013-08-13 05:05:28 EDT
This appears to be fixed by https://bugzilla.redhat.com/show_bug.cgi?id=996030, which should be available in the next build.
Comment 2 Jiri Pechanec 2013-09-17 08:16:00 EDT
The query now returns status 500, with text org.hibernate.PropertyAccessException: Exception occurred inside setter of org.overlord.rtgov.activity.model.bpm.BPMActivityType.instanceId

The same issue is present when the query is simplified to
{"expression": "SELECT act FROM ActivityType act  LEFT JOIN FETCH act.context", "format":"jpql" }

The issue is not present neither for
{"expression": "SELECT act FROM ActivityType act LEFT JOIN FETCH act.properties", "format":"jpql" }

nor for

{"expression": "SELECT act FROM ActivityType act", "format":"jpql" }
Comment 6 Jiri Pechanec 2013-10-10 05:14:58 EDT
Verified in ER4
Comment 7 JBoss JIRA Server 2014-07-02 05:19:38 EDT
Gary Brown <gary@brownuk.com> updated the status of jira RTGOV-278 to Closed

Note You need to log in before you can comment on or make changes to this bug.