9 Replies Latest reply on Jun 21, 2009 11:18 PM by uxa

    Why JSF portlet show null

      I am a newbie, I deployment the JSFHelloUser to JBoss portal 2.7.2.
      But I get the JSF Hello User Portlet window show null to me.
      Is anywhere problem.

      environment:

      JBoss Portal 2.7.2
      JBoss 4.2.3GA

        • 1. Re: Why JSF portlet show null
          wesleyhales

          Post your config files, It sounds like your portlet.xml view-param JSF file is wrong.

          • 2. Re: Why JSF portlet show null

            sorry, this question is solved, thanks

            another question is why I deployment portlet, but portlet instance didn't created, I must using admin to create one.

            portlet-instance.xml



            <instance-id>SimplestHelloWorldInstance</instance-id>
            <portlet-ref>SimplestHelloWorld</portlet-ref>




            Is anywhere wrong?

            • 3. Re: Why JSF portlet show null
              jpviragine

              Hi uxa,

              Have you created the default-object.xml or something-object.xml?

              In your case, the content of the file should be something like:

              <deployments>
               <deployment>
               <parent-ref>default</parent-ref>
               <if-exists>overwrite</if-exists>
               <page>
               <page-name>SimplestHelloWorld</page-name>
               <display-name>SimplestHelloWorld</display-name>
               <window>
               <window-name>SimplestHelloWorldWindow</window-name>
               <instance-ref>SimplestHelloWorldInstance</instance-ref>
               <region>center</region>
               <height>0</height>
               </window>
               </page>
               </deployment>
              </deployments>


              Cheers,
              JP

              • 4. Re: Why JSF portlet show null

                Thanks jpviragine

                yes, I have the default-object.xml, but I need using admin mode to create the portlet instance for my portlet object.

                What I need to do, if I deploy portlet and I want it instance be created.

                • 5. Re: Why JSF portlet show null
                  jpviragine

                  Uxa,

                  As you said that you have created portlet-instances.xml and default-object.xml. I think the problem is in your portlet.xml.

                  Please, take a look at: http://www.redhat.com/docs/en-US/Enterprise_Portal_Platform/4.3/html/Reference_Guide/descriptors_portlet.html for a correct usage of the three files.

                  • 6. Re: Why JSF portlet show null

                    my three files is

                    portlet.xml

                    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
                    <portlet-app version="1.0"
                     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"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
                    
                     <portlet>
                     <portlet-name>SimplestHelloWorld</portlet-name>
                     <portlet-class>
                     com.king.SimplestHelloWorldPortlet
                     </portlet-class>
                     <supports>
                     <mime-type>text/html</mime-type>
                     </supports>
                     <portlet-info>
                     <title>Simplest Hello World Portlet</title>
                     </portlet-info>
                     </portlet>
                    </portlet-app>
                    


                    portlet-instance.xml
                    <?xml version="1.0" standalone="yes"?>
                    <!DOCTYPE deployments PUBLIC
                    "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
                    "http://www.jboss.org/portlet/dtd/portlet-instances_2_6.dtd">
                    <deployments>
                     <deployment>
                     <instance>
                     <instance-id>SimplestHelloWorldInstance</instance-id>
                     <portlet-ref>SimplestHelloWorld</portlet-ref>
                     </instance>
                     </deployment>
                    </deployments>
                    


                    default-object.xml
                    <?xml version="1.0" encoding="UTF-8"?>
                    <!DOCTYPE deployments PUBLIC
                    "-//JBoss Portal//DTD Portal Object 2.6//EN"
                    "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
                    <deployments>
                     <deployment>
                     <parent-ref>default</parent-ref>
                     <if-exists>overwrite</if-exists>
                     <page>
                     <page-name>SimplestHelloWorld</page-name>
                     <window>
                     <window-name>SimplestHelloWorldWindow</window-name>
                     <content>
                     <content-type>portlet</content-type>
                     <content-uri>
                     SimplestHelloWorldInstance
                     </content-uri>
                     </content>
                     <region>center</region>
                     <height>0</height>
                     </window>
                     </page>
                     </deployment>
                    </deployments>
                    


                    when I depoly, I can't see portlet instance be created.
                    my file structure is

                    SimpleHelloWorld
                    --MEAT-INF
                    --WEB-INF
                    --classes
                    --com
                    --king
                    --SimplestHelloWorldPortlet.class
                    --css
                    --images
                    --lib
                    --default-object.xml
                    --jboss-app.xml
                    --portlet-instance.xml
                    --portlet.xml
                    --web.xml


                    Is anywhere wrong?

                    • 7. Re: Why JSF portlet show null

                      my three files is

                      portlet.xml

                      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
                      <portlet-app version="1.0"
                       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"
                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                       xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
                      
                       <portlet>
                       <portlet-name>SimplestHelloWorld</portlet-name>
                       <portlet-class>
                       com.king.SimplestHelloWorldPortlet
                       </portlet-class>
                       <supports>
                       <mime-type>text/html</mime-type>
                       </supports>
                       <portlet-info>
                       <title>Simplest Hello World Portlet</title>
                       </portlet-info>
                       </portlet>
                      </portlet-app>
                      


                      portlet-instance.xml
                      <?xml version="1.0" standalone="yes"?>
                      <!DOCTYPE deployments PUBLIC
                      "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
                      "http://www.jboss.org/portlet/dtd/portlet-instances_2_6.dtd">
                      <deployments>
                       <deployment>
                       <instance>
                       <instance-id>SimplestHelloWorldInstance</instance-id>
                       <portlet-ref>SimplestHelloWorld</portlet-ref>
                       </instance>
                       </deployment>
                      </deployments>
                      


                      default-object.xml
                      <?xml version="1.0" encoding="UTF-8"?>
                      <!DOCTYPE deployments PUBLIC
                      "-//JBoss Portal//DTD Portal Object 2.6//EN"
                      "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
                      <deployments>
                       <deployment>
                       <parent-ref>default</parent-ref>
                       <if-exists>overwrite</if-exists>
                       <page>
                       <page-name>SimplestHelloWorld</page-name>
                       <window>
                       <window-name>SimplestHelloWorldWindow</window-name>
                       <content>
                       <content-type>portlet</content-type>
                       <content-uri>
                       SimplestHelloWorldInstance
                       </content-uri>
                       </content>
                       <region>center</region>
                       <height>0</height>
                       </window>
                       </page>
                       </deployment>
                      </deployments>
                      


                      when I depoly, I can't see portlet instance be created.
                      my file structure is

                      SimpleHelloWorld
                      --MEAT-INF
                      --WEB-INF
                       --classes
                       --com
                       --king
                       --SimplestHelloWorldPortlet.class
                       --css
                       --images
                       --lib
                       --default-object.xml
                       --jboss-app.xml
                       --portlet-instance.xml
                       --portlet.xml
                       --web.xml
                      
                      
                      Is anywhere wrong?
                      


                      • 8. Re: Why JSF portlet show null
                        jpviragine

                        uxa,

                        Change your default-object.xml to:

                        <?xml version="1.0" encoding="UTF-8"?>
                        <!DOCTYPE deployments PUBLIC
                        "-//JBoss Portal//DTD Portal Object 2.6//EN"
                        "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
                        <deployments>
                         <deployment>
                         <parent-ref>default</parent-ref>
                         <if-exists>overwrite</if-exists>
                         <page>
                         <page-name>SimplestHelloWorld</page-name>
                         <window>
                         <window-name>SimplestHelloWorldWindow</window-name>
                         <instance-ref>SimplestHelloWorldInstance</instance-ref>
                         <region>center</region>
                         <height>0</height>
                         </window>
                         </page>
                         </deployment>
                        </deployments>



                        • 9. Re: Why JSF portlet show null

                          I try to use

                          <content>
                           <content-type>portlet</content-type>
                           <content-uri>
                           SimplestHelloWorldInstance
                           </content-uri>
                           </content>
                          


                          or

                          <instance-ref>SimplestHelloWorldInstance</instance-ref>
                          


                          the result is the same