Created attachment 573034 [details] Server log Seam version: 2.2.5.EAP5 (included in EAP 5.1.2.GA) The seampay example from Seam 2.2 was migrated to EAP6 according to the migration guide on Documentation-Stage (http://documentation-stage.bne.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/6/html/Beta_Documentation/Migrate_Seam_22_Archives_to_JBoss_Enterprise_Application_Platform_6.html) and the bug was verified to occur with EAP 6.0.0.ER1. This issue was fixed in Seam 2.3, so there is a patch available: https://github.com/maschmid/Seam2.3/commit/44a14986a9f6003c5a9ac13fcae9365a5860331e#diff-0 Related issue: https://issues.jboss.org/browse/AS7-1358 Bug description: The ftest fails in 2 methods: [testng] FAILED: payOnceTest [testng] java.lang.AssertionError: No money were subtracted from account expected:<991.46> but was:<1001.46> [testng] at org.jboss.seam.example.common.test.seampay.selenium.PaymentTest.payOnceTest(PaymentTest.java:77) [testng] ... Removed 25 stack frames [testng] FAILED: payEveryMinuteTest [testng] java.lang.AssertionError: No money were subtracted from account after a minute expected:<992.46> but was:<1002.46> [testng] at org.jboss.seam.example.common.test.seampay.selenium.PaymentTest.payEveryMinuteTest(PaymentTest.java:115) [testng] ... Removed 25 stack frames Relevant part of server log attached.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: This bug is caused by changes in the JNDI name of UserTransaction in AS7 (as opposed to AS6 and below). It can be worked around by overriding org.jboss.seam.transaction.Transaction.getUserTransaction, as described in https://issues.jboss.org/browse/JBPAPP-8322.
Marek Schmidt <maschmid> made a comment on jira JBPAPP-8322 Reproducible in mail, quartz, seambay and seampay Seam examples
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,3 +1,5 @@ -This bug is caused by changes in the JNDI name of UserTransaction in AS7 (as opposed to AS6 and below). +Changes in the JNDI name of UserTransaction lead to an UnsupportedOperationException error in the Seam 2 seampay example ftest. The workaround for this issue is to override org.jboss.seam.transaction.Transaction.getUserTransaction. -It can be worked around by overriding org.jboss.seam.transaction.Transaction.getUserTransaction, as described in https://issues.jboss.org/browse/JBPAPP-8322.+Include the following class in SEAMPAY_EXAMPLE/src/org/jboss/seam/example/seampay and name it TransactionAS7.java: + +<snipped for brevity>
Seam 2.3 is not a part of the final payload.
Erratum: This a Seam 2.2 issue, reopening.
Workaround is to create this class in your application: TransactionAS7.java: import static org.jboss.seam.annotations.Install.*; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.transaction.UserTransaction; import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.Install; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Scope; import org.jboss.seam.annotations.intercept.BypassInterceptors; import org.jboss.seam.transaction.Transaction; import org.jboss.seam.util.Naming; @Name("org.jboss.seam.transaction.transaction") @Scope(ScopeType.EVENT) @Install(precedence = APPLICATION) // overrides Seam default component of BUILT_IN @BypassInterceptors public class TransactionAS7 extends Transaction { @Override protected UserTransaction getUserTransaction() throws NamingException { final InitialContext context = Naming.getInitialContext(); try { return (UserTransaction) context.lookup("java:comp/UserTransaction"); } catch (final NamingException ne) { try { // JBoss AS7 (with patch from https://issues.jboss.org/browse/AS7-1358) return (UserTransaction) context.lookup("java:jboss/UserTransaction"); } catch (final Exception cause) { // ignore this so we let the code carry on to try the final JNDI name } try { // Embedded JBoss has no java:comp/UserTransaction final UserTransaction ut = (UserTransaction) context.lookup("UserTransaction"); ut.getStatus(); // for glassfish, which can return an unusable UT return ut; } catch (final Exception e) { throw ne; } } } }
WFK 2.0 does not delivere Seam 2.2, however, these issues have already been documented in the EAP 6 release notes, so no need to duplicate each issue in WFk 2.0 release notes. However, we should include a pointer to the EAP 6 release notes to assist customers looking for Seam 2.2 bug information.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -2,4 +2,50 @@ Include the following class in SEAMPAY_EXAMPLE/src/org/jboss/seam/example/seampay and name it TransactionAS7.java: -<snipped for brevity>+TransactionAS7.java: + + +import static org.jboss.seam.annotations.Install.*; + +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.transaction.UserTransaction; + +import org.jboss.seam.ScopeType; +import org.jboss.seam.annotations.Install; +import org.jboss.seam.annotations.Name; +import org.jboss.seam.annotations.Scope; +import org.jboss.seam.annotations.intercept.BypassInterceptors; +import org.jboss.seam.transaction.Transaction; +import org.jboss.seam.util.Naming; + +@Name("org.jboss.seam.transaction.transaction") +@Scope(ScopeType.EVENT) +@Install(precedence = APPLICATION) // overrides Seam default component of BUILT_IN +@BypassInterceptors +public class TransactionAS7 extends Transaction { + + @Override + protected UserTransaction getUserTransaction() throws NamingException { + final InitialContext context = Naming.getInitialContext(); + + try { + return (UserTransaction) context.lookup("java:comp/UserTransaction"); + } catch (final NamingException ne) { + try { + return (UserTransaction) context.lookup("java:jboss/UserTransaction"); + } catch (final Exception cause) { + // ignore this so we let the code carry on to try the final JNDI name + } + + try { + // Embedded JBoss has no java:comp/UserTransaction + final UserTransaction ut = (UserTransaction) context.lookup("UserTransaction"); + ut.getStatus(); // for glassfish, which can return an unusable UT + return ut; + } catch (final Exception e) { + throw ne; + } + } + } +}
Marek Novotny <mnovotny> updated the status of jira JBPAPP-8322 to Resolved
Marek Novotny <mnovotny> made a comment on jira JBPAPP-8322 Added lookup for EAP6 JNDI USerTransaction
Ron Šmeral <rsmeral> updated the status of jira JBPAPP-8322 to Reopened
Ron Šmeral <rsmeral> made a comment on jira JBPAPP-8322 Still present in EAP 5.2.0.ER2. Quartz, seambay, seampay and mail all behave the same as before, throwing {{java.lang.UnsupportedOperationException: no transaction}}.
Ron Šmeral <rsmeral> made a comment on jira JBPAPP-8322 It appears that the first catch block in the {{getUserTransaction}} method should catch {{NamingException}} (not NNFE), since that's what is thrown by {{InitialContext.lookup}}. Also, in the {{return}} statement, the result of the lookup should be cast to {{(javax.transaction.UserTransaction)}} instead of {{org.jboss.seam.transaction.UserTransaction}}. This way, the tests pass.
Marek Novotny <mnovotny> made a comment on jira JBPAPP-8322 This issues is a little dejavu between EAP5 and EAP6 environment. Anyway we said that we are supporting Seam 2.2.x on EAP6. So we did all fixes to able that in EAP 5 Seam releases. I have proposed the RN text.
Marek Schmidt <maschmid> updated the status of jira JBPAPP-8322 to Closed
Marek Schmidt <maschmid> made a comment on jira JBPAPP-8322 Verified with Seam from EAP 5.2.0.ER4 on EAP6.0.0