Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-2493

Problems with faces Renderer when used simultaneously from different threads

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0.0.GA
    • Fix Version/s: 2.0.2.CR1, 2.1.0.GA
    • Component/s: Mail
    • Labels:
      None
    • Environment:

      Seam-App in JBoss 4.2
      Properly configure mail-service

      Description

      When creating multiple renderers in different threads and using them simultaneously, there are problems with JSF variables (for example in ui:repeat)
      Create the following classes:

      @Name("seamMailBug")
      @Scope(ScopeType.EVENT)
      public class SeamMailBug {

      @In
      private Renderer renderer;

      @Asynchronous
      public void send(List<String> asList)

      { Context c = Contexts.getEventContext(); c.set("l", asList); renderer.render("/seamMailBug.xhtml"); }

      }

      @Name("seamMailBug1")
      @Scope(ScopeType.EVENT)
      public class SeamMailBug1 {
      public void send() {
      SeamMailBug smb = (SeamMailBug) Component
      .getInstance(SeamMailBug.class);
      smb.send(Arrays.asList(new String[]

      { "L2-1" }

      ));
      smb.send(Arrays.asList(new String[]

      { "L1-1", "L1-2", "L1-3" }

      ));
      }

      }

      Create the mail template seamMailBug.xhtml:
      <?xml version="1.0" encoding="ISO-8859-1"?>
      <ui:repeat xmlns="http://www.w3.org/1999/xhtml"
      xmlns:m="http://jboss.com/products/seam/mail"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      value="#

      {l}

      " var="v"
      >
      <m:message>
      <m:from>some@bo.dy</m:from>
      <m:to name="Marcus">your.own@email.address</m:to>
      <m:body>
      Guten Tag! #

      {v}

      </m:body>
      </m:message>
      </ui:repeat>

      And in pages.xml:
      <page view-id="/seambug.xhtml" action="#

      {seamMailBug1.send}

      "/>

      Start the server and get the URL: http://..../.../seambug.seam

      One should expect 4 mails being sent, containing the strings L1-1, L1-2, L1-3 and L2-1.

      The number of mails actually sent will be correct, but carefully verify the strings being sent.

      You will see that the "v" iterator variable is the same used from both threads.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                pmuir Pete Muir
                Reporter:
                mschmidke Marcus Schmidke
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: