]
Van Halbert resolved TEIID-4808.
--------------------------------
Resolution: Done
Infinispan Cache Resource Adapter: NullPointerException
-------------------------------------------------------
Key: TEIID-4808
URL:
https://issues.jboss.org/browse/TEIID-4808
Project: Teiid
Issue Type: Bug
Components: JDG Connector
Affects Versions: 8.12.10.6_3
Reporter: Jan Stastny
Assignee: Van Halbert
Fix For: 9.3, 8.12.x-6.4
There is a NPE when trying to query a local cache via Infinispan Cache translator.
{code}
[31m10:27:43,186 ERROR [org.teiid.CONNECTOR] (Worker1_QueryProcessorQueue1) Connector
worker process failed for atomic-request=6chGAXrxul8Z.0.3.0:
java.lang.NullPointerException
at
org.teiid.resource.adapter.infinispan.InfinispanCacheWrapper.getClassRegistry(InfinispanCacheWrapper.java:128)
at
org.teiid.resource.adapter.infinispan.InfinispanCacheRAConnection.getClassRegistry(InfinispanCacheRAConnection.java:137)
at org.teiid.translator.object.ObjectExecution.<init>(ObjectExecution.java:195)
[translator-object-8.12.10.6_3-redhat-1.jar:8.12.10.6_3-redhat-1]
at
org.teiid.translator.infinispan.cache.InfinispanCacheExecutionFactory$1.<init>(InfinispanCacheExecutionFactory.java:93)
[translator-infinispan-cache-8.12.10.6_3-redhat-1.jar:8.12.10.6_3-redhat-1]
at
org.teiid.translator.infinispan.cache.InfinispanCacheExecutionFactory.createResultSetExecution(InfinispanCacheExecutionFactory.java:93)
[translator-infinispan-cache-8.12.10.6_3-redhat-1.jar:8.12.10.6_3-redhat-1]
at
org.teiid.translator.infinispan.cache.InfinispanCacheExecutionFactory.createResultSetExecution(InfinispanCacheExecutionFactory.java:51)
[translator-infinispan-cache-8.12.10.6_3-redhat-1.jar:8.12.10.6_3-redhat-1]
at org.teiid.translator.ExecutionFactory.createExecution(ExecutionFactory.java:316)
[teiid-api-8.12.10.6_3-redhat-1.jar:8.12.10.6_3-redhat-1]
at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:354)
[teiid-engine-8.12.10.6_3-redhat-1.jar:8.12.10.6_3-redhat-1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_111]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[rt.jar:1.8.0_111]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.8.0_111]
at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_111]
at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
[teiid-engine-8.12.10.6_3-redhat-1.jar:8.12.10.6_3-redhat-1]
at com.sun.proxy.$Proxy103.execute(Unknown Source)
at
org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306)
[teiid-engine-8.12.10.6_3-redhat-1.jar:8.12.10.6_3-redhat-1]
at
org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
[teiid-engine-8.12.10.6_3-redhat-1.jar:8.12.10.6_3-redhat-1]
at
org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
[teiid-engine-8.12.10.6_3-redhat-1.jar:8.12.10.6_3-redhat-1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_111]
at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
[teiid-engine-8.12.10.6_3-redhat-1.jar:8.12.10.6_3-redhat-1]
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:280)
[teiid-engine-8.12.10.6_3-redhat-1.jar:8.12.10.6_3-redhat-1]
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
[teiid-engine-8.12.10.6_3-redhat-1.jar:8.12.10.6_3-redhat-1]
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
[teiid-engine-8.12.10.6_3-redhat-1.jar:8.12.10.6_3-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[rt.jar:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[rt.jar:1.8.0_111]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_111]
{code}
POJO's module.xml:
{code:xml}
<module xmlns="urn:jboss:module:1.1"
name="org.jboss.qe.jdg.pojos">
<resources>
<resource-root path="jdg-pojos-1.2.jar"/>
<!-- Insert resources here -->
</resources>
<dependencies>
<!-- local -->
<module name="org.jboss.teiid.resource-adapter.infinispan"
slot="6" />
<!--remote-->
<module name="org.infinispan.client.hotrod" slot="jdg-6.4"
optional="true" export="true" />
<module name="org.infinispan.protostream" slot="jdg-6.4"
optional="true" export="true" />
<module name="org.infinispan.client.hotrod" slot="jdg-6.5"
optional="true" export="true" />
<module name="org.infinispan.protostream" slot="jdg-6.5"
optional="true" export="true" />
<module name="org.infinispan.client.hotrod" slot="jdg-6.6"
optional="true" export="true" />
<module name="org.infinispan.protostream" slot="jdg-6.6"
optional="true" export="true" />
</dependencies>
</module>
{code}
Resource-adapter configuration:
{code:xml}
<resource-adapter id="jdg-ra-ds">
<module slot="6"
id="org.jboss.teiid.resource-adapter.infinispan"/>
<transaction-support>LocalTransaction</transaction-support>
<connection-definitions>
<connection-definition
class-name="org.teiid.resource.adapter.infinispan.InfinispanManagedConnectionFactory"
jndi-name="java:/infinispanTest" enabled="true"
use-java-context="true" pool-name="jdg-ra-ds">
<config-property name="CacheJndiName">
java:jboss/infinispan/container/teiid-infinispan-quickstart
</config-property>
<config-property name="Module">
org.jboss.qe.jdg.pojos
</config-property>
<config-property name="CacheTypeMap">
local-quickstart-cache:org.jboss.qe.jdg.pojo.SmallA;intKey
</config-property>
</connection-definition>
</connection-definitions>
</resource-adapter>
{code}
Translator:
{code:xml}
<translator name="infinispan-cache"
module="org.jboss.teiid.translator.infinispan.cache"/>
{code}