Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
aa9945c8
Commit
aa9945c8
authored
Dec 17, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade to Jetty 9.4.14.v20181114
Closes gh-15239
parent
bb40e2ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
45 deletions
+37
-45
pom.xml
spring-boot-dependencies/pom.xml
+1
-1
JettyEmbeddedServletContainer.java
...context/embedded/jetty/JettyEmbeddedServletContainer.java
+14
-2
ServletContextInitializerConfiguration.java
...mbedded/jetty/ServletContextInitializerConfiguration.java
+22
-42
No files found.
spring-boot-dependencies/pom.xml
View file @
aa9945c8
...
@@ -111,7 +111,7 @@
...
@@ -111,7 +111,7 @@
<jedis.version>
2.9.0
</jedis.version>
<jedis.version>
2.9.0
</jedis.version>
<jersey.version>
2.25.1
</jersey.version>
<jersey.version>
2.25.1
</jersey.version>
<jest.version>
2.0.4
</jest.version>
<jest.version>
2.0.4
</jest.version>
<jetty.version>
9.4.1
2.v20180830
</jetty.version>
<jetty.version>
9.4.1
4.v20181114
</jetty.version>
<jetty-jsp.version>
2.2.0.v201112011158
</jetty-jsp.version>
<jetty-jsp.version>
2.2.0.v201112011158
</jetty-jsp.version>
<jetty-el.version>
8.0.33
</jetty-el.version>
<jetty-el.version>
8.0.33
</jetty-el.version>
<jms-api.version>
1.1-rev-1
</jms-api.version>
<jms-api.version>
1.1-rev-1
</jms-api.version>
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainer.java
View file @
aa9945c8
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
package
org
.
springframework
.
boot
.
context
.
embedded
.
jetty
;
package
org
.
springframework
.
boot
.
context
.
embedded
.
jetty
;
import
java.io.IOException
;
import
java.net.BindException
;
import
java.net.BindException
;
import
java.util.List
;
import
java.util.List
;
...
@@ -142,8 +143,9 @@ public class JettyEmbeddedServletContainer implements EmbeddedServletContainer {
...
@@ -142,8 +143,9 @@ public class JettyEmbeddedServletContainer implements EmbeddedServletContainer {
try
{
try
{
connector
.
start
();
connector
.
start
();
}
}
catch
(
BindException
ex
)
{
catch
(
IOException
ex
)
{
if
(
connector
instanceof
NetworkConnector
)
{
if
(
connector
instanceof
NetworkConnector
&&
findBindException
(
ex
)
!=
null
)
{
throw
new
PortInUseException
(
throw
new
PortInUseException
(
((
NetworkConnector
)
connector
).
getPort
());
((
NetworkConnector
)
connector
).
getPort
());
}
}
...
@@ -166,6 +168,16 @@ public class JettyEmbeddedServletContainer implements EmbeddedServletContainer {
...
@@ -166,6 +168,16 @@ public class JettyEmbeddedServletContainer implements EmbeddedServletContainer {
}
}
}
}
private
BindException
findBindException
(
Throwable
ex
)
{
if
(
ex
==
null
)
{
return
null
;
}
if
(
ex
instanceof
BindException
)
{
return
(
BindException
)
ex
;
}
return
findBindException
(
ex
.
getCause
());
}
private
String
getActualPortsDescription
()
{
private
String
getActualPortsDescription
()
{
StringBuilder
ports
=
new
StringBuilder
();
StringBuilder
ports
=
new
StringBuilder
();
for
(
Connector
connector
:
this
.
server
.
getConnectors
())
{
for
(
Connector
connector
:
this
.
server
.
getConnectors
())
{
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/ServletContextInitializerConfiguration.java
View file @
aa9945c8
...
@@ -18,7 +18,6 @@ package org.springframework.boot.context.embedded.jetty;
...
@@ -18,7 +18,6 @@ package org.springframework.boot.context.embedded.jetty;
import
javax.servlet.ServletException
;
import
javax.servlet.ServletException
;
import
org.eclipse.jetty.util.component.AbstractLifeCycle
;
import
org.eclipse.jetty.webapp.AbstractConfiguration
;
import
org.eclipse.jetty.webapp.AbstractConfiguration
;
import
org.eclipse.jetty.webapp.Configuration
;
import
org.eclipse.jetty.webapp.Configuration
;
import
org.eclipse.jetty.webapp.WebAppContext
;
import
org.eclipse.jetty.webapp.WebAppContext
;
...
@@ -49,54 +48,35 @@ public class ServletContextInitializerConfiguration extends AbstractConfiguratio
...
@@ -49,54 +48,35 @@ public class ServletContextInitializerConfiguration extends AbstractConfiguratio
@Override
@Override
public
void
configure
(
WebAppContext
context
)
throws
Exception
{
public
void
configure
(
WebAppContext
context
)
throws
Exception
{
context
.
addBean
(
new
Initializer
(
context
),
true
);
ClassLoader
classLoader
=
Thread
.
currentThread
().
getContextClassLoader
();
}
Thread
.
currentThread
().
setContextClassLoader
(
context
.
getClassLoader
());
try
{
/**
callInitializers
(
context
);
* Jetty {@link AbstractLifeCycle} to call the {@link ServletContextInitializer
* ServletContextInitializers}.
*/
private
class
Initializer
extends
AbstractLifeCycle
{
private
final
WebAppContext
context
;
Initializer
(
WebAppContext
context
)
{
this
.
context
=
context
;
}
}
finally
{
@Override
Thread
.
currentThread
().
setContextClassLoader
(
classLoader
);
protected
void
doStart
()
throws
Exception
{
ClassLoader
classLoader
=
Thread
.
currentThread
().
getContextClassLoader
();
Thread
.
currentThread
().
setContextClassLoader
(
this
.
context
.
getClassLoader
());
try
{
callInitializers
();
}
finally
{
Thread
.
currentThread
().
setContextClassLoader
(
classLoader
);
}
}
}
}
private
void
callInitializers
()
throws
ServletException
{
private
void
callInitializers
(
WebAppContext
context
)
throws
ServletException
{
try
{
try
{
setExtendedListenerTypes
(
true
);
setExtendedListenerTypes
(
context
,
true
);
for
(
ServletContextInitializer
initializer
:
ServletContextInitializerConfiguration
.
this
.
initializers
)
{
for
(
ServletContextInitializer
initializer
:
this
.
initializers
)
{
initializer
.
onStartup
(
this
.
context
.
getServletContext
());
initializer
.
onStartup
(
context
.
getServletContext
());
}
}
finally
{
setExtendedListenerTypes
(
false
);
}
}
}
}
finally
{
private
void
setExtendedListenerTypes
(
boolean
extended
)
{
setExtendedListenerTypes
(
context
,
false
);
try
{
this
.
context
.
getServletContext
().
setExtendedListenerTypes
(
extended
);
}
catch
(
NoSuchMethodError
ex
)
{
// Not available on Jetty 8
}
}
}
}
private
void
setExtendedListenerTypes
(
WebAppContext
context
,
boolean
extended
)
{
try
{
context
.
getServletContext
().
setExtendedListenerTypes
(
extended
);
}
catch
(
NoSuchMethodError
ex
)
{
// Not available on Jetty 8
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment