Oh, I also found a comment just before the declaration of the private variable phaseManager in InvocationChainImpl
// FIXME: Not a good practice to use static reference Is it related? Regards Gilbert On Wed, Apr 23, 2008 at 4:12 PM, Gilbert Kwan <[EMAIL PROTECTED]> wrote: > The test created 4 threads. Two threads got a stateless scope service > BService and called it. Another 2 threads got another stateless scope > service CService. In Mike's case, 2 threads of BService worked fine, > but other 2 threads of CService could not get the service because of > the IllegalArgumentException. > > The code is so simple as: > CService cService = domain.getService(CService.class, > "CComponent"); > cService.setCurrentState(name + "-state-1"); > > Can anyone explain why there was an > "java.lang.IllegalArgumentException: Invalid phase name: > component.implementation"? > > I checked the code at > org.apache.tuscany.sca.core.invocation.InvocationChainImpl.addInvoker(String > phase, Invoker invoker), and ran in debug mode. > > I found the argument phase="component.implementation", and > phaseManager.getAllPhases() returned empty list. Why did that happen? > > The interesting thing is that not always be happened. > > Regards > Gilbert > > > On Tue, Apr 22, 2008 at 7:12 PM, Mike Edwards > <[EMAIL PROTECTED]> wrote: > > > Folks, > > > > I'm getting a vtest failure in my latest builds - any explanation? > > > > ------------------------------------------------------- > > T E S T S > > ------------------------------------------------------- > > Running > > org.apache.tuscany.sca.vtest.javaapi.annotations.scope.ScopeAnnotationTe > > stCase > > atScope1 - Setting up > > 22-Apr-2008 23:59:30 > > org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntim > > e buildComposite > > WARNING: Can't find monitor extension on the classpath > > GService->initGService > > Exception in thread "Thread-3" java.lang.IllegalArgumentException: Invalid > > phase > > name: component.implementation > > at > > org.apache.tuscany.sca.core.invocation.InvocationChainImpl.addInvoker > > (InvocationChainImpl.java:106) > > at > > org.apache.tuscany.sca.core.invocation.InvocationChainImpl.addInvoker > > (InvocationChainImpl.java:70) > > at > > org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.addImplementatio > > nInterceptor(RuntimeWireImpl.java:316) > > at > > org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationCh > > ains(RuntimeWireImpl.java:188) > > at > > org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationCha > > ins(RuntimeWireImpl.java:109) > > at > > org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationCha > > in(RuntimeWireImpl.java:115) > > at > > org.apache.tuscany.sca.core.assembly.RuntimeComponentServiceImpl.getI > > nvocationChain(RuntimeComponentServiceImpl.java:120) > > at > > org.apache.tuscany.sca.binding.sca.impl.RuntimeSCAReferenceBindingPro > > vider.getInvoker(RuntimeSCAReferenceBindingProvider.java:232) > > at > > org.apache.tuscany.sca.binding.sca.impl.RuntimeSCAReferenceBindingPro > > vider.createInvoker(RuntimeSCAReferenceBindingProvider.java:245) > > at > > org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.addReferenceBind > > ingInterceptor(RuntimeWireImpl.java:228) > > at > > org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationCh > > ains(RuntimeWireImpl.java:167) > > at > > org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationCha > > ins(RuntimeWireImpl.java:109) > > at > > org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.getInvoca > > tionChain(JDKInvocationHandler.java:243) > > at > > org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JD > > KInvocationHandler.java:148) > > at $Proxy17.setCurrentState(Unknown Source) > > at > > org.apache.tuscany.sca.vtest.javaapi.annotations.scope.ScopeAnnotatio > > nTestCase$CThread.run(ScopeAnnotationTestCase.java:311) > > Exception in thread "Thread-4" org.osoa.sca.ServiceUnavailableException: > > Service > > not found for component CComponent reference $self$.CService > > (bindingURI=/CComp > > onent operation=getName). Ensure that the composite containing the service > > is lo > > aded and started somewhere in the SCA domain and that if running in a remote > > nod > > e that the interface of the target service marked as @Remotable > > at > > org.apache.tuscany.sca.binding.sca.impl.RuntimeSCAReferenceBindingPro > > vider.createInvoker(RuntimeSCAReferenceBindingProvider.java:247) > > at > > org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.addReferenceBind > > ingInterceptor(RuntimeWireImpl.java:228) > > at > > org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationCh > > ains(RuntimeWireImpl.java:167) > > at > > org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationCha > > ins(RuntimeWireImpl.java:109) > > at > > org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.getInvoca > > tionChain(JDKInvocationHandler.java:243) > > at > > org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JD > > KInvocationHandler.java:148) > > at $Proxy17.setCurrentState(Unknown Source) > > at > > org.apache.tuscany.sca.vtest.javaapi.annotations.scope.ScopeAnnotatio > > nTestCase$CThread.run(ScopeAnnotationTestCase.java:311) > > ThreadB1->BService2 > > ThreadB2->BService9 > > atScope1 - Cleaning up > > GService->destroyGService > > atScope2 - Setting up > > 22-Apr-2008 23:59:31 > > org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntim > > e buildComposite > > WARNING: Can't find monitor extension on the classpath > > GService->initGService > > DService1->initDService > > ThreadD0->DService1 > > DService2->initDService > > ThreadD1->DService2 > > DService3->initDService > > ThreadD2->DService3 > > DService4->initDService > > ThreadD3->DService4 > > DService5->initDService > > ThreadD4->DService5 > > atScope2 - Cleaning up > > GService->destroyGService > > > > atScope3 - Setting up > > 22-Apr-2008 23:59:31 > > org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntim > > e buildComposite > > WARNING: Can't find monitor extension on the classpath > > GService->initGService > > FService1->initFService > > ThreadF0->FService1 > > ThreadF1->FService1 > > ThreadF2->FService1 > > ThreadF3->FService1 > > ThreadF4->FService1 > > atScope3 - Cleaning up > > FService1->destroyFService > > GService->destroyGService > > > > atScope4 - Setting up > > 22-Apr-2008 23:59:31 > > org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntim > > e buildComposite > > WARNING: Can't find monitor extension on the classpath > > GService->initGService > > atScope4 - Cleaning up > > GService->destroyGService > > > > atScope5 - Setting up > > 22-Apr-2008 23:59:31 > > org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntim > > e buildComposite > > WARNING: Can't find monitor extension on the classpath > > GService->initGService > > IService1->initIService > > IService1->endConversation > > IService1->destroyIService > > IService2->initIService > > IService3->initIService > > IService3->endConversation > > IService3->destroyIService > > IService4->initIService > > IService4->endConversation > > IService4->destroyIService > > IService2->endConversation > > IService2->destroyIService > > IService5->initIService > > IService5->endConversation > > IService5->destroyIService > > IService6->initIService > > instanceCounter=6 > > initCalledCounter=6 > > destroyCalledCounter=5 > > atScope5 - Cleaning up > > GService->destroyGService > > > > Tests run: 5, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.323 sec > > <<< FA > > ILURE! > > atScope1(org.apache.tuscany.sca.vtest.javaapi.annotations.scope.ScopeAnnotationT > > estCase) Time elapsed: 1.422 sec <<< FAILURE! > > junit.framework.ComparisonFailure: null expected:<[None]> but > > was:<[Unknown]> > > at junit.framework.Assert.assertEquals(Assert.java:81) > > at junit.framework.Assert.assertEquals(Assert.java:87) > > at > > org.apache.tuscany.sca.vtest.javaapi.annotations.scope.ScopeAnnotatio > > nTestCase.atScope1(ScopeAnnotationTestCase.java:93) > > 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 : > > > > Failed tests: > > > > atScope1(org.apache.tuscany.sca.vtest.javaapi.annotations.scope.ScopeAnnotatio > > nTestCase) > > > > Tests run: 5, Failures: 1, Errors: 0, Skipped: 0 > > > > [INFO] > > ------------------------------------------------------------------------ > > [ERROR] BUILD FAILURE > > [INFO] > > ------------------------------------------------------------------------ > > [INFO] There are test failures. > > > > Please refer to > > C:\Tuscany\java\sca\vtest\java-api\annotations\scope\target\sure > > fire-reports for the individual test results. > > > > > > > > Yours, Mike. > > >
