Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting API ML on Already Used Port Should Give a Specific Message #3747

Open
dkelosky opened this issue Sep 6, 2024 · 0 comments
Open
Labels

Comments

@dkelosky
Copy link
Contributor

dkelosky commented Sep 6, 2024

I attempted to start a newly installed instance of API ML (v2.18) I used these config values:

zowe:
  externalPort: 3000
...
components:
  gateway:
    port: 3000

However, port 3000 was being used by another application on my system and so I received these errors in the job log:

2024-09-04 20:38:01.499 <ZWEAGW1:main:33554513> ZWESVUSR WARN  (o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
2024-09-04 20:38:04.707 <ZWEAGW1:main:33554513> ZWESVUSR WARN  (o.a.c.l.WebappClassLoaderBase) The web application [ROOT] appears to have started a thread named [RxIoScheduler-1 (Evictor)] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 sun.misc.Unsafe.park(Native Method)
 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2089)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1104)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:820)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1085)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
 java.lang.Thread.run(Thread.java:825)
2024-09-04 20:38:04.778 <ZWEAGW1:main:33554513> ZWESVUSR ERROR (o.s.b.SpringApplication) Application run failed
org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:186)
	at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:58)
	at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:365)
	at java.lang.Iterable.forEach(Iterable.java:86)
	at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:160)
	at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:128)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:949)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:594)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
	at org.zowe.apiml.gateway.GatewayApplication.main(GatewayApplication.java:58)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
	at java.lang.reflect.Method.invoke(Method.java:508)
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
	at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467)
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:229)
	at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:43)
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:183)
	... 20 common frames omitted
Caused by: java.lang.IllegalArgumentException: standardService.connector.startFailed
	at org.apache.catalina.core.StandardService.addConnector(StandardService.java:222)
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:282)
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebSe
rver.java:213)
	... 22 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed
	at org.apache.catalina.connector.Connector.startInternal(Connector.java:1058)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
	at org.apache.catalina.core.StandardService.addConnector(StandardService.java:219)
	... 24 common frames omitted
Caused by: java.net.SocketException: EDC5111I Permission denied. (errno2=0x744C7246)
	at sun.nio.ch.Net.bind0(Native Method)
	at sun.nio.ch.Net.bind(Net.java:460)
	at sun.nio.ch.Net.bind(Net.java:452)
	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:253)
	at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:268)
	at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:223)
	at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1373)
	at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1459)
	at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:673)
	at org.apache.catalina.connector.Connector.startInternal(Connector.java:1055)
	... 26 common frames omitted

This has messages like Unable to start embedded Tomcat server and EDC5111I Permission denied. but neither of these let me to the conclusion that the port I selected was already in use. Is it possible to detect this situation and issue a specific message when it occurs?

@dkelosky dkelosky added enhancement New feature or request new New issue that has not been worked on yet labels Sep 6, 2024
@EvaJavornicka EvaJavornicka added Priority: High size/S and removed new New issue that has not been worked on yet labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants