5 Replies Latest reply on Sep 25, 2012 6:43 AM by Sreenivas Reddy Kandula

    Why "No bridge set"?

    Billy Newbie

      when i try to access my portlet, error below appear.

      12:21:20,683 ERROR [StrutsPortlet] The portlet threw an exception
      java.lang.IllegalStateException: No bridge set
      at org.jboss.portal.bridge.JBossServletContextProvider.getServletContext(JBossServletContextProvider.java:65)
      at org.apache.portals.bridges.struts.StrutsPortlet.getServletContext(StrutsPortlet.java:202)



      ~ The portlet.xml~

      <portlet-app version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/portlet"
      xmlns="http://java.sun.com/xml/ns/portlet">

      <init-param>
      ServletContextProvider
      org.jboss.portal.bridge.JBossServletContextProvider
      </init-param>
      <init-param>
      ViewPage
      /loadmap.do
      </init-param>
      <portlet-name>StrutsGraphicalTrackingPorlet</portlet-name>
      <display-name>Struts Graphical Tracking Porlet</display-name>
      This is the struts based grahical application
      <portlet-class>org.apache.portals.bridges.struts.StrutsPortlet</portlet-class>
      <expiration-cache>-1</expiration-cache>

      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>

      <portlet-info>
      Struts Graphical Tracking Porlet
      <short-title>SGT short title</short-title>
      Struts
      </portlet-info>

      </portlet-app>

        • 1. Re: Why
          Billy Newbie

          i am using Struts 1.2.8 + JBoss Portal 2.2.1 SP2. I managed to compiled all source with no error. This error, "No bridge set", appear during accessing the portlet page.

          With above my portlet.xml, am i miss out anything important that cause this error?

          • 2. Re: Why
            hubertg Newbie

            I'm having the very same problem here.

            trying to get the servletcontext within my portlet.

            protected void doView(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException, UnavailableException
             {
            
             ServletContextProvider prov = new JBossServletContextProvider();
             HttpServletRequest hreq = prov.getHttpServletRequest(this, rRequest);
            ...
            }
            


            im getting this error:

            08:52:14,001 ERROR [ContentPortlet] The portlet threw an exception
            java.lang.IllegalStateException: No bridge set
             at org.jboss.portal.bridge.JBossServletContextProvider.getServletContext(JBossServletContextProvider.java:66)
             at at.jku.kusss.portlet.main.ContentPortlet.doView(Unknown Source)
             at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:167)
             at javax.portlet.GenericPortlet.render(GenericPortlet.java:407)
             at org.jboss.portal.portlet.container.PortletContainer.invokeRender(PortletContainer.java:561)
             at org.jboss.portal.portlet.container.PortletContainer.dispatch(PortletContainer.java:482)
             at org.jboss.portal.portlet.container.PortletContainerInvoker$1.dispatch(PortletContainerInvoker.java:138)
             at org.jboss.portal.portlet.invocation.PortletInvocation.dispatch(PortletInvocation.java:242)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:140)
             at org.jboss.portal.core.aspects.component.TransactionInterceptor.invoke(TransactionInterceptor.java:69)
             at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
             at org.jboss.portal.core.aspects.component.HeaderInterceptor.invoke(HeaderInterceptor.java:50)
             at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
             at org.jboss.portal.portlet.aspects.component.CacheInterceptor.invoke(CacheInterceptor.java:165)
             at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
             at org.jboss.portal.portlet.aspects.component.ModesInterceptor.invoke(ModesInterceptor.java:62)
             at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
             at org.jboss.portal.portlet.aspects.component.WindowStatesInterceptor.invoke(WindowStatesInterceptor.java:55)
             at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
             at org.jboss.portal.portlet.aspects.component.SessionPostDispatchInterceptor.invoke(SessionPostDispatchInterceptor.java:63)
             at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
             at org.jboss.portal.portlet.aspects.component.ContextDispatcherInterceptor$InvokeNextCommand.execute(ContextDispatcherInterceptor.java:124)
             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:585)
             at org.jboss.portal.server.servlet.CommandServlet.doGet(CommandServlet.java:104)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
             at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:539)
             at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
             at org.jboss.portal.portlet.impl.spi.AbstractRequestContext.include(AbstractRequestContext.java:196)
             at org.jboss.portal.portlet.aspects.component.ContextDispatcherInterceptor$1.include(ContextDispatcherInterceptor.java:68)
             at org.jboss.portal.server.servlet.CommandServlet.include(CommandServlet.java:84)
             at org.jboss.portal.portlet.aspects.component.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:74)
             at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
             at org.jboss.portal.portlet.aspects.component.SessionPreDispatchInterceptor.invoke(SessionPreDispatchInterceptor.java:108)
             at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
             at org.jboss.portal.portlet.aspects.component.ContextTrackerInterceptor.invoke(ContextTrackerInterceptor.java:50)
             at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
             at org.jboss.portal.portlet.aspects.component.SecureTransportInterceptor.invoke(SecureTransportInterceptor.java:65)
             at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
             at org.jboss.portal.portlet.aspects.component.ValveInterceptor.invoke(ValveInterceptor.java:60)
             at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
             at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:171)
             at org.jboss.portal.portlet.container.PortletContainerInvoker.invoke(PortletContainerInvoker.java:109)
             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:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy59.invoke(Unknown Source)
             at org.jboss.portal.portlet.state.producer.StatefulPortletInvoker.invoke(StatefulPortletInvoker.java:181)
             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:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy61.invoke(Unknown Source)
             at org.jboss.portal.federation.impl.FederatedPortletInvokerService.invoke(FederatedPortletInvokerService.java:134)
             at org.jboss.portal.federation.impl.FederatingPortletInvokerService.invoke(FederatingPortletInvokerService.java:159)
             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:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy57.invoke(Unknown Source)
             at org.jboss.portal.portlet.test.TestPortletInvoker$1.dispatch(TestPortletInvoker.java:61)
             at org.jboss.portal.portlet.invocation.PortletInvocation.dispatch(PortletInvocation.java:242)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:140)
             at org.jboss.portal.core.model.instance.InstanceSecurityInterceptor.invoke(InstanceSecurityInterceptor.java:82)
             at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
             at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:171)
             at org.jboss.portal.portlet.test.TestPortletInvoker.invoke(TestPortletInvoker.java:125)
             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:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy46.invoke(Unknown Source)
             at org.jboss.portal.core.impl.model.instance.InstanceImpl.invoke(InstanceImpl.java:266)
             at org.jboss.portal.core.command.RenderWindowCommand.execute(RenderWindowCommand.java:121)
             at org.jboss.portal.core.command.ControllerCommand.dispatch(ControllerCommand.java:91)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:140)
             at org.jboss.portal.core.aspects.controller.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:85)
             at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
             at org.jboss.portal.core.aspects.controller.PageNavigationInterceptor.invoke(PageNavigationInterceptor.java:80)
             at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
            (...)
            


            any help is appreciated very much!

            br,
            hubert

            • 3. Re: Why - small correction
              hubertg Newbie

              oops, wrong stacktrace, the one above was for prov.getServletContext(portlet), basically it should make no difference, any call to the JBossServletContextProvider ends up in the "no bridge set" exception.

              ok, this is the right stacktrace:

              09:19:13,817 ERROR [ContentPortlet] The portlet threw an exception
              java.lang.IllegalStateException: No bridge set
               at org.jboss.portal.bridge.JBossServletContextProvider.getHttpServletRequest(JBossServletContextProvider.java:79)
               at at.jku.kusss.portlet.main.ContentPortlet.doView(Unknown Source)
               at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:167)
               at javax.portlet.GenericPortlet.render(GenericPortlet.java:407)
               at org.jboss.portal.portlet.container.PortletContainer.invokeRender(PortletContainer.java:561)
               at org.jboss.portal.portlet.container.PortletContainer.dispatch(PortletContainer.java:482)
              (...)
              


              • 4. Re: Why - solution
                hubertg Newbie

                hi,
                i found a solution for this problem:

                as of cvs version 1.89 of /portal-core-sar/META-INF/jboss-service.xml the bridge interceptor has been switched off temporarily.

                my solution:
                i added the following in line 281 (after SessionPostDispatch) to the file jboss-service.xml

                <depends-list-element>portal:service=Interceptor,type=Portlet,name=Bridge</depends-list-element>
                


                restart jboss, then it works. of course I do not know why the Bridge interceptor has been deactivaed, maybe there exist good reasons for doing this?

                now i have additional questions:

                as said, I use the following code to get the servletRequest
                JBossServletContextProvider prov = new JBossServletContextProvider();
                HttpServletRequest hreq = prov.getHttpServletRequest(this, rRequest);
                


                imho the returned HttpServletRequest should behave like a standard servlet's HttpServletRequest, but it doesn't! eg: getParameter never returns any parameter values, there are simply no parameters at all; also hreq.getServletPath() returns null.

                is this normal behaviour? is there a documentation about what to except when using the JBossServletContextProvider's HttpServletRequest?

                thank you very much for any answers!
                r
                hubert

                • 5. Re: Why - solution
                  Sreenivas Reddy Kandula Newbie

                  Hi hubertg

                   

                                  I am also got same error and i am using JBoss 5.2 GA server and Struts 1.2. as per your response how to define interceptors in jboss-service.xml for struts bridge. I need to define this xml file for app or i have to change the xml file which is in JBoss server, please let me know.