12 Replies Latest reply on Aug 14, 2009 7:01 AM by tomhombergs

    portlet doView is called multiple times

    igorroyzis

      This seems weird - or maybe I am just missing something - but doView is being called multiple times for the same request. I have several portal pages. Each page has only one portlet.

      My default page (HOME), has doView called 5 times for some reason. While all other pages have their portlet called 3 times.

      Weird!

      Did anyone have this issue before?

        • 1. Re: portlet doView is called multiple times
          peterj

          It must be something about your portlet or configuration. I just tried it with one of my portlets and doView is called only once, even if the portlet is on a page by itself.

          What version of JBoss Portal? What JVM? Could you post excerpts from the portlet-instances.xml and *-object.xml file, enough to identify the page, its portlet windows, and the corresponding instances.

          • 2. Re: portlet doView is called multiple times
            igorroyzis

            Peter, thanks for trying to help.

            I am using JBoss Portal 2.6.3GA bundled with AS 4.2.1

            [ServerInfo] Java version: 1.6.0_03,Sun Microsystems Inc.

            <deployments>
             <deployment>
             <instance>
             <instance-id>MyPortletInstance</instance-id>
             <portlet-ref>MyPortlet</portlet-ref>
             </instance>
             </deployment>
            </deployments>
            


            <deployments>
             <deployment>
             <if-exists>overwrite</if-exists>
             <parent-ref>default.default</parent-ref>
             <window>
             <window-name>MyPortletWindow</window-name>
             <instance-ref>MyPortletInstance</instance-ref>
             <region>center</region>
             <height>1</height>
             </window>
             </deployment>
            </deployments>
            



            • 3. Re: portlet doView is called multiple times
              peterj

              I was using Portal 2.6.4 on AS 4.2.2. So I tried again with Portal 2.6.3 on AS 4.2.1. Still seeing only one call to doView.

              You're using JDK 6. You like living dangerously. ;-) I was using JDK 5, tried with 6. Still only one call to doView.

              And your configuration files are not much different from mine.

              If I were you, what I would try next is adding this code at the start of the doView:

              Exception eee = new Exception("called doView");
              eee.printStackTrace();

              Then you can figure out where each of the calls to doView is coming from. That might give some insight as to why it is being called multiple times.

              • 4. Re: portlet doView is called multiple times
                jssteux

                We have exactly the same problem on JDK 1.5 / JBoss Portal 2.6.4. It concerns only the portlets which are positionned on the default page.

                • 5. Re: portlet doView is called multiple times
                  peterj

                  I placed my portlet on the default page of the default portal, and on the default page of a new portal, and saw only one call. I still think the best bet is to look at the stack trace.

                  • 6. Re: portlet doView is called multiple times
                    peterj

                    One more thought - what framework are you using for your portlet? Spring? Seam? JSF? Struts? My portlet was a simple hello portlet using only JSPs.

                    • 7. Re: portlet doView is called multiple times
                      igorroyzis

                      also simple jsp.

                      • 8. Re: portlet doView is called multiple times
                        igorroyzis

                        Jean, did you ever figure out what is causing the problem on your default page?

                        • 9. Re: portlet doView is called multiple times
                          mputz

                          Is this happening with the default theme/layout, or with a customized one?

                          I've seen multiple renderings with a modified jboss-portal.sar/portal-core.war/layouts/generic/index.jsp, which included the following:

                          - a *.js file with 'document.write(".......");' calls
                          - references to images where the URL starts with '/portal/content/....' (which is intercepted by the CMS stack)

                          • 10. Re: portlet doView is called multiple times

                            Have you ever found out what caused the multiple requests? I have the same problem: doView() is called 4 times although the portlet is only included one on the page.

                            What's more: i hacked into the LocaleInterceptor, which intercepts the HttpRequest and resets its locale-setting...it also gets called 4 times! JBoss Portal seems to make 4 requests out of one.

                            A different page containing the same portlets (and the same javascript) only gets called 1 time...I have no clue what triggers this behaviour.

                            • 11. Re: portlet doView is called multiple times

                              Found the reason for mutliple requests on http://www-01.ibm.com/support/docview.wss?uid=swg21242898.

                              Seems to be a general Portal issue and not JBoss-specific: if there is an -Tag on your page which links to a non-existing image, another page request is sent.

                              I found and corrected two such -Tags on my page and the number of requests was reduced by 2.

                              • 12. Re: portlet doView is called multiple times

                                read "img-Tag" instead of "-Tag"...the forum stripped the html markup