Hi, I followed the docs on the express setup, but I can't get it working.
I've started the terracotta server with defaults (start-tc-server.bat)
I've bundled into my ear file all the required jars
Here's my persistence.xml:
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="pciPU" >
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/pciDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.cache.region.factory_class" value="net.sf.ehcache.hibernate.EhCacheRegionFactory" />
<property name="hibernate.cache.use_second_level_cache" value="true" />
</properties>
</persistence-unit>
</persistence>
And here's my ehcache config:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ehcache name="pciCache">
<terracottaConfig url="localhost:9510" />
<defaultCache
maxElementsInMemory="1000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120">
<terracotta/>
</defaultCache>
<cache name="com.ericsson.oss.one.pci.model.Cell"
maxElementsInMemory="10000" eternal="true">
<terracotta/>
</cache>
<cache name="com.ericsson.oss.one.pci.model.Cell.outgoingRelations"
maxElementsInMemory="100000" eternal="true" >
<terracotta/>
</cache>
<cache name="com.ericsson.oss.one.pci.model.Cell.incomingRelations"
maxElementsInMemory="100000" eternal="true" >
<terracotta/>
</cache>
</ehcache>
I've put the license file inside my ejbjar so it can be loaded by the classloader
When I deploy the application I get this error:
Code:
Caused by: org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Unable to load class net.sf.ehcache.terracotta.ExpressEnterpriseTerracottaClusteredInstanceFactory. Initial cause was null
at net.sf.ehcache.hibernate.EhCacheRegionFactory.start(EhCacheRegionFactory.java:89)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:238) [:3.6.6.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872) [:3.6.6.Final]
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906) [:3.6.6.Final]
... 73 more
Caused by: net.sf.ehcache.CacheException: Unable to load class net.sf.ehcache.terracotta.ExpressEnterpriseTerracottaClusteredInstanceFactory. Initial cause was null
at net.sf.ehcache.util.ClassLoaderUtil.createNewInstance(ClassLoaderUtil.java:109)
at net.sf.ehcache.terracotta.TerracottaClusteredInstanceHelper.newClusteredInstanceFactory(TerracottaClusteredInstanceHelper.java:178)
at net.sf.ehcache.terracotta.TerracottaClient.createNewClusteredInstanceFactory(TerracottaClient.java:201)
at net.sf.ehcache.terracotta.TerracottaClient.createClusteredInstanceFactory(TerracottaClient.java:153)
at net.sf.ehcache.CacheManager.init(CacheManager.java:343)
at net.sf.ehcache.CacheManager.<init>(CacheManager.java:230)
at net.sf.ehcache.hibernate.EhCacheRegionFactory.start(EhCacheRegionFactory.java:70)
... 76 more
Caused by: java.lang.ExceptionInInitializerError
at net.sf.ehcache.terracotta.ExpressEnterpriseTerracottaClusteredInstanceFactory.<init>(ExpressEnterpriseTerracottaClusteredInstanceFactory.java:37)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_21]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_21]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_21]
at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_21]
at net.sf.ehcache.util.ClassLoaderUtil.createNewInstance(ClassLoaderUtil.java:92)
... 82 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException: bootJarUrl is null
at org.terracotta.express.ClientFactoryImpl.<init>(ClientFactoryImpl.java:85)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_21]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_21]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_21]
at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_21]
at java.lang.Class.newInstance0(Class.java:355) [:1.6.0_21]
at java.lang.Class.newInstance(Class.java:308) [:1.6.0_21]
at org.terracotta.express.Util.getImplInstance(Util.java:11)
at org.terracotta.express.ClientFactory.<clinit>(ClientFactory.java:12)
... 88 more
Caused by: java.lang.NullPointerException: bootJarUrl is null
at org.terracotta.express.ClientFactoryImpl.<init>(ClientFactoryImpl.java:79)
... 96 more
Can't find what I'm missing here. From what I read, bootjar should not be needed for the express setup (without DSO) right? All I need is a distributed cache, I think I would not need DSO right?
We are evaluating terracotta vs gemfire vs coherence. Any help would be great.