Bug 996417 - NPE when querying BPMActivityType
Summary: NPE when querying BPMActivityType
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: RT Governance
Version: 6.0.0 GA
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER4
: 6.0.0
Assignee: Gary Brown
QA Contact: Jiri Pechanec
URL:
Whiteboard:
Depends On: 996030
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-13 06:57 UTC by Jiri Pechanec
Modified: 2014-07-02 09:19 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RTGOV-278 0 Major Closed Activty server query on context causes npe 2014-07-02 09:19:38 UTC

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


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