Configure Glassfish sample to use parent-last class loader delegation

Glassfish bundles an old and incomplete version of Glassfish. By
default, this leads to some of Jackson's classes being loaded from
inside the war file and others being loaded from Glassfish itself.
This mixture of versions does not end well and the application fails
to deploy.

This commit adds a Glassfish-specific deployment descriptor to
invert the web app class loader's delegation model. Rather than
preferring classes available from its parent, it will now prefer
those packaged inside the war file.

Closes gh-9391
pull/4411/merge
Andy Wilkinson 8 years ago
parent 5e5b7e20ff
commit 2090bef08e

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<glassfish-web-app error-url="">
<class-loader delegate="false"/>
</glassfish-web-app>

@ -22,6 +22,10 @@
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.datatype</groupId> <groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId> <artifactId>jackson-datatype-jsr310</artifactId>

Loading…
Cancel
Save