Browse Source

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 9 years ago
parent
commit
2090bef08e
  1. 4
      spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/main/webapp/WEB-INF/glassfish-web.xml
  2. 4
      spring-boot-starters/spring-boot-starter-json/pom.xml

4
spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/main/webapp/WEB-INF/glassfish-web.xml

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

4
spring-boot-starters/spring-boot-starter-json/pom.xml

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

Loading…
Cancel
Save