[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2493) Problems with faces Renderer when used simultaneously from different threads

Marcus Schmidke (JIRA) jira-events at lists.jboss.org
Sun Jan 13 15:18:23 EST 2008


Problems with faces Renderer when used simultaneously from different threads
----------------------------------------------------------------------------

                 Key: JBSEAM-2493
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-2493
             Project: JBoss Seam
          Issue Type: Bug
          Components: Mail
    Affects Versions: 2.0.0.GA
         Environment: Seam-App in JBoss 4.2
Properly configure mail-service
            Reporter: Marcus Schmidke
         Assigned To: Pete Muir


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 at bo.dy</m:from>
		<m:to name="Marcus">your.own at 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.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list