Skip to content

JSPWIKI-1207 Look for the ehcache configuration with the class loader of the thread too - #636

Open
arturobernalg wants to merge 1 commit into
apache:masterfrom
arturobernalg:fix-ehcache-context-cl
Open

arturobernalg wants to merge 1 commit into
apache:masterfrom
arturobernalg:fix-ehcache-context-cl

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

EhcacheCachingManager only looked for the configuration file with its own class loader. In the portable builds the jars are in a library shared by the web applications, so that class loader does not see the classes folder of each wiki, the URL is null and the wiki does not start. The cache was disabled in the portable builds as a temporary fix (JSPWIKI-1207). The class loader of the thread is now tried when the first one does not find the file, the cache is enabled again in the two wikis of the portable, and the configuration file of the department wiki gets the .xml extension it was missing.

Run on this change: a new test in EhcacheCachingManagerTest fails without it with "Error configuring from null" and passes with it; mvn clean package with all the tests passes (1446 tests); the portable starts with its own Tomcat, the two wikis answer 200 and each one reads its own ehcache file, with no SEVERE in the log.

@spyhunter99

…d too

The configuration file was only looked for with the class loader of EhcacheCachingManager. In the portable builds the jars are in a library shared by the web applications, so that class loader does not see the classes folder of each wiki, the URL was null and the wiki did not start. That is why the cache was disabled in the portable builds. The class loader of the thread is tried when the first one does not find the file, the cache is enabled again in the two wikis of the portable, and the configuration file of the department wiki gets the extension that it was missing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant