4 Replies Latest reply: Mar 16, 2012 1:34 AM by Ryan Jimmy RSS

    Does JBossSerialization support HttpServlet Request & Repons

    Mark Bobsin Newbie

      I have worked late last year on a project to "offload" web browser and system capabilities detection to a separate EJB. On the same local machine as my JSP running (Tomcat, Jasper) it worked fine since running within the same JVM. I am passing both the HttpServletRequest and HttpServletReponse objects and updating the Reponse object to be passed back. When in the same JVM remote calls are treated as local and objects passed by reference rather than value so it works.

      When tested calling from JSP on a separate machine (thus different JVM) I got an error that the HttpServlet objects were not serialization and sort of put to bed at that point.

      Is this now supported with new JBossSerialization or anyone have alternative suggestions?

      Thanks,

        • 1. Re: Does JBossSerialization support HttpServlet Request & Re
          Clebert Suconic Master

          We don't support that on JBossSerialization.


          You could though parse an embebed request using any serialization though. I don't remember what classes you could use to parse that, but that goes beyond any kind of serialization.

          • 2. Re: Does JBossSerialization support HttpServlet Request & Re
            Mark Bobsin Newbie

            Clebert,

            Thanks for your response. I was wondering if you could please explain more and if possible provide an example. I am fairly new to Java (really working on Peoplesoft) and don't understand what you mean by parsing an embedded request.

            Kind regards,
            Mark Bobsin
            bobsinm@hotmail.com

            • 3. Re: Does JBossSerialization support HttpServlet Request & Re
              Clebert Suconic Master

              Have you ever seen how binary files are attached to a e-mail?

              They are basically converted to text parsed into something like "ABCD3982FCDD...."

              I know there is a package out there somewhere that does that.

              I don't have a code example though.. that would require some research on my side. I guess you would find something under java-mail but it would be a whole lot of hack for that.


              I guess also there is some apache package that does that. but I don't know!

              • 4. Re: Does JBossSerialization support HttpServlet Request & Repons
                Ryan Jimmy Newbie

                Hello mark,

                 

                I am getting the following exception while trying to forward  my page.

                 

                10:47:08,887 WARNING [lifecycle] #{loginBean.doLogin}: javax.context.ContextNotActiveException: No active contexts for scope type javax.context.RequestScoped

                javax.faces.FacesException: #{loginBean.doLogin}: javax.context.ContextNotActiveException: No active contexts for scope type javax.context.RequestScoped

                    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)

                    at org.springframework.faces.webflow.FlowActionListener.processAction(FlowActionListener.java:71)

                    at org.springframework.faces.model.SelectionTrackingActionListener.processAction(SelectionTrackingActionListener.java:55)

                    at javax.faces.component.UICommand.broadcast(UICommand.java:315)

                    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)

                    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)

                    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)

                    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

                    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

                    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at org.jboss.webbeans.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:113)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:369)

                    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)

                    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)

                    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)

                    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)

                    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)

                    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)

                    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)

                    at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)

                    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)

                    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)

                    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)

                    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:168)

                    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

                    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

                    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

                    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

                    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

                 

                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

                    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

                    at java.lang.Thread.run(Thread.java:619)

                Caused by: javax.faces.el.EvaluationException: javax.context.ContextNotActiveException: No active contexts for scope type javax.context.RequestScoped

                    at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)

                    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

                    ... 59 more

                Caused by: javax.context.ContextNotActiveException: No active contexts for scope type javax.context.RequestScoped

                    at org.jboss.webbeans.ManagerImpl.getContext(ManagerImpl.java:739)

                    at org.jboss.webbeans.bean.proxy.ClientProxyMethodHandler.getProxiedInstance(ClientProxyMethodHandler.java:116)

                    at org.jboss.webbeans.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:96)

                    at org.jboss.webbeans.conversation.ConversationImpl_$$_javassist_2.isLongRunning(ConversationImpl_$$_javassist_2.java)

                    at org.jboss.webbeans.servlet.ConversationPropagationFilter$1.sendRedirect(ConversationPropagationFilter.java:124)

                    at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:126)

                    at org.springframework.security.web.firewall.FirewalledResponse.sendRedirect(FirewalledResponse.java:25)

                    at com.coco.dwhsportal.web.security.LoginSuccessHandler.onAuthenticationSuccess(LoginSuccessHandler.java:36)

                    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.successfulAuthentication(AbstractAuthenticationProcessingFilter.java:301)

                    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:218)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)

                    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)

                    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:57)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)

                    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:168)

                    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)

                    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444)

                    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)

                    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310)

                    at com.coco.dwhsportal.web.bean.LoginBean.doLogin(LoginBean.java:67)

                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                    at java.lang.reflect.Method.invoke(Method.java:597)

                    at org.apache.el.parser.AstValue.invoke(AstValue.java:170)

                    at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)

                    at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)

                    at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

                   

                Please help.