Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 996417

Summary: NPE when querying BPMActivityType
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: Jiri Pechanec <jpechane>
Component: RT GovernanceAssignee: Gary Brown <gbrown>
Status: CLOSED CURRENTRELEASE QA Contact: Jiri Pechanec <jpechane>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0 GACC: atangrin, soa-p-jira
Target Milestone: ER4   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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: --- Target Upstream Version:
Embargoed:
Bug Depends On: 996030    
Bug Blocks:    

Description Jiri Pechanec 2013-08-13 06:57:27 UTC
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 09:05:28 UTC
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 12:16:00 UTC
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 09:14:58 UTC
Verified in ER4

Comment 7 JBoss JIRA Server 2014-07-02 09:19:38 UTC
Gary Brown <gary> updated the status of jira RTGOV-278 to Closed