From 5c89d4c9b6ba81c4cf003b64b51c4eca30dde05d Mon Sep 17 00:00:00 2001 From: Greg Burd Date: Tue, 6 Jul 2021 11:58:44 -0400 Subject: [PATCH] Fixed ehCache issue. Still having issues finding the persistence.xml file at runtime. --- README | 2 +- log4j.properties | 17 +++++++++++++++++ pom.xml | 2 +- .../com/example/crud/EhCacheConfiguration.java | 3 +-- 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 log4j.properties diff --git a/README b/README index dc60e4b..96c3556 100644 --- a/README +++ b/README @@ -3,7 +3,7 @@ docker run --name castrato -p 9042:9042 -p 9162:9162 -p 7000:7000 -e CASSANDRA_S drop table books; drop table products; drop table inventory; drop table magazines; desc tables; -mvn clean compile -Dmaven.compiler.showDeprecation=true -Dmaven.compiler.showWarnings=true +mvn -U clean compile -Dmaven.compiler.showDeprecation=true -Dmaven.compiler.showWarnings=true https://www.one-tab.com/page/K4XlsjF2TyugqYE_8ORqxg diff --git a/log4j.properties b/log4j.properties new file mode 100644 index 0000000..539f1c8 --- /dev/null +++ b/log4j.properties @@ -0,0 +1,17 @@ +# Define the destination and format of our logging +log4j.appender.A1=org.apache.log4j.FileAppender +log4j.appender.A1.File=datanucleus.log +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%t) %-5p [%c] - %m%n + +# DataNucleus Categories +log4j.category.DataNucleus.JDO=INFO, A1 +log4j.category.DataNucleus.Cache=INFO, A1 +log4j.category.DataNucleus.MetaData=INFO, A1 +log4j.category.DataNucleus.General=INFO, A1 +log4j.category.DataNucleus.Transaction=INFO, A1 +log4j.category.DataNucleus.Datastore=DEBUG, A1 +log4j.category.DataNucleus.ValueGeneration=DEBUG, A1 + +log4j.category.DataNucleus.Enhancer=INFO, A1 +log4j.category.DataNucleus.SchemaTool=INFO, A1 diff --git a/pom.xml b/pom.xml index 9e36256..12ca056 100644 --- a/pom.xml +++ b/pom.xml @@ -202,7 +202,7 @@ net.sf.ehcache ehcache - 2.10.4 + 2.10.9.2 pom diff --git a/src/main/java/com/example/crud/EhCacheConfiguration.java b/src/main/java/com/example/crud/EhCacheConfiguration.java index 7fda79a..1764e4c 100644 --- a/src/main/java/com/example/crud/EhCacheConfiguration.java +++ b/src/main/java/com/example/crud/EhCacheConfiguration.java @@ -17,8 +17,7 @@ public class EhCacheConfiguration { @Bean public EhCacheManagerFactoryBean ehCacheManagerFactoryBean() { - EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean(); - cacheManagerFactoryBean.setConfigLocation(new ClassPathResource("ehcache.xml")); + EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean(); cacheManagerFactoryBean.setShared(true); return cacheManagerFactoryBean; }