Hi there. I'm currently trying to put this example working, but unfortunately I'm not figuring out what's wrong with my configuration.
I've previously posted another issue, but I managed to solve that one out for myself. Unfortunately, that's not the case with this one...
Here are the files I'm using in the example:
File:
jpa-cache-config.xml, used to setup the cache configuration:
<?xml version="1.0" encoding="windows-1252"?>
<cache-config>
<caching-scheme-mapping>
<cache-mapping>
<!-- Set the name of the cache to be the entity name -->
<cache-name>Employees</cache-name>
<!-- Configure this cache to use the scheme defined below -->
<scheme-name>jpa-distributed</scheme-name>
</cache-mapping>
</caching-scheme-mapping>
<caching-schemes>
<distributed-scheme>
<scheme-name>jpa-distributed</scheme-name>
<service-name>JpaDistributedCache</service-name>
<backing-map-scheme>
<read-write-backing-map-scheme>
<!--
Define the cache scheme
-->
<internal-cache-scheme>
<local-scheme />
</internal-cache-scheme>
<cachestore-scheme>
<class-scheme>
<class-name>
com.tangosol.coherence.jpa.JpaCacheStore</class-name>
<init-params>
<!--
This param is the entity name
This param is the fully qualified entity class
This param should match the value of the
persistence unit name in persistence.xml
-->
<init-param>
<param-type>java.lang.String</param-type>
<param-value>{cache-name}</param-value>
</init-param>
<init-param>
<param-type>java.lang.String</param-type>
<param-value>
com.oracle.coherence.handson.{cache-name}</param-value>
</init-param>
<init-param>
<param-type>java.lang.String</param-type>
<param-value>JPA</param-value>
</init-param>
</init-params>
</class-scheme>
</cachestore-scheme>
</read-write-backing-map-scheme>
</backing-map-scheme>
<autostart>true</autostart>
</distributed-scheme>
</caching-schemes>
</cache-config>
File
jpa-cache-server.cmd, executed on command window on */coherence/lib* directory
@echo off
@
@rem This will start a cache server
@
setlocal
:config
@rem specify the Coherence installation directory
set coherence_home=C:\ficheiros\coherence\coherence
set weblogic_home=C:\weblogic10_3_2
set modules_home=C:\Oracle\Middleware\modules
set project_home=C:\JDeveloper\mywork\CoherenceExample
@rem specify the JVM heap size
set memory=512m
:start
if not exist "%coherence_home%\lib\coherence.jar" goto instructions
if "%java_home%"=="" (set java_exec=java) else (set java_exec=%java_home%\bin\java)
:launch
set java_opts="-Xms%memory% -Xmx%memory% -Dtangosol.coherence.cacheconfig=%project_home%\jpa-cache-config.xml"
"%java_exec%" -server -showversion "%java_opts%" -cp "%coherence_home%\lib\coherence.jar;%coherence_home%\lib\coherence-jpa.jar;%coherence_home%\lib\tangosol.jar;%coherence_home%\lib\coherence-common-1.5.0.jar;%modules_home%\javax.persistence_1.0.0.0_1-0-2.jar;%project_home%\Lab9\classes;%weblogic_home%\server\lib\ojdbc5.jar" com.tangosol.net.DefaultCacheServer %1
goto exit
:instructions
echo Usage:
echo ^<coherence_home^>\bin\jpa-cache-server.cmd
goto exit
:exit
endlocal
@echo on
JDeveloper's command line arguments:
-Dtangosol.coherence.cacheconfig=C:\JDeveloper\mywork\CoherenceExample\jpa-cache-config.xml
JDeveloper's log window message returned when I try to execute:
C:\Oracle\Middleware\jdk160_14_R27.6.5-32\bin\javaw.exe -server -classpath C:\JDeveloper\mywork\CoherenceExample\.adf;C:\JDeveloper\mywork\CoherenceExample\Lab9\classes;C:\Oracle\Middleware\modules\com.oracle.toplink_1.0.0.0_11-1-1-2-0.jar;C:\Oracle\Middleware\modules\org.eclipse.persistence_1.0.0.0_1-2-0.jar;C:\Oracle\Middleware\modules\com.bea.core.antlr.runtime_2.7.7.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.toplink_11.1.1\javax.persistence_2.0_preview.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xml.jar;C:\Oracle\Middleware\modules\javax.jsf_1.2.0.1.jar;C:\Oracle\Middleware\modules\javax.ejb_3.0.1.jar;C:\Oracle\Middleware\modules\javax.enterprise.deploy_1.2.jar;C:\Oracle\Middleware\modules\javax.interceptor_1.0.jar;C:\Oracle\Middleware\modules\javax.jms_1.1.1.jar;C:\Oracle\Middleware\modules\javax.jsp_1.1.0.0_2-1.jar;C:\Oracle\Middleware\modules\javax.jws_2.0.jar;C:\Oracle\Middleware\modules\javax.activation_1.1.0.0_1-1.jar;C:\Oracle\Middleware\modules\javax.mail_1.1.0.0_1-4-1.jar;C:\Oracle\Middleware\modules\javax.xml.soap_1.3.1.0.jar;C:\Oracle\Middleware\modules\javax.xml.rpc_1.2.1.jar;C:\Oracle\Middleware\modules\javax.xml.ws_2.1.1.jar;C:\Oracle\Middleware\modules\javax.management.j2ee_1.0.jar;C:\Oracle\Middleware\modules\javax.resource_1.5.1.jar;C:\Oracle\Middleware\modules\javax.servlet_1.0.0.0_2-5.jar;C:\Oracle\Middleware\modules\javax.transaction_1.0.0.0_1-1.jar;C:\Oracle\Middleware\modules\javax.xml.stream_1.1.1.0.jar;C:\Oracle\Middleware\modules\javax.security.jacc_1.0.0.0_1-1.jar;C:\Oracle\Middleware\modules\javax.xml.registry_1.0.0.0_1-0.jar;C:\Oracle\Middleware\modules\javax.persistence_1.0.0.0_1-0-2.jar;C:\weblogic10_3_2\wlserver\server\lib\ojdbc6.jar;C:\ficheiros\coherence\lib\coherence-jpa.jar;C:\ficheiros\coherence\lib\coherence.jar;C:\ficheiros\coherence\coherence\lib;C:\ficheiros\coherence\coherence\lib\tangosol.jar;C:\ficheiros\coherence\coherence\lib\coherence-common-1.5.0.jar;C:\ficheiros\coherence\coherence\lib\eclipselink-jpa-modelgen_2.0.0.v20091127-r5931.jar;C:\ficheiros\coherence\coherence\lib\coherence-toplink.jar -Djavax.net.ssl.trustStore=C:\Oracle\Middleware\wlserver_10.3\server\lib\DemoTrust.jks -Dtangosol.coherence.cacheconfig=C:\JDeveloper\mywork\CoherenceExample\jpa-cache-config.xml com.oracle.coherence.handson.RunEmployeeExample
2010-02-17 18:15:25.803/0.560 Oracle Coherence 3.5.3/465 <Info> (thread=main, member=n/a): Loaded operational configuration from resource "jar:file:/C:/ficheiros/coherence/coherence/lib/coherence.jar!/tangosol-coherence.xml"
2010-02-17 18:15:25.813/0.570 Oracle Coherence 3.5.3/465 <Info> (thread=main, member=n/a): Loaded operational overrides from resource "jar:file:/C:/ficheiros/coherence/coherence/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
2010-02-17 18:15:25.813/0.570 Oracle Coherence 3.5.3/465 <Info> (thread=main, member=n/a): Loaded operational overrides from file "C:\tangosol-coherence-override.xml"
2010-02-17 18:15:25.813/0.570 Oracle Coherence 3.5.3/465 <D5> (thread=main, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
Oracle Coherence Version 3.5.3/465
Grid Edition: Development mode
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
2010-02-17 18:15:26.204/0.961 Oracle Coherence GE 3.5.3/465 <Info> (thread=main, member=n/a): Loaded cache configuration from "file:/C:/JDeveloper/mywork/CoherenceExample/jpa-cache-config.xml"
2010-02-17 18:15:26.895/1.652 Oracle Coherence GE 3.5.3/465 <D5> (thread=Cluster, member=n/a): Service Cluster joined the cluster with senior service member n/a
2010-02-17 18:15:27.115/1.872 Oracle Coherence GE 3.5.3/465 <Info> (thread=Cluster, member=n/a): This Member(Id=2, Timestamp=2010-02-17 18:15:26.925, Address=192.168.1.117:8089, MachineId=26997, Location=site:TEST.PT,machine:test-ad,process:3272, Role=OracleRunEmployeeExample, Edition=Grid Edition, Mode=Development, CpuCount=1, SocketCount=1) joined cluster "cluster:0xDDEB" with senior Member(Id=1, Timestamp=2010-02-17 18:15:10.932, Address=192.168.1.117:8088, MachineId=26997, Location=site:TEST.PT,machine:test-ad,process:3404, Role=CoherenceServer, Edition=Grid Edition, Mode=Development, CpuCount=1, SocketCount=1)
2010-02-17 18:15:27.125/1.882 Oracle Coherence GE 3.5.3/465 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Management with senior member 1
2010-02-17 18:15:27.125/1.882 Oracle Coherence GE 3.5.3/465 <D5> (thread=Cluster, member=n/a): Member 1 joined Service JpaDistributedCache with senior member 1
2010-02-17 18:15:27.195/1.952 Oracle Coherence GE 3.5.3/465 <D5> (thread=Invocation:Management, member=2): Service Management joined the cluster with senior service member 1
2010-02-17 18:15:27.536/2.293 Oracle Coherence GE 3.5.3/465 <D5> (thread=DistributedCache:JpaDistributedCache, member=2): Service JpaDistributedCache joined the cluster with senior service member 1
2010-02-17 18:15:27.546/2.303 Oracle Coherence GE 3.5.3/465 <D5> (thread=DistributedCache:JpaDistributedCache, member=2): Service JpaDistributedCache: received ServiceConfigSync containing 258 entries
2010-02-17 18:15:27.596/2.353 Oracle Coherence GE 3.5.3/465 <D4> (thread=DistributedCache:JpaDistributedCache, member=2): Asking member 1 for 128 primary partitions
2010-02-17 18:15:27.706/2.463 Oracle Coherence GE 3.5.3/465 <Error> (thread=DistributedCache:JpaDistributedCache, member=2): BackingMapManager com.tangosol.net.DefaultConfigurableCacheFactory$Manager: failed to instantiate a cache: Employees
Exception in thread "main" java.lang.NullPointerException
at com.oracle.coherence.handson.RunEmployeeExample.main(RunEmployeeExample.java:34)
2010-02-17 18:15:27.706/2.463 Oracle Coherence GE 3.5.3/465 <Error> (thread=DistributedCache:JpaDistributedCache, member=2):
(Wrapped: Failed to instantiate class "com.tangosol.coherence.jpa.JpaCacheStore" using sun.misc.Launcher$AppClassLoader@47858e
<class-scheme>
<class-name>com.tangosol.coherence.jpa.JpaCacheStore</class-name>
<init-params>
<init-param>
<param-type>java.lang.String</param-type>
<param-value>Employees</param-value>
</init-param>
<init-param>
<param-type>java.lang.String</param-type>
<param-value>com.oracle.coherence.handson.Employees</param-value>
</init-param>
<init-param>
<param-type>java.lang.String</param-type>
<param-value>JPA</param-value>
</init-param>
</init-params>
</class-scheme>) java.lang.ClassNotFoundException: com.tangosol.coherence.jpa.JpaCacheStore
at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
at com.tangosol.run.xml.XmlHelper.createInstance(XmlHelper.java:2307)
at com.tangosol.net.DefaultConfigurableCacheFactory.instantiateAny(DefaultConfigurableCacheFactory.java:2994)
at com.tangosol.net.DefaultConfigurableCacheFactory.instantiateCacheStore(DefaultConfigurableCacheFactory.java:2857)
at com.tangosol.net.DefaultConfigurableCacheFactory.instantiateReadWriteBackingMap(DefaultConfigurableCacheFactory.java:1493)
at com.tangosol.net.DefaultConfigurableCacheFactory.configureBackingMap(DefaultConfigurableCacheFactory.java:1258)
at com.tangosol.net.DefaultConfigurableCacheFactory$Manager.instantiateBackingMap(DefaultConfigurableCacheFactory.java:3492)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$Storage.instantiateResourceMap(DistributedCache.CDB:22)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$Storage.setCacheName(DistributedCache.CDB:27)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$ConfigListener.entryInserted(DistributedCache.CDB:15)
at com.tangosol.util.MapEvent.dispatch(MapEvent.java:266)
at com.tangosol.util.MapEvent.dispatch(MapEvent.java:226)
at com.tangosol.util.MapListenerSupport.fireEvent(MapListenerSupport.java:556)
at com.tangosol.util.ObservableHashMap.dispatchEvent(ObservableHashMap.java:229)
at com.tangosol.util.ObservableHashMap$Entry.onAdd(ObservableHashMap.java:270)
at com.tangosol.util.SafeHashMap.put(SafeHashMap.java:244)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.updateServiceConfigMap(Grid.CDB:29)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid$ServiceConfigUpdate.onReceived(Grid.CDB:41)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:9)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:136)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache.onNotify(DistributedCache.CDB:3)
at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: com.tangosol.coherence.jpa.JpaCacheStore
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.tangosol.util.ExternalizableHelper.loadClass(ExternalizableHelper.java:2976)
at com.tangosol.run.xml.XmlHelper.createInstance(XmlHelper.java:2273)
... 21 more
2010-02-17 18:15:27.776/2.533 Oracle Coherence GE 3.5.3/465 <D4> (thread=ShutdownHook, member=2): ShutdownHook: stopping cluster node
2010-02-17 18:15:27.776/2.533 Oracle Coherence GE 3.5.3/465 <D5> (thread=Cluster, member=2): Service Cluster left the cluster
Process exited with exit code 1.
Could anyone please help me out with this? Thanks in advance for any help you can give me... I'm going mad with this!