5

Ubuntu 12.04 マシンの Jetty サーバーでサーバーおよびクライアント アプリケーションを実行しようとしています。サーバーは問題なく起動し、次のコマンドを使用しました

$ mvn jetty:実行

このコマンドを発行すると、最初の行は

アドレス: 8787 でトランスポート dt_socket をリッスンしています

しかし、クライアントを起動すると、次のエラーが発生しました

ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
Aborted

transport dt_socket と関係があるようです。それが何であるか、クライアントに別のアドレスを使用する方法がわかりませんか?

編集 1

クライアントの pom.xml からの jetty-maven-plugin は次のようになります

<build>
    <plugins>

      <!-- Specific jetty-maven-plugin configuration for running Jetty during
        development. None of its goals are run in a normal build lifecycle. -->
      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>${jetty-maven-plugin.version}</version>
        <configuration>
          <webAppConfig>
            <contextPath>/</contextPath>
            <extraClasspath>${basedir}/src/test/resources/</extraClasspath>
          </webAppConfig>
          <connectors>
            <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
              <port>${servlet.port}</port>
              <host>0.0.0.0</host>
            </connector>
          </connectors>
          <reload>manual</reload>
          <useTestClasspath>true</useTestClasspath>
        </configuration>
      </plugin>
    </plugins>
  </build>

私の推測では、Jetty がデバッグ モードで起動し、既にサーバーのデバッガーにバインドされているポート 8787 でデバッガーをアタッチしようとしていると考えられます。

4

3 に答える 3

9

ターミナル/コマンドプロンプトで以下のコマンドを入力してください

killall -9 java

すべての Java プロセスを強制終了します。その後、ポートを使用できるようになります。

于 2016-04-20T06:35:52.190 に答える
0

jetty プラグイン内でこの構成を試してください

<configuration>
    <connectors>
        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
            <port>9090</port>
        </connector>
    </connectors>
</configuration>

または、jettyこの方法でコマンドラインから実行します

mvn -Djetty.port=9090 jetty:run
于 2013-09-06T17:30:00.257 に答える