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
bcfb1d17
Commit
bcfb1d17
authored
Oct 11, 2017
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.5.x'
parents
325b2b09
c44b912f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
16 deletions
+51
-16
UndertowServletWebServer.java
.../boot/web/embedded/undertow/UndertowServletWebServer.java
+24
-8
UndertowWebServer.java
...amework/boot/web/embedded/undertow/UndertowWebServer.java
+24
-8
UndertowServletWebServerFactoryTests.java
...bedded/undertow/UndertowServletWebServerFactoryTests.java
+3
-0
No files found.
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServer.java
View file @
bcfb1d17
...
@@ -159,6 +159,7 @@ public class UndertowServletWebServer implements WebServer {
...
@@ -159,6 +159,7 @@ public class UndertowServletWebServer implements WebServer {
.
info
(
"Undertow started on port(s) "
+
getPortsDescription
());
.
info
(
"Undertow started on port(s) "
+
getPortsDescription
());
}
}
catch
(
Exception
ex
)
{
catch
(
Exception
ex
)
{
try
{
if
(
findBindException
(
ex
)
!=
null
)
{
if
(
findBindException
(
ex
)
!=
null
)
{
List
<
Port
>
failedPorts
=
getConfiguredPorts
();
List
<
Port
>
failedPorts
=
getConfiguredPorts
();
List
<
Port
>
actualPorts
=
getActualPorts
();
List
<
Port
>
actualPorts
=
getActualPorts
();
...
@@ -170,6 +171,21 @@ public class UndertowServletWebServer implements WebServer {
...
@@ -170,6 +171,21 @@ public class UndertowServletWebServer implements WebServer {
}
}
throw
new
WebServerException
(
"Unable to start embedded Undertow"
,
ex
);
throw
new
WebServerException
(
"Unable to start embedded Undertow"
,
ex
);
}
}
finally
{
stopSilently
();
}
}
}
}
private
void
stopSilently
()
{
try
{
if
(
this
.
undertow
!=
null
)
{
this
.
undertow
.
stop
();
}
}
catch
(
Exception
ex
)
{
// Ignore
}
}
}
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java
View file @
bcfb1d17
...
@@ -88,6 +88,7 @@ public class UndertowWebServer implements WebServer {
...
@@ -88,6 +88,7 @@ public class UndertowWebServer implements WebServer {
.
info
(
"Undertow started on port(s) "
+
getPortsDescription
());
.
info
(
"Undertow started on port(s) "
+
getPortsDescription
());
}
}
catch
(
Exception
ex
)
{
catch
(
Exception
ex
)
{
try
{
if
(
findBindException
(
ex
)
!=
null
)
{
if
(
findBindException
(
ex
)
!=
null
)
{
List
<
UndertowWebServer
.
Port
>
failedPorts
=
getConfiguredPorts
();
List
<
UndertowWebServer
.
Port
>
failedPorts
=
getConfiguredPorts
();
List
<
UndertowWebServer
.
Port
>
actualPorts
=
getActualPorts
();
List
<
UndertowWebServer
.
Port
>
actualPorts
=
getActualPorts
();
...
@@ -99,6 +100,21 @@ public class UndertowWebServer implements WebServer {
...
@@ -99,6 +100,21 @@ public class UndertowWebServer implements WebServer {
}
}
throw
new
WebServerException
(
"Unable to start embedded Undertow"
,
ex
);
throw
new
WebServerException
(
"Unable to start embedded Undertow"
,
ex
);
}
}
finally
{
stopSilently
();
}
}
}
}
private
void
stopSilently
()
{
try
{
if
(
this
.
undertow
!=
null
)
{
this
.
undertow
.
stop
();
}
}
catch
(
Exception
ex
)
{
// Ignore
}
}
}
}
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java
View file @
bcfb1d17
...
@@ -303,6 +303,9 @@ public class UndertowServletWebServerFactoryTests
...
@@ -303,6 +303,9 @@ public class UndertowServletWebServerFactoryTests
int
blockedPort
)
{
int
blockedPort
)
{
assertThat
(
ex
).
isInstanceOf
(
PortInUseException
.
class
);
assertThat
(
ex
).
isInstanceOf
(
PortInUseException
.
class
);
assertThat
(((
PortInUseException
)
ex
).
getPort
()).
isEqualTo
(
blockedPort
);
assertThat
(((
PortInUseException
)
ex
).
getPort
()).
isEqualTo
(
blockedPort
);
Object
undertow
=
ReflectionTestUtils
.
getField
(
this
.
webServer
,
"undertow"
);
Object
worker
=
ReflectionTestUtils
.
getField
(
undertow
,
"worker"
);
assertThat
(
worker
).
isNull
();
}
}
}
}
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