Hello,
I have an issue when trying to access a cached object from a coherence cache that is defined by a shared GAR.
Here is my setup:
I am on WebLogic 12.1.3.0.0 + Coherence EE 12.1.3.0.0
I have a GAR deployed as a shared library this contains a myapp-pof-config.xml which imports 2 other pof-config.xml files: svc-pof-config.xml and rep-pof-config.xml
I have an application EAR which includes the session bean that writes to the cache in a war and the 2 jar files that contain the POF config files and associated classes.
I have a test EAR which contains a session bean that reads from the cache in a war and the and the 2 jar files that contain the POF config files and associated classes.
I followed these instructions when creating this setup:
http://docs.oracle.com/middleware/1213/wls/WLCOH/deploy-wls-coherence.htm#WLCOH769
Here is the POF config file in the GAR:
<pof-config>
<user-type-list>
<include>coherence-pof-config.xml</include>
<include>svc-pof-config.xml</include>
<include>rep-pof-config.xml</include>
</user-type-list>
<enable-references>true</enable-references>
<allow-interfaces>true</allow-interfaces>
<allow-subclasses>true</allow-subclasses>
<default-serializer>
<class-name>com.tangosol.io.pof.PofAnnotationSerializer</class-name>
</default-serializer>
</pof-config>
Here is an extract from the rep-pof-config.xml which defines the object stated in the unknown user type exception:
<pof-config>
<user-type-list>
<include>coherence-pof-config.xml</include>
<user-type>
<type-id>11000</type-id>
<class-name>app.common.replicateddata.CompiledDataKey</class-name>
</user-type>
<user-type>
<type-id>11001</type-id>
<class-name>app.common.replicateddata.CompiledData</class-name>
</user-type>
</user-type-list>
<allow-interfaces>true</allow-interfaces>
<allow-subclasses>true</allow-subclasses>
<enable-references>true</enable-references>
</pof-config>
Here is the class signature for the unknown user type:
package app.common.replicateddata;
@Portable
public final class CompiledData implements Comparable<CompiledData>, Serializable {
}
I can safely write and read back from the cache using the session bean in the application EAR but I cannot read back from the cache in the test EAR.
I get the following error when trying to read the cached object: unknown user type: app.common.replicateddata.CompiledData
Here are the relevant extracts from the log files:
The server log shows that the pof config files are being read:
####<Feb 9, 2015 10:36:51 AM UTC> <Info> <com.oracle.coherence> <ipw84254> <engine1> <Logger@9233091 12.1.3.0.0> <<WLS Kernel>> <> <> <1423478211623> <BEA-000000> <2015-02-09 10:36:51.623/132.711 Oracle Coherence EE 12.1.3.0.0 <Info> (thread=[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)', member=1): Loaded POF configuration from "zip:/middleware/myapp/myapp-root/myapp/myapp_1/user_projects/domains/myapp_testing_domain/servers/engine1/stage/app.common.gar/7.0.0.0@7.0.0.0-SNAPSHOT.r146395/app.common.gar.gar!/META-INF/myapp-pof-config.xml"; this document does not refer to any schema definition and has not been validated.>
####<Feb 9, 2015 10:36:51 AM UTC> <Info> <com.oracle.coherence> <ipw84254> <engine1> <Logger@9233091 12.1.3.0.0> <<WLS Kernel>> <> <> <1423478211637> <BEA-000000> <2015-02-09 10:36:51.637/132.725 Oracle Coherence EE 12.1.3.0.0 <Info> (thread=[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)', member=1): Loaded included POF configuration from "jar:file:/middleware/myapp/myapp-root/myapp/myapp_1/coherence/lib/coherence.jar!/coherence-pof-config.xml">
####<Feb 9, 2015 10:36:51 AM UTC> <Info> <com.oracle.coherence> <ipw84254> <engine1> <Logger@9233091 12.1.3.0.0> <<WLS Kernel>> <> <> <1423478211645> <BEA-000000> <2015-02-09 10:36:51.645/132.733 Oracle Coherence EE 12.1.3.0.0 <Info> (thread=[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)', member=1): Loaded included POF configuration from "zip:/middleware/myapp/myapp-root/myapp/myapp_1/user_projects/domains/myapp_testing_domain/servers/engine1/tmp/_WL_user/test.app.coherence/37vcfa/APP-INF/lib/app.common.servicedata-7.0.0.0-SNAPSHOT.jar!/svc-pof-config.xml">
####<Feb 9, 2015 10:36:51 AM UTC> <Info> <com.oracle.coherence> <ipw84254> <engine1> <Logger@9233091 12.1.3.0.0> <<WLS Kernel>> <> <> <1423478211645> <BEA-000000> <2015-02-09 10:36:51.645/132.733 Oracle Coherence EE 12.1.3.0.0 <Info> (thread=[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)', member=1): Loaded included POF configuration from "zip:/middleware/myapp/myapp-root/myapp/myapp_1/user_projects/domains/myapp_testing_domain/servers/engine1/tmp/_WL_user/test.app.coherence/37vcfa/APP-INF/lib/common.replicateddata-7.0.0.0-SNAPSHOT.jar!/rep-pof-config.xml"; this document does not refer to any schema definition and has not been validated.>
####<Feb 9, 2015 10:36:51 AM UTC> <Info> <EJB> <ipw84254> <engine1> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0037AF08715A082CF9AF> <> <1423478211694> <BEA-010227> <EJB exception occurred during invocation from home or business: test.app.coherence.CoherenceCacheResource_gllgmw_Intf generated exception: (Wrapped: CacheName=ControlFlowCache, Key=CompiledDataKey{type=CONTROL_FLOW, id=13, compiledDataVersion=1}) java.io.IOException: unknown user type: app.common.replicateddata.CompiledData>
##
Here is the exception I am receiving in the test EAR session bean:
(Wrapped: CacheName=ControlFlowCache, Key=CompiledDataKey{type=CONTROL_FLOW, id=13, compiledDataVersion=1}) java.io.IOException: unknown user type: app.common.replicateddata.CompiledData
at com.tangosol.coherence.component.util.CacheHandler.releaseClassLoader(CacheHandler.CDB:23)
at com.tangosol.coherence.component.util.CacheHandler.getCachedResource(CacheHandler.CDB:39)
at com.tangosol.coherence.component.util.CacheHandler.convert(CacheHandler.CDB:1)
at com.tangosol.coherence.component.util.CacheHandler$EntrySet$Entry.getValue(CacheHandler.CDB:2)
at test.app.coherence.CoherenceCacheResource.listCache(CoherenceCacheResource.java:102)
Caused by: java.io.IOException: unknown user type: app.common.replicateddata.CompiledData
at com.tangosol.io.pof.ConfigurablePofContext.serialize(ConfigurablePofContext.java:358)
at com.tangosol.util.ExternalizableHelper.serializeInternal(ExternalizableHelper.java:2695)
at com.tangosol.util.ExternalizableHelper.toBinary(ExternalizableHelper.java:216)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.ReplicatedCache$ConverterToInternal.convert(ReplicatedCache.CDB:6)
at com.tangosol.coherence.component.util.CacheHandler.releaseClassLoader(CacheHandler.CDB:15)
... 69 more
Caused by: java.lang.IllegalArgumentException: unknown user type: app.common.replicateddata.CompiledData
at com.tangosol.io.pof.ConfigurablePofContext.getUserTypeIdentifier(ConfigurablePofContext.java:438)
at com.tangosol.io.pof.ConfigurablePofContext.getUserTypeIdentifier(ConfigurablePofContext.java:427)
at com.tangosol.io.pof.PofBufferWriter.writeUserType(PofBufferWriter.java:1677)
at com.tangosol.io.pof.PofBufferWriter.writeObject(PofBufferWriter.java:1624)
at com.tangosol.io.pof.ConfigurablePofContext.serialize(ConfigurablePofContext.java:352)
... 73 more