Eclipse中JBOSS莫名其妙自动关闭
經(jīng)常會碰到在Eclipse啟動時JBOSS時,JBOSS順利啟動后自動就關閉了, 如下提示框
?
(注意要點擊details按鈕,看一下,是不是上面的原因)
?
由于Eclipse對于所有Java 服務器設定的超時為50秒,因此如果JBOSS的啟動時間超過50秒就會被關掉。
解決這個問題要分兩種情況,
一.如果確實是機器比較慢,服務器啟動到一關停止,則設置服務器啟動時間.
1.JBOSS 的超時可以通過其安裝目錄/server/default/conf/jboss-service.xml的TransactionTimeout屬性來設定。默認為Normal,一般夠用了。
2.如果要在Eclipse中直接啟動應用,則需要在ECLIPSE中設置: Windows>Peferences>Server ,在 Server timeout delay 下拉框中選擇Unlimited.
二.當把啟動時間設置為Unlimited后,服務器一直處理starting的狀態(tài),這時需要檢查配置.
原因主要是由于配置不一致造成的,檢查下 eclipse中Jboss server的配置,位置在workspace\.metadata\.plugins\org.eclipse.wst.server.core下的server.xml(也可以在Server view單擊JBOSS,在其中設置相關端口)
?
<?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已經(jīng)啟動完成,然而eclipse不能查詢到服務器的狀態(tài),所以在eclipse中服務器一直顯示為starting狀態(tài),最后超時。
??? 查看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 usingthe 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 -1to run the NamingService without the JNP invoker listening port.--><attribute name="Port">1099</attribute>?
確保這里的1099和eclipse中的一致。
?
?
總結, 即你在JBOSS和ECLIPSE的Server view中修改的端口必須保持一致.如果不一致,那么在ECLIPSE中啟動view時,服務器一直處于starting狀態(tài),直到超時,把服務器關閉.
總結
以上是生活随笔為你收集整理的Eclipse中JBOSS莫名其妙自动关闭的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java压缩----使用ANT JDK压
- 下一篇: Struts2和Struts1.x的全面