이따금씩 개발환경을 윈도우에서 톰캣을 띄워야 하는 경우가 있다.
톰캣을 구동시키려 startup.bat 파일을 실행하면 커맨드(cmd) 창이 나타났다가 에러메시지가 나타나고 바로 창이 닫혀버리기 때문에 뭐가 문제인지 확인도 못하고 어떻게 해야 할지 잘 모르는 경우가 있다.
이런경우 왜 톰캣이 정상적으로 구동되지 않는지 원인분석을 아래와 같은 방법으로 알아볼 수 있다.
startup.bat 파일은 내부적으로 catalina.bat 를 호출한다.
catalina.bat run 명령어를 통해 창이 따로 열리지 않은 상태에서 톰캣을 구동시킬 수 있기 때문에 창이 닫혀서 에러로그를 볼 수 없는 상황에서 벗어날 수 있다.
아래의 상황은 8009 포트가 이미 열려있기 때문에 톰캣을 정상적으로 구동할 수 없다고 나와있다.
그때의 상황은 IntelliJ IDEA 에서 톰캣을 이미 구동하고 있었기 때문에 포트가 겹쳐서 발생한 문제였다. 기존에 띄워진 톰캣을 종료시키니 정상적으로 톰캣을 띄울 수 있었다.
Using CATALINA_BASE: "K:\devTools\apache-tomcat-7.0.69"
Using CATALINA_HOME: "K:\devTools\apache-tomcat-7.0.69"
Using CATALINA_TMPDIR: "K:\devTools\apache-tomcat-7.0.69\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.6.0_45"
Using CLASSPATH: "K:\devTools\apache-tomcat-7.0.69\bin\bootstrap.jar;K:\devTools\apache-tomcat-7.0.69\bin\tomcat-juli.jar"
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: Server version: Apache Tomcat/7.0.69
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: Server built: Apr 11 2016 07:57:09 UTC
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: Server number: 7.0.69.0
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: OS Name: Windows 7
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: OS Version: 6.1
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: Architecture: amd64
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: Java Home: C:\Program Files\Java\jdk1.6.0_45\jre
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: JVM Version: 1.6.0_45-b06
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: JVM Vendor: Sun Microsystems Inc.
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: CATALINA_BASE: K:\devTools\apache-tomcat-7.0.69
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: CATALINA_HOME: K:\devTools\apache-tomcat-7.0.69
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: Command line argument: -Djava.util.logging.config.file=K:\devTools\apache-tomcat-7.0.69\conf\logging.properties
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: Command line argument: -Djava.endorsed.dirs=K:\devTools\apache-tomcat-7.0.69\endorsed
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: Command line argument: -Dcatalina.base=K:\devTools\apache-tomcat-7.0.69
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: Command line argument: -Dcatalina.home=K:\devTools\apache-tomcat-7.0.69
2016. 6. 10 오후 3:43:53 org.apache.catalina.startup.VersionLoggerListener log
정보: Command line argument: -Djava.io.tmpdir=K:\devTools\apache-tomcat-7.0.69\temp
2016. 6. 10 오후 3:43:53 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
정보: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program
Files\Java\jdk1.6.0_45\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\i
CLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program F
iles (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R
) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:
\Program Files\Git\usr\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\sdk\android\platform-tools;K:\devTools\gradle-2.13\bin;C:\Window
s\Softcamp\SDS;C:\Windows\Softcamp\SDS\x64;C:\Windows\Softcamp\SDK;C:\Windows\Softcamp\SDK\x64;C:\Program Files\Bandizip\7z;C:\Users\HuhWook\AppData\Roaming\npm
;C:\Users\HuhWook\AppData\Local\atom\bin;.
2016. 6. 10 오후 3:43:53 org.apache.coyote.AbstractProtocol init
정보: Initializing ProtocolHandler ["http-bio-8080"]
2016. 6. 10 오후 3:43:53 org.apache.coyote.AbstractProtocol init
정보: Initializing ProtocolHandler ["ajp-bio-8009"]
2016. 6. 10 오후 3:43:53 org.apache.coyote.AbstractProtocol init
심각: Failed to initialize end point associated with ProtocolHandler ["ajp-bio-8009"]
java.net.BindException: Address already in use: JVM_Bind <null>:8009
at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:413)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:650)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:434)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:978)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:560)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:838)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.startup.Catalina.load(Catalina.java:642)
at org.apache.catalina.startup.Catalina.load(Catalina.java:667)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:253)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427)
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.<init>(ServerSocket.java:194)
at java.net.ServerSocket.<init>(ServerSocket.java:150)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:49)
at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:400)
... 16 more
2016. 6. 10 오후 3:43:53 org.apache.catalina.core.StandardService initInternal
심각: Failed to initialize connector [Connector[AJP/1.3-8009]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[AJP/1.3-8009]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:560)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:838)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.startup.Catalina.load(Catalina.java:642)
at org.apache.catalina.startup.Catalina.load(Catalina.java:667)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:253)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427)
Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
at org.apache.catalina.connector.Connector.initInternal(Connector.java:980)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 12 more
Caused by: java.net.BindException: Address already in use: JVM_Bind <null>:8009
at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:413)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:650)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:434)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:978)
... 13 more
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.<init>(ServerSocket.java:194)
at java.net.ServerSocket.<init>(ServerSocket.java:150)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:49)
at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:400)
... 16 more
2016. 6. 10 오후 3:43:54 org.apache.catalina.startup.Catalina load
정보: Initialization processed in 787 ms
2016. 6. 10 오후 3:43:54 org.apache.catalina.core.StandardService startInternal
정보: Starting service Catalina
2016. 6. 10 오후 3:43:54 org.apache.catalina.core.StandardEngine startInternal
정보: Starting Servlet Engine: Apache Tomcat/7.0.69
2016. 6. 10 오후 3:43:54 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deploying web application directory K:\devTools\apache-tomcat-7.0.69\webapps\docs
2016. 6. 10 오후 3:43:54 org.apache.tomcat.websocket.server.WsSci onStartup
정보: JSR 356 WebSocket (Java WebSocket 1.1) support is not available when running on Java 6. To suppress this message, run Tomcat on Java 7, remove the WebSock
et JARs from $CATALINA_HOME/lib or add the WebSocket JARs to the tomcat.util.scan.DefaultJarScanner.jarsToSkip property in $CATALINA_BASE/conf/catalina.properti
es. Note that the deprecated Tomcat 7 WebSocket API will be available.
2016. 6. 10 오후 3:43:54 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deployment of web application directory K:\devTools\apache-tomcat-7.0.69\webapps\docs has finished in 386 ms
2016. 6. 10 오후 3:43:54 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deploying web application directory K:\devTools\apache-tomcat-7.0.69\webapps\examples
2016. 6. 10 오후 3:43:54 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deployment of web application directory K:\devTools\apache-tomcat-7.0.69\webapps\examples has finished in 266 ms
2016. 6. 10 오후 3:43:54 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deploying web application directory K:\devTools\apache-tomcat-7.0.69\webapps\host-manager
2016. 6. 10 오후 3:43:54 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deployment of web application directory K:\devTools\apache-tomcat-7.0.69\webapps\host-manager has finished in 67 ms
2016. 6. 10 오후 3:43:54 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deploying web application directory K:\devTools\apache-tomcat-7.0.69\webapps\manager
2016. 6. 10 오후 3:43:54 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deployment of web application directory K:\devTools\apache-tomcat-7.0.69\webapps\manager has finished in 62 ms
2016. 6. 10 오후 3:43:54 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deploying web application directory K:\devTools\apache-tomcat-7.0.69\webapps\ROOT
2016. 6. 10 오후 3:43:54 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deployment of web application directory K:\devTools\apache-tomcat-7.0.69\webapps\ROOT has finished in 48 ms
2016. 6. 10 오후 3:43:54 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deploying web application directory K:\devTools\apache-tomcat-7.0.69\webapps\tservice
2016. 6. 10 오후 3:43:54 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deployment of web application directory K:\devTools\apache-tomcat-7.0.69\webapps\tservice has finished in 57 ms
2016. 6. 10 오후 3:43:54 org.apache.coyote.AbstractProtocol start
정보: Starting ProtocolHandler ["http-bio-8080"]
2016. 6. 10 오후 3:43:55 org.apache.catalina.startup.Catalina start
정보: Server startup in 983 ms
2016. 6. 10 오후 3:43:55 org.apache.catalina.core.StandardServer await
심각: StandardServer.await: create[localhost:8005]:
java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.<init>(ServerSocket.java:194)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:444)
at org.apache.catalina.startup.Catalina.await(Catalina.java:781)
at org.apache.catalina.startup.Catalina.start(Catalina.java:727)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:428)
2016. 6. 10 오후 3:43:55 org.apache.coyote.AbstractProtocol pause
정보: Pausing ProtocolHandler ["http-bio-8080"]
2016. 6. 10 오후 3:43:55 org.apache.coyote.AbstractProtocol pause
정보: Pausing ProtocolHandler ["ajp-bio-8009"]
2016. 6. 10 오후 3:43:55 org.apache.catalina.core.StandardService stopInternal
정보: Stopping service Catalina
2016. 6. 10 오후 3:43:55 org.apache.coyote.AbstractProtocol stop
정보: Stopping ProtocolHandler ["http-bio-8080"]
2016. 6. 10 오후 3:43:55 org.apache.coyote.AbstractProtocol destroy
정보: Destroying ProtocolHandler ["http-bio-8080"]
2016. 6. 10 오후 3:43:55 org.apache.coyote.AbstractProtocol stop
정보: Stopping ProtocolHandler ["ajp-bio-8009"]
2016. 6. 10 오후 3:43:55 org.apache.coyote.AbstractProtocol destroy
정보: Destroying ProtocolHandler ["ajp-bio-8009"]
K:\devTools\apache-tomcat-7.0.69\bin>
댓글
댓글 쓰기