Hi, Simon.

Thank you for investigating the problem.

I debugged a bit more. The following sequence is failing with ActiveMQ randomly.

1) Send 3 messages to a queue and commit the session
2) receiveNoWait on one of the three messages

I confirmed that 1) (composite-scoped component with @Init) is always done before 2).

I assume the session.commit() should return only after the messages are made available for receive. But it seems that ActiveMQ doesn't guarantee it. Could it be an ActiveMQ bug?

Adding the timeout as a workaround is fine with me.

Thanks,
Raymond

----- Original Message ----- From: "Simon Nash" <[EMAIL PROTECTED]>
To: <tuscany-dev@ws.apache.org>
Sent: Monday, February 18, 2008 8:47 AM
Subject: Re: Build fails in transaction itest


Simon Nash wrote:
I did a clean checkout and top-level build today.  The build failed in
itest/transaction with the following error.  Has anyone else seen this?
I get it consistently from a clean top-level build, but it always seems
to go away when I rebuild just this module.

  Simon

With a bit of experimentation I determined that adding a timeout of
1000 milliseconds to the receiveNoWait() call on line 122 of
CheckingAccountServiceImpl.java resolved this intermittent failure
for me.  It seems that an immediate receive can sometimes execute
before the message is available.

I committed this change (workaround) in revision 628802.  Would anyone
like to look into a more scientific fix?

  Simon

[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Tuscany SCA Transaction Policy Integration Test
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 8 source files to F:\tuscany62\sca\itest\transaction\target\cla
sses
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Compiling 2 source files to F:\tuscany62\sca\itest\transaction\target\tes
t-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: F:\tuscany62\sca\itest\transaction\target\sure
fire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.tuscany.sca.itest.transaction.ConcurrentXAResourceTestCase 16-Feb-2008 16:48:37 org.apache.tuscany.sca.itest.transaction.ConcurrentXAResour
ceTestCase$TestThread run
INFO: Thread[Thread-1,5,main] running...
16-Feb-2008 16:48:37 org.apache.tuscany.sca.itest.transaction.ConcurrentXAResour
ceTestCase$TestThread run
INFO: Thread[Thread-3,5,main] running...
16-Feb-2008 16:48:37 org.apache.tuscany.sca.itest.transaction.ConcurrentXAResour
ceTestCase$TestThread run
INFO: Thread[Thread-2,5,main] running...
16-Feb-2008 16:48:37 org.apache.tuscany.sca.itest.transaction.ConcurrentXAResour
ceTestCase$TestThread run
INFO: Thread[Thread-4,5,main] running...
16-Feb-2008 16:48:37 org.apache.tuscany.sca.itest.transaction.ConcurrentXAResour
ceTestCase$TestThread run
INFO: Thread[Thread-5,5,main] running...
16-Feb-2008 16:49:01 org.apache.tuscany.sca.itest.transaction.ConcurrentXAResour
ceTestCase$TestThread run
INFO: 1
16-Feb-2008 16:49:01 org.apache.tuscany.sca.itest.transaction.ConcurrentXAResour
ceTestCase$TestThread run
INFO: 1
16-Feb-2008 16:49:01 org.apache.tuscany.sca.itest.transaction.ConcurrentXAResour
ceTestCase$TestThread run
INFO: 1
16-Feb-2008 16:49:01 org.apache.tuscany.sca.itest.transaction.ConcurrentXAResour
ceTestCase$TestThread run
INFO: 1
16-Feb-2008 16:49:01 org.apache.tuscany.sca.itest.transaction.ConcurrentXAResour
ceTestCase$TestThread run
INFO: 1
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 24.996 sec
Running org.apache.tuscany.sca.itest.transaction.TransactionTestCase
16-Feb-2008 16:49:02 org.apache.tuscany.sca.assembly.builder.impl.CompositeBuild
erImpl$1 problem
WARNING: No type specified on component property: SavingsAccountServiceComponent
/accounts
16-Feb-2008 16:49:02 org.apache.tuscany.sca.assembly.builder.impl.CompositeBuild
erImpl$1 problem
WARNING: No type specified on component property: CheckingAccountServiceComponen
t/accounts
16-Feb-2008 16:49:02 org.apache.tuscany.sca.assembly.builder.impl.CompositeBuild
erImpl$1 problem
WARNING: Theres been an exception related to policies... org.apache.tuscany.sca. assembly.builder.impl.PolicyComputationException: The following are unfulfilled
intents for component implementation - TransferServiceComponent
Unfulfilled Intents = [{http://www.osoa.org/xmlns/sca/1.0}managedTransaction.glo
bal]
16-Feb-2008 16:49:02 org.apache.tuscany.sca.assembly.builder.impl.CompositeBuild
erImpl$1 problem
WARNING: Theres been an exception related to policies... org.apache.tuscany.sca. assembly.builder.impl.PolicyComputationException: The are unfulfilled intents fo
r binding in reference - savings
Unfulfilled Intents = [{http://www.osoa.org/xmlns/sca/1.0}propagatesTransaction]

16-Feb-2008 16:49:02 org.apache.tuscany.sca.assembly.builder.impl.CompositeBuild
erImpl$1 problem
WARNING: Theres been an exception related to policies... org.apache.tuscany.sca. assembly.builder.impl.PolicyComputationException: The are unfulfilled intents fo
r binding in reference - checking
Unfulfilled Intents = [{http://www.osoa.org/xmlns/sca/1.0}propagatesTransaction]

16-Feb-2008 16:49:02 org.apache.tuscany.sca.assembly.builder.impl.CompositeBuild
erImpl$1 problem
WARNING: Theres been an exception related to policies... org.apache.tuscany.sca. assembly.builder.impl.PolicyComputationException: The following are unfulfilled
intents for component implementation - SavingsAccountServiceComponent
Unfulfilled Intents = [{http://www.osoa.org/xmlns/sca/1.0}managedTransaction.glo
bal]
16-Feb-2008 16:49:02 org.apache.tuscany.sca.assembly.builder.impl.CompositeBuild
erImpl$1 problem
WARNING: Theres been an exception related to policies... org.apache.tuscany.sca. assembly.builder.impl.PolicyComputationException: The following are unfulfilled
intents for binding in service - AccountService
Unfulfilled Intents = [{http://www.osoa.org/xmlns/sca/1.0}propagatesTransaction]

16-Feb-2008 16:49:02 org.apache.tuscany.sca.assembly.builder.impl.CompositeBuild
erImpl$1 problem
WARNING: Theres been an exception related to policies... org.apache.tuscany.sca. assembly.builder.impl.PolicyComputationException: The following are unfulfilled
intents for component implementation - CheckingAccountServiceComponent
Unfulfilled Intents = [{http://www.osoa.org/xmlns/sca/1.0}managedTransaction.glo
bal]
16-Feb-2008 16:49:02 org.apache.tuscany.sca.assembly.builder.impl.CompositeBuild
erImpl$1 problem
WARNING: Theres been an exception related to policies... org.apache.tuscany.sca. assembly.builder.impl.PolicyComputationException: The following are unfulfilled
intents for binding in service - AccountService
Unfulfilled Intents = [{http://www.osoa.org/xmlns/sca/1.0}propagatesTransaction]

16-Feb-2008 16:49:02 org.apache.tuscany.sca.assembly.builder.impl.CompositeBuild
erImpl$1 problem
WARNING: Theres been an exception relation to policies... org.apache.tuscany.sca .assembly.builder.impl.PolicyComputationException: The are unfulfilled intents f
or binding in reference - checking
Unfulfilled Intents = [{http://www.osoa.org/xmlns/sca/1.0}propagatesTransaction]

16-Feb-2008 16:49:02 org.apache.tuscany.sca.assembly.builder.impl.CompositeBuild
erImpl$1 problem
WARNING: Theres been an exception relation to policies... org.apache.tuscany.sca .assembly.builder.impl.PolicyComputationException: The are unfulfilled intents f
or binding in reference - savings
Unfulfilled Intents = [{http://www.osoa.org/xmlns/sca/1.0}propagatesTransaction]

[0] S001:1096.0172
[1] S002:1100.6329
ActiveMQ 4.1.1 JMS Message Broker (localhost) is starting
For help or more information please see: http://incubator.apache.org/activemq/
Database driver recognized: [apache_derby_embedded_jdbc_driver]
Attempting to acquire the exclusive lock to become the Master broker
Becoming the master on dataSource: [EMAIL PROTECTED]
f248
Journal Recovery Started from: Active Journal: using 2 x 20.0 Megs at: F:\tuscan
y62\sca\itest\transaction\target\activemq-data\localhost\journal
Journal Recovered: 0 message(s) in transactions recovered.
Listening for connections at: tcp://SouthRim:61616
Connector tcp://SouthRim:61616 Started
ActiveMQ JMS Message Broker (localhost, ID:SouthRim-52102-1203180548487-1:0) sta
rted
JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
[2] C001:1033.2021
ActiveMQ Message Broker (localhost, ID:SouthRim-52102-1203180548487-1:0) is shut
ting down
Connector tcp://SouthRim:61616 Stopped
ActiveMQ JMS Message Broker (localhost, ID:SouthRim-52102-1203180548487-1:0) sto
pped
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 18.443 sec <<< F
AILURE!
testTransaction(org.apache.tuscany.sca.itest.transaction.TransactionTestCase) T
ime elapsed: 12.896 sec  <<< ERROR!
org.apache.tuscany.sca.itest.transaction.AccountNotFoundException: C001
at org.apache.tuscany.sca.itest.transaction.CheckingAccountServiceImpl.s
ave(CheckingAccountServiceImpl.java:125)
at org.apache.tuscany.sca.itest.transaction.AccountServiceImpl.deposit(A
ccountServiceImpl.java:37)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementat
ionInvoker.invoke(JavaImplementationInvoker.java:109)
at org.apache.tuscany.sca.policy.transaction.TransactionInterceptor$Tran
sactionalInvocation.run(TransactionInterceptor.java:117)
at org.apache.tuscany.sca.policy.transaction.TransactionInterceptor$Tran
sactionalInvocation.run(TransactionInterceptor.java:106)
at org.apache.tuscany.sca.policy.transaction.TransactionManagerHelper.ru
n(TransactionManagerHelper.java:156)
at org.apache.tuscany.sca.policy.transaction.TransactionManagerHelper.ha
ndlesInbound(TransactionManagerHelper.java:188)
at org.apache.tuscany.sca.policy.transaction.TransactionInterceptor.invo
ke(TransactionInterceptor.java:97)
at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCAB
indingInvoker.java:61)
at org.apache.tuscany.sca.policy.transaction.TransactionInterceptor$Tran
sactionalInvocation.run(TransactionInterceptor.java:117)
at org.apache.tuscany.sca.policy.transaction.TransactionInterceptor$Tran
sactionalInvocation.run(TransactionInterceptor.java:106)
at org.apache.tuscany.sca.policy.transaction.TransactionManagerHelper.ru
n(TransactionManagerHelper.java:156)
at org.apache.tuscany.sca.policy.transaction.TransactionManagerHelper.ha
ndlesOutbound(TransactionManagerHelper.java:137)
at org.apache.tuscany.sca.policy.transaction.TransactionInterceptor.invo
ke(TransactionInterceptor.java:95)
at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JD
KInvocationHandler.java:261)
at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JD
KInvocationHandler.java:149)
        at $Proxy12.deposit(Unknown Source)
at org.apache.tuscany.sca.itest.transaction.TransferServiceImpl.transfer
(TransferServiceImpl.java:46)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementat
ionInvoker.invoke(JavaImplementationInvoker.java:109)
at org.apache.tuscany.sca.policy.transaction.TransactionInterceptor$Tran
sactionalInvocation.run(TransactionInterceptor.java:117)
at org.apache.tuscany.sca.policy.transaction.TransactionInterceptor$Tran
sactionalInvocation.run(TransactionInterceptor.java:106)
at org.apache.tuscany.sca.policy.transaction.TransactionManagerHelper.ru
n(TransactionManagerHelper.java:156)
at org.apache.tuscany.sca.policy.transaction.TransactionManagerHelper.ha
ndlesInbound(TransactionManagerHelper.java:188)
at org.apache.tuscany.sca.policy.transaction.TransactionInterceptor.invo
ke(TransactionInterceptor.java:97)
at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCAB
indingInvoker.java:61)
at org.apache.tuscany.sca.policy.transaction.TransactionInterceptor$Tran
sactionalInvocation.run(TransactionInterceptor.java:117)
at org.apache.tuscany.sca.policy.transaction.TransactionInterceptor$Tran
sactionalInvocation.run(TransactionInterceptor.java:106)
at org.apache.tuscany.sca.policy.transaction.TransactionManagerHelper.ru
n(TransactionManagerHelper.java:156)
at org.apache.tuscany.sca.policy.transaction.TransactionManagerHelper.ha
ndlesOutbound(TransactionManagerHelper.java:137)
at org.apache.tuscany.sca.policy.transaction.TransactionInterceptor.invo
ke(TransactionInterceptor.java:95)
at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JD
KInvocationHandler.java:261)
at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JD
KInvocationHandler.java:149)
        at $Proxy11.transfer(Unknown Source)
at org.apache.tuscany.sca.itest.transaction.TransactionTestCase.testTran
saction(TransactionTestCase.java:50)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMet
hodRunner.java:99)
at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethod
Runner.java:81)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAn
dAfterRunner.java:34)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunne
r.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java
:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(Te
stClassMethodsRunner.java:75)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethod
sRunner.java:36)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClass
Runner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAn
dAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:5
2)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.
java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTes
tSet(AbstractDirectoryTestSuite.java:138)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(Ab
stractDirectoryTestSuite.java:125)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Su
refireBooter.java:308)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.j
ava:879)


Results :

Tests in error:

testTransaction(org.apache.tuscany.sca.itest.transaction.TransactionTestCase) Tests run: 2, Failures: 0, Errors: 1, Skipped: 0

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to