From 0248b1471d1950c7cc37e3efd1eb970c4f46183c Mon Sep 17 00:00:00 2001 From: "Mark H. Wood" Date: Thu, 9 Mar 2017 15:30:00 -0500 Subject: [PATCH 1/3] [DS-3423] Update a few dependencies and fix license headers --- dspace-services/pom.xml | 2 +- .../src/main/resources/i18n/messages.properties | 8 ++++++++ dspace-spring-rest/src/main/webapp/index.html | 9 +++++++++ pom.xml | 7 +------ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/dspace-services/pom.xml b/dspace-services/pom.xml index dce02ac6ce..2211480df1 100644 --- a/dspace-services/pom.xml +++ b/dspace-services/pom.xml @@ -100,7 +100,7 @@ net.sf.ehcache ehcache-core - 2.4.3 + 2.6.11 compile diff --git a/dspace-spring-rest/src/main/resources/i18n/messages.properties b/dspace-spring-rest/src/main/resources/i18n/messages.properties index e69de29bb2..56f5e678a3 100644 --- a/dspace-spring-rest/src/main/resources/i18n/messages.properties +++ b/dspace-spring-rest/src/main/resources/i18n/messages.properties @@ -0,0 +1,8 @@ +# +# The contents of this file are subject to the license and copyright +# detailed in the LICENSE and NOTICE files at the root of the source +# tree and available online at +# +# http://www.dspace.org/license/ +# + diff --git a/dspace-spring-rest/src/main/webapp/index.html b/dspace-spring-rest/src/main/webapp/index.html index 35ca676d46..79285d870c 100644 --- a/dspace-spring-rest/src/main/webapp/index.html +++ b/dspace-spring-rest/src/main/webapp/index.html @@ -1,3 +1,12 @@ + diff --git a/pom.xml b/pom.xml index 09f938c910..2711a97cb6 100644 --- a/pom.xml +++ b/pom.xml @@ -28,13 +28,8 @@ 4.10.4 2.13.0 1.7.22 - - 5.0.11.Final + 5.2.8.Final 4.3.6.RELEASE - ${basedir} From 697433085f4952d865a43d8981ea65aaad711cc5 Mon Sep 17 00:00:00 2001 From: "Mark H. Wood" Date: Fri, 10 Mar 2017 10:31:22 -0500 Subject: [PATCH 2/3] [DS-3482] Accept any type of DBConnection. DSpace.getSingletonService(Class) looks for a service of type Class named Class.getName(). I don't see how this ever worked, since DBConnection is an interface, and an implementation will have some other name. Instead request any service which is instanceof DBConnection. There should be only one. This patch uncovers a slew of new NPEs in dspace-api tests, which are happening in dspace-services. We have multiple Ehcache CacheManager instances for some reason, and newer versions of Ehcache throw a fit when you try to create multiple managers with the same configuration. --- dspace-api/src/main/java/org/dspace/core/Context.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/core/Context.java b/dspace-api/src/main/java/org/dspace/core/Context.java index e359f5be23..6462a7055d 100644 --- a/dspace-api/src/main/java/org/dspace/core/Context.java +++ b/dspace-api/src/main/java/org/dspace/core/Context.java @@ -142,7 +142,8 @@ public class Context if(dbConnection == null) { // Obtain a non-auto-committing connection - dbConnection = new DSpace().getSingletonService(DBConnection.class); + dbConnection = new DSpace().getServiceManager() + .getServiceByName(null, DBConnection.class); if(dbConnection == null) { log.fatal("Cannot obtain the bean which provides a database connection. " + From 22987c10b27f77dec73498de1dc0e8a3fc482068 Mon Sep 17 00:00:00 2001 From: "Mark H. Wood" Date: Fri, 10 Mar 2017 10:38:20 -0500 Subject: [PATCH 3/3] [DS-3482] Force all Ehcache users that I can find to use a shared CacheManager. --- .../src/main/resources/spring/spring-dspace-core-services.xml | 3 ++- dspace/config/hibernate.cfg.xml | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dspace-services/src/main/resources/spring/spring-dspace-core-services.xml b/dspace-services/src/main/resources/spring/spring-dspace-core-services.xml index e1377ea2de..b9d72aa13c 100644 --- a/dspace-services/src/main/resources/spring/spring-dspace-core-services.xml +++ b/dspace-services/src/main/resources/spring/spring-dspace-core-services.xml @@ -49,6 +49,7 @@ + @@ -70,4 +71,4 @@ - \ No newline at end of file + diff --git a/dspace/config/hibernate.cfg.xml b/dspace/config/hibernate.cfg.xml index e6be18a2a0..806f52949e 100644 --- a/dspace/config/hibernate.cfg.xml +++ b/dspace/config/hibernate.cfg.xml @@ -22,7 +22,9 @@ true true - org.hibernate.cache.ehcache.EhCacheRegionFactory + + org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory + ENABLE_SELECTIVE