Attempting to get unset feature: InternalExpression
Hello,
I'm getting following exception when I call hasNext() on results I got from IQueryClient.getQueryResult()/getResolvedQueryResults().
Exception in thread "main" java.lang.IllegalStateException: Attempting to get unset feature: InternalExpression
at com.ibm.team.workitem.common.internal.query.impl.QueryDescriptorImpl.getInternalExpression(QueryDescriptorImpl.java:488)
at com.ibm.team.workitem.common.internal.query.impl.QueryDescriptorCustomImpl.getExpression(QueryDescriptorCustomImpl.java:41)
at com.ibm.team.workitem.common.internal.query.impl.QueryDescriptorCustomImpl.getResolvedExpression(QueryDescriptorCustomImpl.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.ibm.team.repository.common.internal.util.ItemStore$ItemInvocationHandler.invoke(ItemStore.java:597)
at com.sun.proxy.$Proxy19.getResolvedExpression(Unknown Source)
at com.ibm.team.workitem.common.internal.query.QueryResultIterator.fetchFirstPage(QueryResultIterator.java:147)
at com.ibm.team.workitem.common.internal.query.QueryResultIterator.update(QueryResultIterator.java:129)
at com.ibm.team.workitem.common.internal.query.QueryResultIterator.hasNext(QueryResultIterator.java:94)
Do I need to set the 'InternalExpression' feature to run the query successfully?
If so, how do I set the 'InternalExpression' feature?
Thank you.
One answer
I was able to resolve the error by using IQueryDescriptor.FULL_PROFILE.
I initially tried following profile but received another error below.
IQueryDescriptor.SMALL_PROFILE.createExtension(Collections.singletonList(IQueryDescriptor.EXPRESSION_PROPERTY))
Exception in thread "main" java.lang.IllegalStateException: Attempting to get unset feature: SerializationVersion
at com.ibm.team.workitem.common.internal.query.impl.QueryDescriptorImpl.getSerializationVersion(QueryDescriptorImpl.java:537)
at com.ibm.team.workitem.common.internal.query.impl.QueryDescriptorCustomImpl.getExpression(QueryDescriptorCustomImpl.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.ibm.team.repository.common.internal.util.ItemStore$ItemInvocationHandler.invoke(ItemStore.java:597)
createExtension() failed when I added 'SerializationVersion' as below.
IQueryDescriptor.SMALL_PROFILE.createExtension(Arrays.asList(IQueryDescriptor.EXPRESSION_PROPERTY, "SerializationVersion"))
I tried to optimize the profile but ended up using IQueryDescriptor.FULL_PROFILE to successfully run the query.