6 Replies Latest reply on Sep 22, 2010 4:52 PM by tobiashofmann

    GateIn 3.1 and WSRP

    tobiashofmann

      Anyone succeeded in consuming remote portlets in GateIn?

       

      I'm trying to consume portlets via WSRP. For producer and consumer I'm using GateIn 3.1.0. The connection between producer and consumer was done and activated. But I cannot consume a portlet deployed on the producer.

       

       

      I'm using the JBoss sample helloworld portlet from: http://www.jboss.org/portletswap/downloads/samples.html

       

      As suggested by the GatIn documentation: http://docs.jboss.com/gatein/portal/3.1.0-FINAL/reference-guide/en-US/html/wsrp.html I added the remotable part to: portlet.xml
      <container-runtime-option>
        <name>org.gatein.pc.remotable</name>
        <value>true</value>
      </container-runtime-option>

       

      and depolyed the WAR (GateIn-3.1.0-GA/server/default/deploy)
      -> WAR got deployed sucessfully.

       

      Refreshed the Application Registry on the prodcuer and I can use the helloworld portlet on the producer. After refreshing the application registry refresh on the consumer the portlet won't show up.

       

      I also added <container-runtime-option> to jboss-portlet.xml, but with the same result.

       

      How do I deploy a portlet so that it get's recognized as a remotable portlet?

       

      br,

      Tobias

        • 1. Re: GateIn 3.1 and WSRP
          claprun

          Is the consumer really activated? You need to refresh the consumer and make sure that it's active to be able to import remote portlets into the application registry.

          Do you get any kind of errors on the console?

          Note also that jboss-portlet.xml is completely useless in GateIn and can be removed.

          • 2. Re: GateIn 3.1 and WSRP
            tobiashofmann

            Hi Chris,

             

            I think the consumer is activated. I create the connection:

             

            On the producer:
            WSRP properties: all 3 checkboxes are activated

             

            On the consumer:
            Create a consumer named: gatein192 -> Create consumer
            Cache exp: 10000
            Producer WSDL URL: http://192.168.92.1:8080/wsrp-producer/MarkupService?wsdl
            -> Refresh and save

             

            The consumer is shown in green and as activated

             

            Log
            Producer: nothing shows up
            Consumer: WARN message like: Trying to resolve systemId as a non-file URL: http://producer/MarkupService?wsdl&resource=wsrp_v1_types.xsd

             

            INFO: Consumer with id gatein192 started
            INFO: Consumer with id gatein192 activated

             

            On the consumer, I go to Application registry -> import applications
            Remote portlet won`t show up under Remote

             

            WSRP configuration:
            Reload Consumers -> Refresh -> gatein192 shows up in green and as activated
            Refresh, Deactivate, Activate, Register, Deregister, always the same result: the portlet won`t show up on the consumer.

             

            The log of the producer shows nothing, the consumer only shows normal messages (registrated, etc)

             

            br,
            Tobias

            • 3. Re: GateIn 3.1 and WSRP
              claprun

              And you're sure that you've properly deployed remotable portlets on the producer?

              • 4. Re: GateIn 3.1 and WSRP
                tobiashofmann

                Hi Chris,

                 

                I deployed it as described in my first post (modified WAR -> portlet.xml and copied it to producer -> server\default\deploy and I can use the portlet in the producer).

                 

                The portlet.xml:

                 

                <?xml version="1.0" encoding="UTF-8"?>
                <portlet-app 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 /opt/SUNWps/dtd/portlet.xsd"
                             version="1.0">
                   <portlet>
                      <portlet-name>HelloWorldPortlet</portlet-name>
                      <portlet-class>org.jboss.portlet.hello.HelloWorldPortlet</portlet-class>
                      <supports>
                         <mime-type>text/html</mime-type>
                         <portlet-mode>VIEW</portlet-mode>
                      </supports>
                      <portlet-info>
                         <title>HelloWorld Portlet</title>
                      </portlet-info>
                    <container-runtime-option>
                         <name>org.gatein.pc.remotable</name>
                         <value>true</value>
                      </container-runtime-option>
                   </portlet>
                </portlet-app>

                 

                br,

                Tobias

                • 5. Re: GateIn 3.1 and WSRP
                  claprun

                  I think there should be errors on the console. container-runtime-option is only supported on JSR-286 compliant portlets and the version of the spec you're declaring in the portlet.xml file is version 1. Try updating the namespaces, schemas and version to the appropriate JSR 286 versions. That might be the problem.

                  • 6. Re: GateIn 3.1 and WSRP
                    tobiashofmann

                    Chris,

                     

                    you are right, changing the XML made the portlet remotable.

                    http://docs.jboss.com/gatein/portal/3.1.0-FINAL/reference-guide/en-US/html/wsrp.html

                    -> Example 7.1

                    <?xml version="1.0" standalone="yes"?>

                    didn't work. It gave me errors that the JAR file of the portlet wasn't there (IOException) I had to use:

                    <?xml version="1.0" encoding="UTF-8" ?>

                     

                    On the consumer, I can see new the portlet when doing an refresh of the application registry and can add to a category and to a page, but when accessing the page I get:

                    (Consumer): NoSuchPortletException: No such portlet /helloworldportlet.helloworldportlet.HelloWorldPortlet

                     

                    br,

                    Tobias