8

第一段階

JBoss の JNDI ポートを変更したため、Eclipse で実行中の JBoss インスタンスをシャットダウンする際に問題が発生しました。もちろん、コンソール ビューからシャットダウンすることはできますが、停止ボタンを使用することはできません (デフォルトの 1099 ポートで JNDI ポートを引き続き検索します)。どんな解決策も楽しみにしています。ありがとうございました!

使用環境:

  • JBoss 4.0.2 (デフォルトを使用)
  • エクリプス 3.4.0。(JBoss Tools 2.1.1.GA を使用)

デフォルトのポート: 1098、1099 変更されたポート: 11098、11099

jbosspath/server/default/conf/jboss-service.xml の次の部分を変更しました。

   <!-- ==================================================================== -->
   <!-- JNDI                                                                 -->
   <!-- ==================================================================== -->

   <mbean code="org.jboss.naming.NamingService"
      name="jboss:service=Naming"
      xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
      <!-- The call by value mode. true if all lookups are unmarshalled using
      the caller's TCL, false if in VM lookups return the value by reference.
      -->
      <attribute name="CallByValue">false</attribute>
      <!-- The listening port for the bootstrap JNP service. Set this to -1
        to run the NamingService without the JNP invoker listening port.
      -->
      <attribute name="Port">11099</attribute>
      <!-- The bootstrap JNP server bind address. This also sets the default
      RMI service bind address. Empty == all addresses
       -->
      <attribute name="BindAddress">${jboss.bind.address}</attribute>
      <!-- The port of the RMI naming service, 0 == anonymous -->
      <attribute name="RmiPort">11098</attribute>
      <!-- The RMI service bind address. Empty == all addresses
       -->
      <attribute name="RmiBindAddress">${jboss.bind.address}</attribute>
      <!-- The thread pool service used to control the bootstrap lookups -->
      <depends optional-attribute-name="LookupPool"
         proxy-type="attribute">jboss.system:service=ThreadPool</depends>
   </mbean>

   <mbean code="org.jboss.naming.JNDIView"
        name="jboss:service=JNDIView"
        xmbean-dd="resource:xmdesc/JNDIView-xmbean.xml">
   </mbean>

エクリプスのセットアップ:

JBoss Tools の設定について: 以前のバージョンを持っていて、この問題が発生しました。JbossTools のバグ修正について読んだので、2.1.1.GA に更新しました。ボタンが変更され、新しい設定ビューが表示されましたが、何も変更できません...異常なようです:

エラー ダイアログ:

スタックトレース:

javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
    at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at org.jboss.Shutdown.main(Shutdown.java:202)
Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]
    at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:254)
    at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370)
    ... 4 more
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]
    at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:228)
    ... 5 more
Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at java.net.Socket.<init>(Socket.java:309)
    at java.net.Socket.<init>(Socket.java:211)
    at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
    at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
    at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:224)
    ... 5 more
Exception in thread "main" 

第 2 段階:

File/new/other/server に新しいサーバーを作成した後、設定タブに表示されました。これで停止ボタンが機能するようになりました (サーバーは、jndi ポートをさらに変更することなくシャットダウン メッセージを受け取ります。現在はその機会はありません) が、それでもエラー メッセージがスローされますが、例外はありませんが、スタック トレースは例外ではありません。 JBoss 4.0 サーバーを停止できませんでした。」

4

7 に答える 7

3

jboss-path\bin\shutdown.jar を開きます

例: jboss-4.2.3.GA\bin\shutdown.jar

jboss-path\bin\shutdown.jar\jndi.properties を開きます

変更する

java.naming.provider.url=jnp://localhost:1099 から java.naming.provider.url=jnp://localhost:11099 へ

于 2011-01-24T15:02:38.743 に答える
3

この問題の詳細な修正方法は次のとおりです。jndi ポートが再マップされると、Eclipse WTP サーバー コネクタは JBoss をシャットダウンしません。

これは、デフォルトのサーバー コネクタ プロファイルが jndiPort に独自のエイリアスを使用しないためです。この問題は、eclipse.org でも議論されてい ます。

解決策は、Eclipse の .serverdef ファイルから得られます。


<eclipse>\plugins\org.eclipse.jst.server.generic.jboss_1.5.105.v200709061325\servers\jboss*.serverdef

これらは、jndi ポートの xml プロパティを宣言します。


<property id="jndiPort"
 label="%jndiPort"
 type="string"
 context="server"
 default="1099" /> 

これは、serverdef に STOP コマンドがコーディングされている場所で使用する必要があるだけです。

したがって、この:


 <stop>
  <mainClass>org.jboss.Shutdown</mainClass>
  <workingDirectory>${serverRootDirectory}/bin</workingDirectory>
  <programArguments>-S</programArguments>
  <vmParameters></vmParameters>
  <classpathReference>jboss</classpathReference>
 </stop>

これになります:


 <stop>
  <mainClass>org.jboss.Shutdown</mainClass>
  <workingDirectory>${serverRootDirectory}/bin</workingDirectory>
  <programArguments>-s jnp://${serverAddress}:${jndiPort}</programArguments>
  <vmParameters></vmParameters>
  <classpathReference>jboss</classpathReference>
 </stop>

この考え方は、jndi 接続の定義と比較することで確認できます。


 <jndiConnection>
  <providerUrl>jnp://${serverAddress}:${jndiPort}</providerUrl>
<initialContextFactory>org.jnp.interfaces.NamingContextFactory</initialContextFactory>
  <jndiProperty>
   <name></name>
   <value></value>
  </jndiProperty>
 </jndiConnection>

この一般的なケースの修正のインスピレーションの功績は、Moisa Laurentiu Florin にあります。ハードコードされた値の代わりに ${jndiPort} を代用する方法を探すようになったのは、彼らの貢献でした。

この修正により、プレーンな Eclipse WTP サーバー コネクタの両方が修正されます。JBOss IDE コネクタについてはまだ調査中です

于 2009-10-03T01:52:05.960 に答える
1

OK、あなたがしなければならないことは、File->New->Other->Server で、そこに JBoss サーバーをセットアップします。その後、Preferences->JBossTools->Servers に表示されます。

複雑。

于 2008-10-06T11:23:59.583 に答える
0

これはJBoss6.0.0M3で変更されました。

停止コマンドは次のようになります。

"-s service:jmx:rmi:/// jndi / rmi:// localhost:1090 / jmxrmi"

ポートも変更されていることに注意してください。これは、1099ではJNDIポートではなく、 RMI/JMXポート1090です。したがって、サーバー定義に別の構成パラメーターが必要になります。

JBoss6.0.0M3サーバーに「JNDIポート」パラメーターが必要かどうかはわかりません。

http://www.cs.hs-rm.de/~knauf/public/に変更されたeclipseプラグインがあり、この変更を含む6.0.0M3のサーバー定義が含まれています。このサイトは、この変更の詳細が記載されたJBossフォーラムスレッドにもリンクしています。

よろしくお願いします

ヴォルフガングナウフ

于 2010-06-11T08:58:12.187 に答える
0

MyEclipse サーバー構成には、デフォルト値が入力された「オプションのシャットダウン引数」フィールドがあります。

--shutdown

に変更します

-s jnp://localhost:11099 --shutdown

編集:

申し訳ありませんが、この回答は MyEclipse に関連しています。ただし、環境内にも JBoss shutdown コマンドを指定できる場所が必要です。たぶん、「実行...」構成を見てください。

于 2008-10-06T08:06:27.860 に答える
0

Eclipse WTP からデフォルトで提供されるものではなく、JBoss ツールによって提供されるサーバー アダプターを使用します。

次に、サーバーをダブルクリックするだけで、JNDI ポートを編集できます (何もしなければ、XML 構成から自動的に取得されます)。起動構成のコマンドライン引数を介して JNDI ポートを設定するというトリックを実行することもできますが、それは単にポート値を設定するよりも面倒です。

于 2009-05-17T10:08:13.690 に答える