エンドポイントを初期化中のエラーです

Apache Tomcatインストールして,何も考えずにスタートメニューから“Start Tomcat”を選んで発生したエラー“エンドポイントを初期化中のエラーです”への対処方法である.

環境は以下の通り.

  • WindowsXP Professional(サービスパックいっぱい)
  • Apache Tomcat 4.1.27

まずは発生したエラーメッセージから.

2003/10/12 11:01:03 org.apache.commons.modeler.Registry loadRegistry
情報: Loading registry information
2003/10/12 11:01:10 org.apache.commons.modeler.Registry getRegistry
情報: Creating new Registry instance
2003/10/12 11:01:11 org.apache.commons.modeler.Registry getServer
情報: Creating MBeanServer
2003/10/12 11:01:11 org.apache.coyote.http11.Http11Protocol init
致命的: エンドポイントを初期化中のエラーです
java.net.BindException: Address already in use: JVM_Bind:8080
at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:280)
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:150)
--以下省略--
  

インストール→起動でいきなり出たエラーなので,すっかりパニックになってしまったが,実はコンソールに出てくるメッセージを良く見ると書いてあったりする.

2003/10/12 11:01:11 org.apache.coyote.http11.Http11Protocol init
致命的: エンドポイントを初期化中のエラーです
java.net.BindException: Address already in use: JVM_Bind:8080
at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:280)
  

Tomcatがデフォルトで使うポート番号“8080”を別のアプリケーションが使っているので動かないわけだ.この値を変える.変更箇所はserver.xml.tomcatをインストールしたディレクトリのconf(例えばC:\Program Files\Apache Group\Tomcat 4.1\conf)にある.8080で検索すると2箇所出てくる.ひとつはコメントなので無視.8090に変えた.

    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8090"               minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="100" debug="0" connectionTimeout="20000"
               useURIValidationHack="false" disableUploadTimeout="true" />
  

保存してTomcatを動かしてみよう.

2003/10/12 11:12:31 org.apache.commons.modeler.Registry loadRegistry
情報: Loading registry information
2003/10/12 11:12:39 org.apache.commons.modeler.Registry getRegistry
情報: Creating new Registry instance
2003/10/12 11:12:39 org.apache.commons.modeler.Registry getServer
情報: Creating MBeanServer
2003/10/12 11:12:40 org.apache.coyote.http11.Http11Protocol init
情報: Coyote HTTP/1.1をポート8090で初期化します
サービス Tomcat-Standalone を起動します
--以下省略--
  

動いたらしい.ブラウザでアクセスする場合はhttp://localhost:8080/ではなくhttp://localhost:8090/となる.