Classloader issues on Glassfish

Description

When using Liquibase 2.0.0 on Glassfish 3.0, I get a couple of issues. Context: EAR application (Java EE 6) consisting of EJB module (JAR) and WAR.

1) From Netbeans, using "directory deployment", using the servlet listener, having the project in a directory whose name has a space character in it, Liquibase says it isn't able to find any Logger implementation. Moving the project to a simpler directory seems to work.

2) Using the servlet listener, having changelogs in a package, Liquibase isn't able to find them. It seems to use the same classloader as Liquibase, which is wrong in my opinion. It could work for some environments, but I don't think it's the right way to do it. In Glassfish, in an EAR project, it seems libraries are in a distinct class loader.

I had to change the code of the servlet listener as following:

Thread currentThread = Thread.currentThread();
Classloader contextClassLoader = currentThread.getContextClassLoader();
ResourceAccessor clFO = new ClassLoaderResourceAccessor(contextClassLoader);

...

Environment

None

Activity

Show:

Nathan Voxland January 26, 2011 at 6:11 AM

Your thread-based classloader changes seem good. I added them to 2.0.1. Thanks!

Fixed

Details

Reporter

Components

Fix versions

Affects versions

Priority

Created January 4, 2011 at 10:06 AM
Updated June 20, 2013 at 3:30 AM
Resolved January 26, 2011 at 6:11 AM