如果我更改JNDI端口,在Eclipse中关闭JBoss的问题

Bal*_*ato 7 java eclipse jboss jboss-tools

第一阶段

我在Eclipse下关闭运行的JBoss实例时遇到了问题,因为我更改了JBoss的JNDI端口.当然我可以从控制台视图关闭它,但不能使用停止按钮(它仍然在默认的1099端口搜索JNDI端口).我期待着任何解决方案.谢谢!

使用环境:

  • JBoss 4.0.2(默认使用)
  • Eclipse 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>
Run Code Online (Sandbox Code Playgroud)

Eclipse设置:

关于我的JBoss Tools首选项: 我有一个以前的版本,我遇到了这个问题,我在JbossTools中读到了一些bug修复,所以更新到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" 
Run Code Online (Sandbox Code Playgroud)

第二阶段:

在File/new/other/server中创建新服务器后,它确实出现在首选项选项卡中.现在停止按钮正在工作(服务器接收关闭消息而不需要对jndi端口进行任何额外修改 - 现在没有机会)但它仍然会抛出错误消息,尽管不同,它无一例外地堆栈跟踪:"服务器JBoss 4.0服务器无法停止."

ska*_*man 1

好的,您要做的是文件->新建->其他->服务器,并在那里设置您的 JBoss 服务器。然后它将出现在 Preferences->JBossTools->Servers 中。

令人费解。