Jira server fails to start with BindException error

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

Unable to start or shut down a Jira application.

atlassian-jira.log に次のメッセージが表示される。

Dec 20, 2011 12:25:27 PM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[5060]: 
java.net.BindException: Cannot assign requested address
	at java.net.PlainSocketImpl.socketBind(Native Method)
	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:353)
	at java.net.ServerSocket.bind(ServerSocket.java:336)
	at java.net.ServerSocket.<init>(ServerSocket.java:202)
	at org.apache.catalina.core.StandardServer.await(StandardServer.java:406)
	at org.apache.catalina.startup.Catalina.await(Catalina.java:676)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:628)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Exhibiting the same behavior, a user may also see this error in the catalina.out:

Sep 18, 2013 11:59:57 PM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[localhost:80]: 
java.net.BindException: Address already in use: JVM_Bind
	at java.net.DualStackPlainSocketImpl.bind0(Native Method)
	at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
	at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
	at java.net.PlainSocketImpl.bind(Unknown Source)
	at java.net.ServerSocket.bind(Unknown Source)
	at java.net.ServerSocket.<init>(Unknown Source)

原因

If the instance is throwing the Address already in use: JVM_Bind error:

  • When a Jira application starts up, it listens on a port specified in the Tomcat server.xml.
  • External traffic communicates through that port so it can talk to the Jira application.
  • Only one process can listen to a port at a time. If you attempt to listen with another application, the Operating System will not let you - in this case, we can see that with the exception above.
  • If another application (such as IIS or Apache or MS SQL Reporting Services) is running on that Tomcat port, the Jira application will not be able to start.
  • The server.xml may have multiple Connector elements set up with the same port number.
  • (info) To check on how many instances of the application are currently running, run this command:

    Linux の場合

     ps aux | grep catalina.

If the instance is throwing the Cannot assign requested address error:

  • This is due to to the Operating System being unable to resolve the localhost, which is required to start and shutdown Tomcat. This is most commonly caused by a misconfigured hosts file.  

ソリューション

For the Cannot assign requested address error...

Windows の場合

  1. Navigate to C:\Windows\System32\drivers\etc , and edit the hosts file.

  2. Make sure that this line is uncommented (else, add the line to the bottom of the file):

    127.0.0.1       localhost

For Linux:

  1. /etc/hosts. を編集します。
  2. Make sure that this line is uncommented (else, add the line to the top of the file):

    127.0.0.1	localhost
For the Address already in use: JVM_Bind error...
  1. Identify the port number in the error message and navigate to the $JIRAINSTALL/conf/server.xml and verify that the SHUTDOWN port and CONNECTOR port are different as seen below:

    <Server port="8005" shutdown="SHUTDOWN">
    ...
      <Connector port="8080" maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false" maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443" acceptCount="100" disableUploadTimeout="true"/>


  2. If they are different, then verify if any other services are running on the port.
  3. Check the server.xml to ensure there are not multiple connector elements with the same port number.

Windows の場合

Open a command prompt and run the following to identify what is running on the port (8080 in the below example, could also be another port such as port 80)

netstat -nao | findstr ":8080"

(warning) Some known Windows processes which can conflict with Tomcat functionality include local installations of MS Internet Information Services (IIS) and also MS SQL Reporting Services (SSRS).

Take note of the PID number of the culprit process and run the below command to identify it's service (replacing <PID>)

tasklist | findstr "<PID>" 

Stop that process (in the Windows Task Manager and/or Windows Services), and restart Jira.


For Linux:

In a terminal, run the below command to identify the the processes running on the port (8080 in the below example)

netstat -anlp | grep 8080

Stop the culprit PID, and restart Jira.

最終更新日: 2020 年 12 月 6 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.