Skip to content

Commit 2090bef

Browse files
committed
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
1 parent 5e5b7e2 commit 2090bef

File tree

2 files changed

+8
-0
lines changed
  • spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/main/webapp/WEB-INF
  • spring-boot-starters/spring-boot-starter-json

2 files changed

+8
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<glassfish-web-app error-url="">
3+
<class-loader delegate="false"/>
4+
</glassfish-web-app>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
<groupId>com.fasterxml.jackson.core</groupId>
2323
<artifactId>jackson-databind</artifactId>
2424
</dependency>
25+
<dependency>
26+
<groupId>com.fasterxml.jackson.datatype</groupId>
27+
<artifactId>jackson-datatype-jdk8</artifactId>
28+
</dependency>
2529
<dependency>
2630
<groupId>com.fasterxml.jackson.datatype</groupId>
2731
<artifactId>jackson-datatype-jsr310</artifactId>

0 commit comments

Comments
 (0)