2014-10-17 84 views
1

我使用下面的命令來關閉Jboss的AS7.2.0的獨立實例在Windows 7Jboss的AS7不能正常關閉

%JBOSS_HOME%\bin\jboss-cli.bat --connect controller=10.10.54.85:9999 --commands=:shutdown 

關聯。然而到JBoss的Java進程是沒有得到終止。我看到這個進程的線程轉儲顯示一些線程掛了一段時間,這些線程在相當長的時間(大約一個小時)後終止,然後進程完成它自己。掛起的線程被命名爲「JMX服務器連接超時」(我不確定這是唯一的罪魁禍首)。並且日誌反覆顯示一些JMSEception,如下所示:

2014-10-17 08:34:07.811 GMT+0000 <@> ERROR <@> [1425:Thread-364] <@> ProcessId:1252 <@> PID:0 <@> UID:12 <@> HttpSessionId: <@> com.mypkg.platform.framework.event <@> getTopicConnection <@> Failed to create TopicConnection <@> 
javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory org.jboss.naming.remote.client.InitialContextFactory from classloader ModuleClassLoader for Module "org.hornetq:main" from local module loader @68a9ae3e (finder: local module finder @5bee9e20 (roots: D:\jboss-as-7.2.0.Final\modules,D:\jboss-as-7.2.0.Final\modules\system\layers\base)) 
    at org.jboss.as.naming.InitialContextFactoryBuilder.createInitialContextFactory(InitialContextFactoryBuilder.java:64) 
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:681) 
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307) 
    at javax.naming.InitialContext.init(InitialContext.java:242) 
    at javax.naming.InitialContext.<init>(InitialContext.java:216) 
    at com.mypkg.platform.framework.event.Messenger.setupInitialContext(Messenger.java:915) 
    at com.mypkg.platform.framework.event.Messenger.getTopicConnectionFactory(Messenger.java:924) 
    at com.mypkg.platform.framework.event.Messenger.getTopicConnection(Messenger.java:1263) 
    at com.mypkg.platform.framework.event.Messenger.access$600(Messenger.java:103) 
    at com.mypkg.platform.framework.event.Messenger$ConnectionExceptionListener.onException(Messenger.java:1670) 
    at org.hornetq.jms.client.HornetQConnection$JMSFailureListener$1.run(HornetQConnection.java:697) 
    at java.lang.Thread.run(Thread.java:722) 
2014-10-17 08:34:07.811 GMT+0000 <@> ERROR <@> [1425:Thread-364] <@> ProcessId:1252 <@> PID:0 <@> UID:12 <@> HttpSessionId: <@> com.mypkg.platform.framework.event <@> onException():TOPIC <@> Failed to establish Connection on attempt number: 30. Will retry after 10000 millis. Retry attempts remaining: 99970 <@> 
javax.jms.JMSException: HornetQException[errorType=DISCONNECTED message=HQ119035: The connection was disconnected because of server shutdown] 
    at org.hornetq.jms.client.HornetQConnection$JMSFailureListener.connectionFailed(HornetQConnection.java:688) 
    at org.hornetq.core.client.impl.ClientSessionFactoryImpl.callSessionFailureListeners(ClientSessionFactoryImpl.java:963) 
    at org.hornetq.core.client.impl.ClientSessionFactoryImpl.failoverOrReconnect(ClientSessionFactoryImpl.java:740) 
    at org.hornetq.core.client.impl.ClientSessionFactoryImpl.handleConnectionFailure(ClientSessionFactoryImpl.java:580) 
    at org.hornetq.core.client.impl.ClientSessionFactoryImpl.access$100(ClientSessionFactoryImpl.java:85) 
    at org.hornetq.core.client.impl.ClientSessionFactoryImpl$DelegatingFailureListener.connectionFailed(ClientSessionFactoryImpl.java:1674) 
    at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.callFailureListeners(RemotingConnectionImpl.java:570) 
    at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.fail(RemotingConnectionImpl.java:341) 
    at org.hornetq.core.client.impl.ClientSessionFactoryImpl$CloseRunnable.run(ClientSessionFactoryImpl.java:1633) 
    at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:106) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) 
    at java.lang.Thread.run(Thread.java:722) 
Caused by: HornetQException[errorType=DISCONNECTED message=HQ119035: The connection was disconnected because of server shutdown] 
    ... 5 more 

這是正確的根本原因嗎?有人可以幫助我嗎?

回答

0

這是很難回答沒有看到您的JMS連接的使用,但是,我倒是建議你註冊一個@PreDestroy方法的EJB這樣你就可以正常終止所有connetions:

@Singleton 
public class JMSDummyHandlerBean 
{ 
    @PostConstruct 
    public void init() 
    { 
     // Do your init here 
    } 

    @PreDestroy 
    public void tearDown() 
    { 
     // This will be called on server shutdown so you can kill all the active connections 
    }