3 Replies Latest reply on Oct 8, 2008 2:10 PM by peterj

    Porlet Tutorial WebWork 2.2

    bsisson

      I created the portlet using Eclipse that was specified in Portlet Tutorial WebWork 2.2. I zipped up the directories into a war file and dropped them into the deploy directory within my jboss-portal-2.6.6.GA server. I then get the following message indicating that the deployment failed. I already deployed a portlet using the QuickStart Guide for the server with no issue and the formats look similar. I would apprecicate any help.

      10:48:32,899 WARN [PortletAppDeployment] Failed to create instance MyPortletIns
      tance of portlet MyPortlet.MyPortlet because portlet MyPortlet.MyPortlet is not
      available

      Thanks...

        • 1. Re: Porlet Tutorial WebWork 2.2
          peterj

          Please post the contents of portlet.xml, porlte-instances.xml and *-object.xml (all are in the WEB-INF directory of the WAR).

          Remember to enclose your XML text in UBBCode "code" tags - you can do this by selecting the XML text and clicking the Code button above the editor window. Also, click the Preview button to ensure that the formatting is correct and the XML text shows up before posting.

          • 2. Re: Porlet Tutorial WebWork 2.2
            bsisson

            I have included the code for portlet.xml and MyPortlet-object.xml. However, there is no portlet-instances.xml code in this tutorial or I'm not sure which file it would be in. The other xml files that exist under WEB-INF are jboss-app.xml, jboss-portlet.xml, and web.xml.

            The tutorial is located at the following site: http://struts.apache.org/2.0.11/docs/portlet-tutorial-webwork-22.html

            portlet.xml

            <portlet-app version="1.0" xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
             <portlet>
             <description xml:lang="EN">My very first WebWork Portlet</description>
             <portlet-name>MyPortlet</portlet-name>
             <display-name xml:lang="EN">My first WebWork Portlet</display-name>
            
             <portlet-class>com.opensymphony.webwork.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
            
             <init-param>
             <!-- The view mode namespace. Maps to a namespace in the xwork config file -->
             <name>viewNamespace</name>
             <value>/view</value>
             </init-param>
             <init-param>
             <!-- The default action to invoke in view mode -->
             <name>defaultViewAction</name>
             <value>index</value>
             </init-param>
            
             <expiration-cache>0</expiration-cache>
            
             <supports>
             <mime-type>text/html</mime-type>
             </supports>
            
             <supported-locale>en</supported-locale>
            
             <portlet-info>
             <title>My very own WebWork Portlet</title>
             <short-title>WWPortlet</short-title>
             <keywords>webwork,portlet</keywords>
             </portlet-info>
             </portlet>
            </portlet-app>


            MyPortlet-object.xml

            <?xml version="1.0" encoding="UTF-8"?>
            <deployments>
             <deployment>
             <if-exists>overwrite</if-exists>
             <parent-ref>default</parent-ref>
             <properties />
             <page>
             <page-name>MyPortlet Tutorial</page-name>
             <properties />
             <window>
             <window-name>MyPortletWindow</window-name>
             <instance-ref>MyPortletInstance</instance-ref>
             <region>center</region>
             <height>0</height>
             </window>
             </page>
             </deployment>
             <deployment>
             <if-exists>overwrite</if-exists>
             <instance>
             <instance-name>MyPortletInstance</instance-name>
             <component-ref>MyPortlet.MyPortlet</component-ref>
             </instance>
             </deployment>
            </deployments>


            • 3. Re: Porlet Tutorial WebWork 2.2
              peterj

              You need to create a portlet-instanxes.xml file and move the 'instance' entry from MyPortlet-object.xml to there. Thus portlet-instances.xml should contain:

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


              and MyPortlet-object.xml should contain:

              <deployments>
               <deployment>
               <if-exists>overwrite</if-exists>
               <parent-ref>default</parent-ref>
               <properties />
               <page>
               <page-name>MyPortlet Tutorial</page-name>
               <properties />
               <window>
               <window-name>MyPortletWindow</window-name>
               <instance-ref>MyPortletInstance</instance-ref>
               <region>center</region>
               <height>0</height>
               </window>
               </page>
               </deployment>
              </deployments>