我們有一個部署到Tomcat(6.0.35)的Spring MVC Web應用程序(WAR),它在部署時啓動一個單獨的JVM內的線程(不要問爲什麼 - 而不是我的設計)然後通過RMI通過端口8888Spring/RMI服務器錯誤
線程通信,儘管被完全convoluded,這是工作完全正常,直到昨天,現在的線程在啓動時,儘管添加登錄到混音我們最大的努力失敗了,我們正在撞牆。這是唯一的例外,我們可以在日誌中找到:
Jun 12, 2012 3:11:36 AM com.ourapp.ImageController destroy
SEVERE: Shutdown Error: Lookup of RMI stub failed; nested exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused
Jun 12, 2012 3:11:37 AM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org/springframework/web/context/ContextCleanupListener
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:80)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3973)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4577)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1165)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1271)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:296)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextCleanupListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
... 12 more
的ImageController
是Spring MVC Controller
,負責踢了這個守護進程/催生RMI線程。基於這個錯誤的verbage,有沒有人有任何想法什麼可能會導致這種「連接被拒絕」的錯誤?
運行netstat -an | grep 8888
(這是一臺Linux機器)不產生任何輸出,這意味着在該端口上沒有任何監聽。預先感謝任何想法或建議,導致修復。
編輯:這是另一個ConnectionException
我們看到:
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:189)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
... 74 more
您確定您嘗試連接的端口沒有被封鎖或關閉嗎? –
這些日誌似乎來自Web應用程序JVM,它基本上抱怨說它無法通過RMI連接。你需要調查其他服務的日誌,以及爲什麼它沒有啓動/不在8888上監聽。 – maksimov
@indyaah - 我對linux不太熟悉 - 我可以使用哪些命令來判斷端口8888是否被阻止/關閉? – IAmYourFaja