diff --git a/jspwiki-cache/src/main/java/org/apache/wiki/cache/EhcacheCachingManager.java b/jspwiki-cache/src/main/java/org/apache/wiki/cache/EhcacheCachingManager.java index cb6009d131..bdb566b187 100644 --- a/jspwiki-cache/src/main/java/org/apache/wiki/cache/EhcacheCachingManager.java +++ b/jspwiki-cache/src/main/java/org/apache/wiki/cache/EhcacheCachingManager.java @@ -69,10 +69,16 @@ public void shutdown() { public void initialize( final Engine engine, final Properties props ) throws WikiException { final String cacheEnabled = TextUtil.getStringProperty( props, PROP_CACHE_ENABLE, PROP_USECACHE_DEPRECATED, "true" ); final boolean useCache = "true".equalsIgnoreCase( cacheEnabled ); - final String confLocation = "/" + TextUtil.getStringProperty( props, PROP_CACHE_CONF_FILE, "ehcache-jspwiki.xml" ); if( useCache ) { - final URL location = this.getClass().getResource( confLocation ); + String val = TextUtil.getStringProperty( props, PROP_CACHE_CONF_FILE, "ehcache-jspwiki.xml" ); + URL location = this.getClass().getResource( "/" + val ); + if (location == null) { + location = this.getClass().getResource( val ); + } LOG.info( "Reading ehcache configuration file from classpath on /{}", location ); + if (location == null ) { + LOG.error( "The ehcache configuration file from classpath on {} could not be loaded. Check setting {}", val , PROP_CACHE_CONF_FILE); + } cacheManager = CacheManager.create( location ); registerCache( CACHE_ATTACHMENTS ); registerCache( CACHE_ATTACHMENTS_COLLECTION ); diff --git a/jspwiki-portable/src/overlay/woas/webapps/department/WEB-INF/classes/jspwiki-custom.properties b/jspwiki-portable/src/overlay/woas/webapps/department/WEB-INF/classes/jspwiki-custom.properties index 9ae3189c2d..82333df29b 100644 --- a/jspwiki-portable/src/overlay/woas/webapps/department/WEB-INF/classes/jspwiki-custom.properties +++ b/jspwiki-portable/src/overlay/woas/webapps/department/WEB-INF/classes/jspwiki-custom.properties @@ -30,8 +30,9 @@ jspwiki.attachment.maxsize=4000000 jspwiki.breakTitleWithSpaces=true jspwiki.searchProvider=LuceneSearchProvider jspwiki.security=jaas +#disabled due to classpath loading issues with the portable build see JSPWIKI-1199 jspwiki.cache.enable=false -jspwiki.cache.config-file=ehcache-woas-department.xml +jspwiki.cache.config-file=ehcache-woas-department # jspwiki.xmlGroupDatabaseFile=/usr/local/tomcat/lib/groupdatabase.xml # jspwiki.xmlUserDatabaseFile=/usr/local/tomcat/lib/userdatabase.xml diff --git a/jspwiki-portable/src/overlay/woas/webapps/personal/WEB-INF/classes/jspwiki-custom.properties b/jspwiki-portable/src/overlay/woas/webapps/personal/WEB-INF/classes/jspwiki-custom.properties index 124659cd86..9336c72292 100644 --- a/jspwiki-portable/src/overlay/woas/webapps/personal/WEB-INF/classes/jspwiki-custom.properties +++ b/jspwiki-portable/src/overlay/woas/webapps/personal/WEB-INF/classes/jspwiki-custom.properties @@ -30,6 +30,7 @@ jspwiki.breakTitleWithSpaces=true jspwiki.pageProvider=FileSystemProvider jspwiki.searchProvider=BasicSearchProvider jspwiki.security=jaas +#disabled due to classpath loading issues with the portable build see JSPWIKI-1199 jspwiki.cache.enable=false jspwiki.cache.config-file=ehcache-woas-personal.xml