8 Replies Latest reply on May 1, 2008 5:19 AM by wlchung

    Problem when deploying portlet

    skeletonkey

      I'm deploying a Spring portlet mvc with Jboss Portal. My portlet is "preventions". However, while deploying, it has an error:"16:22:06,218 WARN [PortletAppDeployment] Failed to create instance PreventionsInstance of portlet /PreventionPortlet.preven
      tions because portlet /PreventionPortlet.preventions is not available".
      Can anyone tell me what's wrong?
      I think maybe my configuration has some problems.

        • 1. Re: Problem when deploying portlet
          peterj

          Because you did not post your portlet-instances.xml file and portlet.xml file, I can only guess, but I would say that in portlet-instances.xml you have:

          <instance>
           <instance-id>PreventionsInstance</instance-id>
           <portlet-ref>PreventionPortlet.preventions</portlet-ref>
          </instance>


          while in portal.xml you have:

          <portlet-name>PreventionPortlet</portlet-name>


          You should have instead:

          <instance>
           <instance-id>PreventionsInstance</instance-id>
           <portlet-ref>PreventionPortlet</portlet-ref>
          </instance>



          • 2. Re: Problem when deploying portlet
            skeletonkey

            I'm sorry, I forget posting the portlet-instances.xml and portlet.xml.
            Here is the portlet.xml

            <portlet>
             <portlet-name>preventions</portlet-name>
             <portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class>
             <init-param>
             <name>contextConfigLocation</name>
             <value>/WEB-INF/context/portlet/preventions.xml</value>
             </init-param>
             <supports>
             <mime-type>text/html</mime-type>
             <portlet-mode>view</portlet-mode>
             </supports>
             <portlet-info>
             <title>Preventions</title>
             </portlet-info>
             </portlet>

            and here is the portlet-instances.xml
            <deployments>
             <deployment>
             <instance>
             <instance-id>PreventionsInstance</instance-id>
             <portlet-ref>preventions</portlet-ref>
             </instance>
             </deployment>
            </deployments>

            and here is the jboss-portlet.xml:
            <portlet-app>
             <portlet>
             <portlet-name>preventions</portlet-name>
             <header-content>
             </header-content>
             </portlet>
            </portlet-app>

            and here is the springportlet-object.xml:
            <deployments>
             <deployment>
             <if-exists>overwrite</if-exists>
             <parent-ref>default</parent-ref>
             <page>
             <page-name>Preventions</page-name>
             <window>
             <window-name>PreventionsWindow</window-name>
             <instance-ref>PreventionsInstance</instance-ref>
             <region>left</region>
             <height>0</height>
             </window>
             </page>
             </deployment>
            </deployments>


            • 3. Re: Problem when deploying portlet
              peterj

              I used your files (well, I am not using Spring, so the portlet class name is different). It worked for me:

              2008-04-11 08:26:16,618 DEBUG [org.jboss.portal.core.deployment.jboss.PortletAppDeployment] Creating portlet instance PreventionsInstance
              2008-04-11 08:26:16,618 DEBUG [org.jboss.portal.core.impl.model.instance.InstanceContainerImpl] Creating instance PreventionsInstance of portlet local.image.preventions

              My portlet even shows up on the Preventions page.

              What version of the Portal? Version of JBossAS? JDK version?

              Also, have you included all of the necessary Spring jars in the WEB-INF/lib directory? Perhaps a class that DispatcherPortlet relies on is missing.

              • 4. Re: Problem when deploying portlet
                skeletonkey

                Can you give your yahoo messenger or skype id so that we can communicate? I really need your help.

                • 5. Re: Problem when deploying portlet
                  peterj

                  Sorry, I cannot give support over the phone or via private email, unless you have a support contract with my company.

                  • 6. Re: Problem when deploying portlet
                    ice_casa

                    I have a similar problem
                    i had take a change a IFrame portlet and create new class portlet simular a IFrame class
                    my portlet.xml file is

                     <portlet>
                     <portlet-name>SearchPortlet</portlet-name>
                     <portlet-class>org.jboss.portlet.iframe.SearchPortlet</portlet-class>
                     <supports>
                     <mime-type>text/html</mime-type>
                     <portlet-mode>VIEW</portlet-mode>
                     <portlet-mode>EDIT</portlet-mode>
                     </supports>
                     <portlet-info>
                     <title>Firewall Access Stats</title>
                     </portlet-info>
                     </portlet>
                    

                    my portlet-instances.xml
                    <deployments>
                     <deployment>
                     <if-exists>overwrite</if-exists>
                     <instance>
                     <instance-id>SearchPortletInstance</instance-id>
                     <portlet-ref>SearchPortlet</portlet-ref>
                     </instance>
                     </deployment>
                    </deployments>
                    




                    the same error :


                    Failed to create instance SearchPortletInstance of portlet Searchportlet.SearchPortlet because portlet Searchportlet.SearchPortlet is not available


                    • 7. Re: Problem when deploying portlet
                      ice_casa

                      a problem is resoved
                      i had upgrade my jde1.5 to jde1.6
                      and a compeliation fails

                      • 8. Re: Problem when deploying portlet
                        wlchung

                        I had similar error message last month. And I found that there was another error message before that:
                        ERROR [STDERR] [Fatal Error] jboss-app_2_6.dtd:1:3: The markup declarations contained or pointed to by the document type declaration must be well-formed.

                        So a temporary fix for me is to remove the <!DOCTYPE line. to skip the verification.