天天看點

eclipse中啟動jboss逾時解決方法

逾時的原因主要是由于配置不一緻造成的,檢查下 eclipse中Jboss server的配置,位置在workspace\.metadata\.plugins\org.eclipse.wst.server.core下的server.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<servers>
  <server hostname="localhost" id="JBoss v4.0 at localhost" name="JBoss v4.0 at localhost" runtime-id="JBoss v4.0" server-type="org.eclipse.jst.server.generic.jboss4" server-type-id="org.eclipse.jst.server.generic.jboss4" start-timeout="50" stop-timeout="15" timestamp="1">
    <map jndiPort="1099" key="generic_server_instance_properties" port="8080" serverAddress="127.0.0.1" serverConfig="default"/>
    <list key="modules" value0="order_query::org.eclipse.jst.j2ee.server:order_query::jst.web::2.4"/>
    <list key="Generic_Server_Modules_List" value0="org.eclipse.jst.j2ee.server:order_query"/>
  </server>
</servers>      

确定這裡的Jndi port 和port是否和jboss中的對應配置相同,如果不相同,就會導緻雖然JBoss已經啟動完成,然而eclipse不能查詢到伺服器的狀态,是以在eclipse中伺服器一直顯示為starting狀态,最後逾時。

檢視jboss中的配置

jbosspath\server\default\deploy\jbossweb-tomcat55.sar 中的server.xml 的

<Connector port="8080" address="${jboss.bind.address}"
         maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
         emptySessionPath="true"
         enableLookups="false" redirectPort="8443" acceptCount="100"
         connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="GBK" server="www.yeepay.com" />      

確定這裡的端口号為8080 

最後檢視jndi的端口号,位置 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">1099</attribute>      

確定這裡的1099和eclipse中的一緻。