[seam-issues] [JBoss JIRA] (JBSEAM-5092) EL expression in pattern of s:convertDateTime breaks conversation propagation

Joseba Urkiri (JIRA) jira-events at lists.jboss.org
Tue Apr 30 09:11:53 EDT 2013


     [ https://issues.jboss.org/browse/JBSEAM-5092?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joseba Urkiri updated JBSEAM-5092:
----------------------------------

    Description: 
Using an EL expression to determine the pattern of a convertDateTime, makes application fail when executing any action.

Here is the test code:

{code:xml}
<h:dataTable value="#{testBean.model}" var="row">
 	<h:column>
		<f:facet name="header">
			<h:outputText value="DATE" />
		</f:facet>
		<h:outputText value="#{row}">
			<s:convertDateTime pattern="#{testBean.pattern}" />
		</h:outputText>
	</h:column>
</h:dataTable>
{code}

{code:title=TestBean.java|borderStyle=solid}
@Name("testBean")
@Scope(ScopeType.CONVERSATION)
public class TestBean {
	
	private static final String DATE_PATTERN = "yyyy/MM/dd";
	
	private ListDataModel<Date> model;
	
	public ListDataModel<Date> getModel() {
		return model;
	}

	public void setModel(ListDataModel<Date> model) {
		this.model = model;
	}

	public String getPattern() {
		return DATE_PATTERN;
	}

	@Create
	@Begin
	public void onInit(){
		Calendar cal = Calendar.getInstance();
		List<Date> list = new ArrayList<Date>();
		list.add(cal.getTime());
		cal.add(Calendar.DAY_OF_MONTH, 1);
		list.add(cal.getTime());
		model = new ListDataModel<Date>(list);
	}
}
{code}

Exception is:

{noformat} 
Caused by: java.lang.IllegalStateException: begin method invoked from a long-running conversation, try using @Begin(join=true) on method: onInit
	at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:47) [jboss-seam.jar:2.3.0.Final]
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.3.0.Final]
	at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) [jboss-seam.jar:2.3.0.Final]
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.3.0.Final]
	at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) [jboss-seam.jar:2.3.0.Final]
	at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:186) [jboss-seam.jar:2.3.0.Final]
	at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:104) [jboss-seam.jar:2.3.0.Final]
	at com.lks.conversation.error.TestBean_$$_javassist_seam_2.onInit(TestBean_$$_javassist_seam_2.java) [classes:]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_02]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_02]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_02]
	at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_02]
	at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:2.3.0.Final]
	at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) [jboss-seam.jar:2.3.0.Final]
	at org.jboss.seam.Component.callComponentMethod(Component.java:2313) [jboss-seam.jar:2.3.0.Final]
	at org.jboss.seam.Component.callCreateMethod(Component.java:2236) [jboss-seam.jar:2.3.0.Final]
	at org.jboss.seam.Component.newInstance(Component.java:2196) [jboss-seam.jar:2.3.0.Final]
	... 60 more
{noformat} 


  was:
Using an EL expression to determine the pattern of a convertDateTime, makes application fail when executing any action.

Here is the test code:

{code:xml}
<h:dataTable value="#{testBean.model}" var="row">
 	<h:column>
		<f:facet name="header">
			<h:outputText value="DATE" />
		</f:facet>
		<h:outputText value="#{row}">
			<s:convertDateTime pattern="#{testBean.pattern}" />
		</h:outputText>
	</h:column>
</h:dataTable>
{code}

{code:title=TestBean.java|borderStyle=solid}
@Name("testBean")
@Scope(ScopeType.CONVERSATION)
public class TestBean {
	
	private static final String DATE_PATTERN = "yyyy/MM/dd";
	
	private ListDataModel<Date> model;
	
	public ListDataModel<Date> getModel() {
		return model;
	}

	public void setModel(ListDataModel<Date> model) {
		this.model = model;
	}

	public String getPattern() {
		return DATE_PATTERN;
	}

	@Create
	@Begin
	public void onInit(){
		Calendar cal = Calendar.getInstance();
		List<Date> list = new ArrayList<Date>();
		list.add(cal.getTime());
		cal.add(Calendar.DAY_OF_MONTH, 1);
		list.add(cal.getTime());
		model = new ListDataModel<Date>(list);
	}
}
{code}


    
> EL expression in pattern of s:convertDateTime breaks conversation propagation
> -----------------------------------------------------------------------------
>
>                 Key: JBSEAM-5092
>                 URL: https://issues.jboss.org/browse/JBSEAM-5092
>             Project: Seam 2
>          Issue Type: Bug
>          Components: JSF Controls
>    Affects Versions: 2.3.0.Final
>         Environment: JBoss 7.1.1
>            Reporter: Joseba Urkiri
>              Labels: conversationPropagation
>
> Using an EL expression to determine the pattern of a convertDateTime, makes application fail when executing any action.
> Here is the test code:
> {code:xml}
> <h:dataTable value="#{testBean.model}" var="row">
>  	<h:column>
> 		<f:facet name="header">
> 			<h:outputText value="DATE" />
> 		</f:facet>
> 		<h:outputText value="#{row}">
> 			<s:convertDateTime pattern="#{testBean.pattern}" />
> 		</h:outputText>
> 	</h:column>
> </h:dataTable>
> {code}
> {code:title=TestBean.java|borderStyle=solid}
> @Name("testBean")
> @Scope(ScopeType.CONVERSATION)
> public class TestBean {
> 	
> 	private static final String DATE_PATTERN = "yyyy/MM/dd";
> 	
> 	private ListDataModel<Date> model;
> 	
> 	public ListDataModel<Date> getModel() {
> 		return model;
> 	}
> 	public void setModel(ListDataModel<Date> model) {
> 		this.model = model;
> 	}
> 	public String getPattern() {
> 		return DATE_PATTERN;
> 	}
> 	@Create
> 	@Begin
> 	public void onInit(){
> 		Calendar cal = Calendar.getInstance();
> 		List<Date> list = new ArrayList<Date>();
> 		list.add(cal.getTime());
> 		cal.add(Calendar.DAY_OF_MONTH, 1);
> 		list.add(cal.getTime());
> 		model = new ListDataModel<Date>(list);
> 	}
> }
> {code}
> Exception is:
> {noformat} 
> Caused by: java.lang.IllegalStateException: begin method invoked from a long-running conversation, try using @Begin(join=true) on method: onInit
> 	at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:47) [jboss-seam.jar:2.3.0.Final]
> 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.3.0.Final]
> 	at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) [jboss-seam.jar:2.3.0.Final]
> 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.3.0.Final]
> 	at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) [jboss-seam.jar:2.3.0.Final]
> 	at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:186) [jboss-seam.jar:2.3.0.Final]
> 	at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:104) [jboss-seam.jar:2.3.0.Final]
> 	at com.lks.conversation.error.TestBean_$$_javassist_seam_2.onInit(TestBean_$$_javassist_seam_2.java) [classes:]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_02]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_02]
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_02]
> 	at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_02]
> 	at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:2.3.0.Final]
> 	at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) [jboss-seam.jar:2.3.0.Final]
> 	at org.jboss.seam.Component.callComponentMethod(Component.java:2313) [jboss-seam.jar:2.3.0.Final]
> 	at org.jboss.seam.Component.callCreateMethod(Component.java:2236) [jboss-seam.jar:2.3.0.Final]
> 	at org.jboss.seam.Component.newInstance(Component.java:2196) [jboss-seam.jar:2.3.0.Final]
> 	... 60 more
> {noformat} 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list