14 Replies Latest reply on Apr 23, 2007 8:07 AM by Alex Mateescu

    Upgrade from Seam 1.1 to 1.2.1

    Alex Mateescu Newbie

      I'm trying to migrate an application from Seam 1.1 to 1.2.1GA. The problem is I cannot make Seam Remoting to work. My app is packaged as an EAR with multiple WARs and JARs inside (basically some portlets built on top of some services/EJBs). I followed the Seam documentation and made the changes to the components.xml files, but at deploy time I get an exception saying that the name org.jboss.seam.remoting.messaging.subscriptionRegistry exists twice with the same precedence. If I remove the reference to the said class from the JARs, I can deploy the application, but after I log in, I get another error, saying there is no subscription registry.

      I'm almost sure it's a configuration problem, but I can't pinpoint it. Anybody has any idea?

        • 1. Re: Upgrade from Seam 1.1 to 1.2.1
          Shane Bryzak Master

          Make sure that jboss-app.xml has a unique classloader name for your application. If that doesn't fix it, please post your packaging structure.

          • 2. Re: Upgrade from Seam 1.1 to 1.2.1
            Alex Mateescu Newbie

            That didn't fix it.

            Here goes:

            EAR's jboss-app.xml:

            <jboss-app>
             <security-domain>....</security-domain>
             <loader-repository>
             seam.jboss.org:loader=loader-emp
             </loader-repository>
            </jboss-app>


            component.xml in each JAR's META-INF contains:
            <components>
             <component class="org.jboss.seam.remoting.messaging.SubscriptionRegistry" install="true">
             <property name="allowedTopics">clientNotificationTopic</property>
             </component>
            </components>
            

            component.xml in each WAR's WEB-INF file contains:
            <components>
             <component class="org.jboss.seam.remoting.messaging.SubscriptionRegistry" install="true">
             <property name="allowedTopics">clientNotificationTopic</property>
             </component>
            </components>


            The Seam Resource Servlet declaration is included in each web.xml, as specified in the Seam Remoting doc.


            • 3. Re: Upgrade from Seam 1.1 to 1.2.1
              Alex Mateescu Newbie

              There are no class loades defined in any jboss-web.xml either.

              • 5. Re: Upgrade from Seam 1.1 to 1.2.1
                Shane Bryzak Master

                 

                "m.alex" wrote:

                component.xml in each JAR's META-INF contains:
                <components>
                 <component class="org.jboss.seam.remoting.messaging.SubscriptionRegistry" install="true">
                 <property name="allowedTopics">clientNotificationTopic</property>
                 </component>
                </components>
                



                So you have multiple jar files in your application with the same components.xml? That's the problem there, you're trying to create the SubscriptionRegistry twice. You only need one SubscriptionRegistry, so either remove it from all but one of your components.xml files, or remove all but one of the components.xml files.

                • 6. Re: Upgrade from Seam 1.1 to 1.2.1
                  Alex Mateescu Newbie

                  I'm going to test that, but I had no problem deploying multiple jars with that components.xml included. It's only whan I have both jars and wars when problems start to appear. The same setup was working fine with Seam 1.1 and the documentation doesn't seem to indicate anything was changed with regard to deploying...

                  • 7. Re: Upgrade from Seam 1.1 to 1.2.1
                    Pete Muir Master

                    No, but there was a change which prevented you trying to deploy the same component twice ;)

                    • 8. Re: Upgrade from Seam 1.1 to 1.2.1
                      Alex Mateescu Newbie

                      Ok, here goes.

                      I tried as advised (using this in a single components.xml):

                      <components>
                       <component class="org.jboss.seam.remoting.messaging.SubscriptionRegistry" install="true">
                       <property name="allowedTopics">clientNotificationTopic, inventoryNotifications</property>
                       </component>
                      </components>


                      and I got an error at deploy time:

                      2007-04-19 13:33:51,439 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/emp-filter]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
                      java.lang.RuntimeException: Could not create Component: org.jboss.seam.remoting.messaging.subscriptionRegistry
                       at org.jboss.seam.init.Initialization.addComponent(Initialization.java:865)
                       at org.jboss.seam.init.Initialization.installComponents(Initialization.java:796)
                       at org.jboss.seam.init.Initialization.init(Initialization.java:503)
                       at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
                       at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
                      ...


                      When using this in a single components.xml:
                      <components>
                       <component name="org.jboss.seam.remoting.messaging.subscriptionRegistry">
                       <property name="allowedTopics">clientNotificationTopic, inventoryNotifications</property>
                       </component>
                      </components>


                      I can deploy without error, but when I try to actually use remoting, I get:

                      13:25:16,997 ERROR [Remoting] Error
                      java.lang.IllegalStateException: No SubscriptionRegistry exists
                       at org.jboss.seam.remoting.messaging.SubscriptionRegistry.instance(SubscriptionRegistry.java:65)
                       at org.jboss.seam.remoting.messaging.SubscriptionRequest.subscribe(SubscriptionRequest.java:22)
                       at org.jboss.seam.remoting.SubscriptionHandler.handle(SubscriptionHandler.java:78)
                       at org.jboss.seam.remoting.Remoting.getResource(Remoting.java:110)
                       at org.jboss.seam.servlet.ResourceServlet.doGet(ResourceServlet.java:68)
                       at org.jboss.seam.servlet.ResourceServlet.doPost(ResourceServlet.java:77)
                       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                      ...


                      Apparently I can't figure out which is the right place to insert that declaration...

                      • 9. Re: Upgrade from Seam 1.1 to 1.2.1
                        Alex Mateescu Newbie

                        Forgot about this. The first error is caused by:

                        Caused by: java.lang.IllegalArgumentException: no such setter method: org.jboss.seam.remoting.messaging.SubscriptionRegistry.install
                         at org.jboss.seam.util.Reflections.getSetterMethod(Reflections.java:219)
                         at org.jboss.seam.Component.initInitializers(Component.java:401)
                         at org.jboss.seam.Component.<init>(Component.java:263)
                         at org.jboss.seam.Component.<init>(Component.java:203)
                         at org.jboss.seam.init.Initialization.addComponent(Initialization.java:851)
                         ... 141 more


                        • 10. Re: Upgrade from Seam 1.1 to 1.2.1
                          Alex Mateescu Newbie

                          Ok, some progress.

                          I left the subscription registry in a single JAR file and removed the install parameter (did not work wiht install=="true" or install="false"). The application deploys fine, seam remoting is working, but it is breaking when trying to subscribe to JMS topic:

                          15:35:58,898 ERROR [Remoting] Error
                          java.lang.IllegalArgumentException: Invalid token argument - token not found in Session Context.
                           at org.jboss.seam.remoting.messaging.SubscriptionRegistry.getSubscription(SubscriptionRegistry.java:178)
                           at org.jboss.seam.remoting.messaging.PollRequest.poll(PollRequest.java:43)
                           at org.jboss.seam.remoting.PollHandler.handle(PollHandler.java:83)
                           at org.jboss.seam.remoting.Remoting.getResource(Remoting.java:110)
                           at org.jboss.seam.servlet.ResourceServlet.doGet(ResourceServlet.java:68)
                           at org.jboss.seam.servlet.ResourceServlet.doPost(ResourceServlet.java:77)
                           at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                           at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                          


                          • 11. Re: Upgrade from Seam 1.1 to 1.2.1
                            Alex Mateescu Newbie

                            Ok, some progress.

                            I left the subscription registry in a single JAR file and removed the install parameter (did not work wiht install=="true" or install="false"). The application deploys fine, seam remoting is working, but it is breaking when trying to subscribe to JMS topic:

                            15:35:58,898 ERROR [Remoting] Error
                            java.lang.IllegalArgumentException: Invalid token argument - token not found in Session Context.
                             at org.jboss.seam.remoting.messaging.SubscriptionRegistry.getSubscription(SubscriptionRegistry.java:178)
                             at org.jboss.seam.remoting.messaging.PollRequest.poll(PollRequest.java:43)
                             at org.jboss.seam.remoting.PollHandler.handle(PollHandler.java:83)
                             at org.jboss.seam.remoting.Remoting.getResource(Remoting.java:110)
                             at org.jboss.seam.servlet.ResourceServlet.doGet(ResourceServlet.java:68)
                             at org.jboss.seam.servlet.ResourceServlet.doPost(ResourceServlet.java:77)
                             at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                             at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                            


                            • 12. Re: Upgrade from Seam 1.1 to 1.2.1
                              Alex Mateescu Newbie

                              Got it. The invalid token is "undefined".

                              When subcribing to the topics, two tokens are returned. However, upon the first poll the second one is being sent as "undefined". Subsequent polls use both tokens correctly. Looks like a typical uninitialized javascript variable somewhere on the Seam part.

                              • 13. Re: Upgrade from Seam 1.1 to 1.2.1
                                Shane Bryzak Master

                                Could you please raise this in JIRA and assign to me? I'll need enough information to reproduce the issue.

                                • 14. Re: Upgrade from Seam 1.1 to 1.2.1
                                  Alex Mateescu Newbie

                                  Done. JBSEAM-1229. I hope it's an easy fix.