java - Spring RmiExporter service fails after successful startup -
i'm experiencing situation rmi service configured using spring's rmiserviceexporter
starting fine, , usable while - after unknown amount of time, service unavailable though java process spring context still running.
at moment work around reboot java process, hardly acceptable in production environment. cannot figure out, or begin guess, why might happening, or might going wrong. no s/o or google search has been useful, because find examples of rmiserviceexporter
failing start @ all, not starting ok , failing later on. clue @ useful.
output of lsof | head -1;lsof | grep 1197
, before service fails:
command pid user fd type device size/off node name java 6882 ubuntu 176u ipv6 54677985 0t0 tcp *:1197 (listen)
service-side spring config:
<bean class="org.springframework.remoting.rmi.rmiserviceexporter"> <property name="servicename" value="myrmiservice" /> <property name="service" ref="myservice" /> <property name="serviceinterface" value="package.myservice" /> <property name="registryport" value="${my.rmi.port}" /> </bean>
client-side spring config:
<bean id="remoteservice" class="org.springframework.remoting.rmi.rmiproxyfactorybean"> <property name="serviceurl" value="rmi://${my.rmi.host}:${my.rmi.port}/myrmiservice"/> <property name="serviceinterface" value="package.myservice"/> <property name="lookupstubonstartup" value="false"/> <property name="refreshstubonconnectfailure" value="true"/> </bean>
client-side stacktrace, after service fails (lsof
reports nothing):
exception in thread "main" org.springframework.remoting.remotelookupfailureexception: lookup of rmi stub failed; nested exception java.rmi.connectexception: connection refused host: rmiservice.host; nested exception is: java.net.connectexception: connection refused @ org.springframework.remoting.rmi.rmiclientinterceptor.lookupstub(rmiclientinterceptor.java:215) @ org.springframework.remoting.rmi.rmiclientinterceptor.getstub(rmiclientinterceptor.java:237) @ org.springframework.remoting.rmi.rmiclientinterceptor.invoke(rmiclientinterceptor.java:257) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:172) @ org.springframework.aop.framework.jdkdynamicaopproxy.invoke(jdkdynamicaopproxy.java:202) @ $proxy61.servicemethod(unknown source) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.springframework.util.reflectionutils.invokemethod(reflectionutils.java:191) @ package.client.main(client.java:47) caused by: java.rmi.connectexception: connection refused host: rmiservice.host; nested exception is: java.net.connectexception: connection refused @ sun.rmi.transport.tcp.tcpendpoint.newsocket(tcpendpoint.java:601) @ sun.rmi.transport.tcp.tcpchannel.createconnection(tcpchannel.java:198) @ sun.rmi.transport.tcp.tcpchannel.newconnection(tcpchannel.java:184) @ sun.rmi.server.unicastref.newcall(unicastref.java:322) @ sun.rmi.registry.registryimpl_stub.lookup(unknown source) @ java.rmi.naming.lookup(naming.java:84) @ org.springframework.remoting.rmi.rmiclientinterceptor.lookupstub(rmiclientinterceptor.java:200) ... 11 more caused by: java.net.connectexception: connection refused @ java.net.plainsocketimpl.socketconnect(native method) @ java.net.plainsocketimpl.doconnect(plainsocketimpl.java:351) @ java.net.plainsocketimpl.connecttoaddress(plainsocketimpl.java:213) @ java.net.plainsocketimpl.connect(plainsocketimpl.java:200) @ java.net.sockssocketimpl.connect(sockssocketimpl.java:366) @ java.net.socket.connect(socket.java:529) @ java.net.socket.connect(socket.java:478) @ java.net.socket.<init>(socket.java:375) @ java.net.socket.<init>(socket.java:189) @ sun.rmi.transport.proxy.rmidirectsocketfactory.createsocket(rmidirectsocketfactory.java:22) @ sun.rmi.transport.proxy.rmimastersocketfactory.createsocket(rmimastersocketfactory.java:128) @ sun.rmi.transport.tcp.tcpendpoint.newsocket(tcpendpoint.java:595) ... 17 more
which web server using ?
if apache tomcat, add catalina_opts
variable
-djava.rmi.server.hostname=10.0.34.11
in catalina.sh
file , export catalina_opts
variable.
Comments
Post a Comment