aspose file tools*
The moose likes Spring and the fly likes Rmi in JSF giving connect problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Rmi in JSF giving connect problem" Watch "Rmi in JSF giving connect problem" New topic
Author

Rmi in JSF giving connect problem

Akshay Pathak
Greenhorn

Joined: Jan 02, 2012
Posts: 1
Hi,

I am currently trying to implement RMI in a already existing JSF project. Idea is to have two independent application where one of them exposes it MBeans through RMI (as server) and JSF application (client) will connect via RMI and display the Mbeans values. It works absolutely fine initially, but the problem occurs when the user of JSF application tries to logout and login its session, client is not able to connect back to the same RMI connection, and throws exceptions,until the client (JSF app) has to be restarted again. Note that nowhere server is restarted in between. Also calls to the classes are made with scope - 'request' which i think makes it independent of user login-logout session problem.

Below is the implementation of spring on both server and client side:

Server:



Client:



Here is the exception log generated:

Lookup of RMI stub failed; nested exception is java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.io.IOException: HTTP request failed
org.springframework.remoting.RemoteLookupFailureEx ception: Lookup of RMI stub failed; nested exception is java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.io.IOException: HTTP request failed
at org.springframework.remoting.rmi.RmiClientIntercep tor.lookupStub(RmiClientInterceptor.java:214)
at org.springframework.remoting.rmi.RmiClientIntercep tor.getStub(RmiClientInterceptor.java:231)
at org.springframework.remoting.rmi.RmiClientIntercep tor.invoke(RmiClientInterceptor.java:256)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy64.getCoreIncidentLastUpdate(Unknown Source)
at com.package.subpackage.getSomeVaue(myAppJMX.java:2 67)
at sun.reflect.GeneratedMethodAccessor245.invoke(Unkn own Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.el.BeanELResolver.getValue(BeanELResolver.ja va:62)
at javax.el.CompositeELResolver.getValue(CompositeELR esolver.java:53)
at com.sun.faces.el.FacesCompositeELResolver.getValue (FacesCompositeELResolver.java:64)
at org.apache.el.parser.AstValue.getValue(AstValue.ja va:97)
at org.apache.el.parser.AstDeferredExpression.getValu e(AstDeferredExpression.java:26)
at org.apache.el.parser.AstCompositeExpression.getVal ue(AstCompositeExpression.java:31)
at org.apache.el.ValueExpressionImpl.getValue(ValueEx pressionImpl.java:186)
at com.sun.facelets.el.TagValueExpression.getValue(Ta gValueExpression.java:71)
at javax.faces.component.UIOutput.getValue(UIOutput.j ava:173)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputR enderer.getValue(HtmlBasicInputRenderer.java:189)
at com.sun.faces.renderkit.html_basic.HtmlBasicRender er.getCurrentValue(HtmlBasicRenderer.java:320)
at com.sun.faces.renderkit.html_basic.HtmlBasicRender er.encodeEnd(HtmlBasicRenderer.java:200)
at javax.faces.component.UIComponentBase.encodeEnd(UI ComponentBase.java:833)
at org.apache.myfaces.trinidad.component.UIXComponent Base.__encodeRecursive(UIXComponentBase.java:1262)
at org.apache.myfaces.trinidad.component.UIXComponent Base.__encodeRecursive(UIXComponentBase.java:1257)
at org.apache.myfaces.trinidad.component.UIXComponent Base.__encodeRecursive(UIXComponentBase.java:1257)
at org.apache.myfaces.trinidad.component.UIXComponent Base.encodeAll(UIXComponentBase.java:713)
at javax.faces.component.UIComponent.encodeAll(UIComp onent.java:892)
at com.sun.facelets.FaceletViewHandler.renderView(Fac eletViewHandler.java:571)
at org.apache.myfaces.trinidadinternal.application.Vi ewHandlerImpl.renderView(ViewHandlerImpl.java:182)
at com.sun.faces.lifecycle.RenderResponsePhase.execut e(RenderResponsePhase.java:106)
at com.sun.faces.lifecycle.LifecycleImpl.phase(Lifecy cleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.render(Lifec ycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServl et.java:245)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at com.package.subpackage.myEncoding.doFilter(myEncod ing.java:23)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.apache.myfaces.webapp.filter.ExtensionsFilter. doFilter(ExtensionsFilter.java:301)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at com.package.subpackage.mySessionTimeOutNotifier.do Filter(mySessionTimeOutNotifier.java:84)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF ilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.io.IOException: HTTP request failed
at sun.rmi.transport.StreamRemoteCall.executeCall(Str eamRemoteCall.java:209)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:3 59)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at org.springframework.remoting.rmi.RmiClientIntercep tor.lookupStub(RmiClientInterceptor.java:199)
... 60 more
Caused by: java.io.IOException: HTTP request failed
at sun.rmi.transport.proxy.HttpSendSocket.readNotify( HttpSendSocket.java:159)
at sun.rmi.transport.proxy.HttpSendInputStream.read(H ttpSendInputStream.java:66)
at java.io.BufferedInputStream.fill(BufferedInputStre am.java:218)
at java.io.BufferedInputStream.read(BufferedInputStre am.java:237)
at java.io.DataInputStream.readByte(DataInputStream.j ava:248)
at sun.rmi.transport.StreamRemoteCall.executeCall(Str eamRemoteCall.java:195)
... 64 more


I am a newbie in this, can anybody help me please what am i doing wrong here??

Thanks!!!
- Akshay
 
jQuery in Action, 2nd edition
 
subject: Rmi in JSF giving connect problem
 
Similar Threads
Bypass login form on a Spring application
Spring RMI Remoting Maven Build ClassCast Execption
Trinidad components - first time user
h:selectOneMenu PROBLEM
SocketTimeoutException, ConnectIOException: Read timed out