5 Replies Latest reply on Jul 4, 2005 5:24 PM by Viet

    Problems deploying sample portlets

    Shawn Hainsworth Newbie

      I have installed JBP 2.0 and it is working fine. However, I am having trouble deploying the sample portlet war files (helloworld and cardemo). If I put the war files in deploy, JBoss handles them typically, but the portal does not see them, and the page is not available. If I put the war files in deploy/jboss-portal.sar, the portal does not see them and they are not expanded into tmp. I have tried the following URLs in both cases:

      http://localhost:8080/portal/index.html?page=helloworld

      http://localhost:8080/portal/index.html?ctrl:id=page.default.helloworld

      The page name in helloworld-pages.xml is helloworld, not hello.

      If I put the expanded war file into deploy/jboss-portal.sar, then the page is visible under the page menu of the menu portlet, but the page does not display correctly. I have reviewed the logs and there are no error messages. I have reviewed all of the documentation and tried a number of permutations. I have also looked through the forum and found a posting about adding a leading / into to the helloworld page xml file. None of these solutions allow me to display the page as specified in the documentation. Exactly where does one put the war files containing portlets to deploy? How does the portal aggregate the various *-pages.xml files? Must the server be restarted when a new portlet war file is deployed in order for the portal to be able to handle the new portlet instances and pages? Must the war file be deployed expanded?

      Any help getting these samples to work would be greatly appreciated.

        • 1. Re: Problems deploying sample portlets
          Martin Giljohann Newbie

          This sounds like a similar problem I had. The correct url should be this one:

          "s_hainsworth@yahoo.com" wrote:
          http://localhost:8080/portal/index.html?ctrl:id=page.default.helloworld

          If you followed the Reference Manual, chap. 2.6 your helloworld-pages.xml looks about like this
          <pages>
           ...
           <page>
           <page-name>helloworld</page-name>
           <window>
           ...
           <instance-ref>helloworld.HelloWorldPortlet.HelloWorldPortletInstance</instance-ref>
           ....
           </window>
           </page>
          </pages>

          I think that the description of the <instance-ref> element in chap 2.6 is not correct, because I worked for me after I referred with helloworld to the jboss-app.xml (and not to jboss-portlet.xml).

          You could give it a try and simply make your jboss-app.xml like this
          <jboss-app>
           <app-name>helloworld</app-name>
          </jboss-app>


          • 2. Re: Problems deploying sample portlets
            Shawn Hainsworth Newbie

            I have it working now. No change needs to be made to the HelloWorld sample as downloaded The key is that the expanded WAR file must be deployed to deploy/jboss-portal.sar and the portal must be restarted.

            The correct URL is:
            http://localhost:8080/portal/index.html?ctrl:id=page.default.helloworld

            You will also see this page listed in the Page Menu.

            This is a fairly atypical deployment methodology, and it is not well documented. In other portals, WAR files can be deployed without expansion -- they are also deployed in a similar manner to other web apps, as opposed to being deployed into a portal sub-directory. Dynamic loading of deployed portlet apps would be a nice feature, one available in other portals. Until this feature is in place, the documentation should specify a portal restart when a new portlet app is deployed.

            • 3. Re: Problems deploying sample portlets
              Viet Master

              JBoss Portal handle dynamic redeployment of portlet web applications.

              • 4. Re: Problems deploying sample portlets
                Shawn Hainsworth Newbie

                Can you explain this a little more. In my experience, hot deploying classes/jsps into the expanded WAR directory does not work -- the server must be restarted for the modified classes to take effect. Also, since you cannot deploy a WAR file, you cannot replace the expanded WAR file when the server is running, since the server has locks on the files. For JBoss apps, the tmp directory is used for expanding WARs and avoiding locks when re-deploying a WAR file. This does not seem to be the case in JBoss portal. Please let me know if I am missing something.

                By the way, Julien, thanks for all your hard work. I think it is a great product and will be deploying JBoss Portal into production for two separate customers in the next 2-3 months.

                • 5. Re: Problems deploying sample portlets
                  Viet Master

                  you must touch the web deployment descriptor to achieve redeployment : WEB-INF/web.xml

                  jboss application server watches this URL to detect redeployment

                  great to hear that you go in production, we will release a 2.0.1 release in July to fix the bugs which have been fixed meanwhile. Also this release should offer a slide store implementation based on hibernate which simplifies deployment.