You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Raymond Feng <en...@gmail.com> on 2006/10/02 00:39:17 UTC

Re: NoClassDefFoundError, apparently in Axis2

Hi, Ignacio.

I think the "helloworldwsclient" callback test case is different than the 
"business" callback cases covered by the SCA spec.

For bidirectional interfaces, the initiator of the callback is in the 
business logic (with the help of the container to inject the callback proxy 
based on @Callback annotationd) and no system level correlation is required.

But in your case, the sequence is "comp1.ref --> composte.ref  (w/ axis2 
binding which supports async WS invocations)  --> Axis2 async client --> 
SOAP/HTTP". The Web Service invocation is made asynchronously and the 
reponse will come later to trigger the callback. The initiator of the 
callback is the reference with Axis2 binding (OMElement representation for 
the previous reponse) and the system has to correlate the previous operation 
to a matching callback operation whose input type is compatible with the 
output type of the original operation. I don't think the SCA spec talks 
about this case, i.e., references or services with bindings capable of 
asynchronous communications.

Thanks,
Raymond

----- Original Message ----- 
From: "Ignacio Silva-Lepe" <is...@verizon.net>
To: <tu...@ws.apache.org>
Sent: Saturday, September 30, 2006 7:07 AM
Subject: Re: NoClassDefFoundError, apparently in Axis2


> Some more thoughts on this.
>
> The specs (assembly and C&I) do not seem to be very explicit about what 
> should happen with an interface that is annotated as @Callback and that 
> defines more than one method. But notice that if this is the case then the 
> next question pertains to a previous question, which is what happens when 
> the callback interface (the one in the annotation, not the annotated one) 
> has more than one method.
>
> Let i1 be an intrerface annotated with @Callback(c1), where c1 is the 
> callback interface. The simplest case is when both i1 and c1 have only one 
> method. If i1 has > 1 methods there are two cases: c1 has only one method, 
> and c1 has > 1 methods. The first case is the case at hand. Notice that 
> one last case is where i1 has one method and c1 has > 1, but that really 
> is a special case of the second case.
>
> The second case is the one we had asked about before, how do we associate 
> methods in c1 with methods in i1. Again, the specs are not explicit about 
> this. In general, this association may require knowledge about the 
> implementation of i1. That is, i1Impl will get an injected instance of c1 
> which then it will use in its method(s) to make callback invocations. 
> Which c1 method is invoked in i1 is arbitrary and we may have to resort to 
> non-trivial introspection to figure it out. Btw, nontice that this case 
> also includes the first case.
>
> So it seems we have a choice of how to interpret the specs.
> 1- The simplest choice is to assume i1 and c1 both have only one method.
> 2- We can assume that c1 has only one method (case at hand) and introspect 
> each method in i1 to figure out which is intended as async with callback 
> and which is not. In addition, here we also have a choice of whether to 
> treat non-callback methods as sync or async.
> 3- We can try go for the general case.
>
> My vote is to go with choice 1, which is what I have been assuming so far, 
> at least for the coming release. And if we don't feel comfortable with 
> this choice long term, then we can try for choice 2 or maybe even choice 
> 3, if we can make sense of it.
> It would also be useful to try to go back to the spec collaboration to try 
> to calrify the intent.
>
> Thoughts?
>
> ----- Original Message ----- 
> From: "Ignacio Silva-Lepe" <is...@verizon.net>
> To: <tu...@ws.apache.org>
> Sent: Friday, September 29, 2006 8:58 PM
> Subject: Re: NoClassDefFoundError, apparently in Axis2
>
>
>> Yeah, one option could be to assume that if an interface is annotated as 
>> having a callback, then all of its methods need to be one-way. 
>> Alternatively, we may need to introspect each method. If a method has a 
>> return value then it follows that it does not have a callback. But does 
>> it get invoked asynchronously?
>>
>> For now the sample could be tweaked further, or perhaps separated into a 
>> new sample, which I was trying to avoid.
>>
>> ----- Original Message ----- 
>> From: "Raymond Feng" <en...@gmail.com>
>> To: <tu...@ws.apache.org>
>> Sent: Friday, September 29, 2006 6:51 PM
>> Subject: Re: NoClassDefFoundError, apparently in Axis2
>>
>>> Hi, Ignacio.
>>>
>>> I can now reach a point that we use the Axis2 client to invokes the WS 
>>> asynchronously (operationClient.invoke(false)) but it fails after that 
>>> because the DataBindingInterceptor excepts a synchronous response but a 
>>> "ImmutableMessage" is returned instead. So the question is that how do 
>>> we tell if a given operation is invoked asynchronously or not.
>>>
>>> For the test case, we have the following interface:
>>>
>>> @Callback(HelloWorldCallback.class)
>>> public interface HelloWorldService {
>>>    public String getGreetings(String name);
>>>
>>>    @DataType(name="commonj.sdo.DataObject")
>>>    public String getGreetings1(DataObject name);
>>>
>>>    public void getGreetingsWithCallback(String name);
>>> }
>>>
>>> It seems that getGreetings(...) goes to the async path in my debugging.
>>>
>>> Please help me understand here.
>>>
>>> Thanks,
>>> Raymond
>>>
>>>
>>> ----- Original Message ----- 
>>> From: "Ignacio Silva-Lepe" <is...@verizon.net>
>>> To: "Tuscany Dev" <tu...@ws.apache.org>
>>> Sent: Friday, September 29, 2006 2:08 PM
>>> Subject: NoClassDefFoundError, apparently in Axis2
>>>
>>>
>>> I am trying to run the hellowordwsclient sample by changing the bound 
>>> reference to use an interface.java, with which it runs ok. But if I then 
>>> add a callbackInterface I get the error below.
>>> By using a callbackInterface, an Axis2AsyncTargetInvoker is chosen that 
>>> calls Axis2's operationClient.execute(false), i.e. non-blocking. Without 
>>> the callbackInterface an Axis2TargetInvoker is chosen which calls 
>>> operationClient.execute(true). So it seems as if trying to using a 
>>> non-blocking operation client execute triggers the error.
>>> I have to wonder whether this may be an Axis2 dependency that has not 
>>> been set up.
>>> Any ideas?
>>>
>>> -------------------------------------------------------
>>> T E S T S
>>> -------------------------------------------------------
>>> Running helloworld.HelloWorldWSClientTestCase
>>> log4j:WARN No appenders could be found for logger 
>>> (org.apache.axiom.om.util.StAX
>>> Utils).
>>> log4j:WARN Please initialize the log4j system properly.
>>> org.apache.tuscany.spi.wire.InvocationRuntimeException: 
>>> java.lang.NoClassDefFoun
>>> dError: edu/emory/mathcs/backport/java/util/concurrent/BlockingQueue
>>>        at 
>>> org.apache.tuscany.core.databinding.impl.DataBindingInteceptor.invoke
>>> (DataBindingInteceptor.java:76)
>>>        at 
>>> org.apache.tuscany.core.wire.BridgingInterceptor.invoke(BridgingInter
>>> ceptor.java:41)
>>>        at 
>>> org.apache.tuscany.core.databinding.impl.DataBindingInteceptor.invoke
>>> (DataBindingInteceptor.java:71)
>>>        at 
>>> org.apache.tuscany.core.wire.AbstractOutboundInvocationHandler.invoke
>>> (AbstractOutboundInvocationHandler.java:65)
>>>        at 
>>> org.apache.tuscany.core.wire.jdk.JDKOutboundInvocationHandler.invoke(
>>> JDKOutboundInvocationHandler.java:121)
>>>        at $Proxy20.getGreetings(Unknown Source)
>>>        at 
>>> helloworld.HelloWorldServiceComponent.getGreetings(HelloWorldServiceC
>>> omponent.java:39)
>>>        at 
>>> helloworld.HelloWorldWSClientTestCase.testWSClient(HelloWorldWSClient
>>> TestCase.java:43)
>>>        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 junit.framework.TestCase.runTest(TestCase.java:154)
>>>        at junit.framework.TestCase.runBare(TestCase.java:127)
>>>        at junit.framework.TestResult$1.protect(TestResult.java:106)
>>>        at junit.framework.TestResult.runProtected(TestResult.java:124)
>>>        at junit.framework.TestResult.run(TestResult.java:109)
>>>        at junit.framework.TestCase.run(TestCase.java:118)
>>>        at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>>        at junit.framework.TestSuite.run(TestSuite.java:203)
>>>        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.junit.JUnitTestSet.execute(JUnitTestSet.jav
>>> a:210)
>>>        at 
>>> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTes
>>> tSet(AbstractDirectoryTestSuite.java:135)
>>>        at 
>>> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(Ab
>>> stractDirectoryTestSuite.java:122)
>>>        at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
>>>        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:269)
>>>        at 
>>> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.j
>>> ava:788)
>>> Caused by: java.lang.NoClassDefFoundError: 
>>> edu/emory/mathcs/backport/java/util/c
>>> oncurrent/BlockingQueue
>>>        at 
>>> org.apache.axis2.context.ConfigurationContext.getThreadPool(Configura
>>> tionContext.java:296)
>>>        at 
>>> org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAx
>>> isOperation.java:306)
>>>        at 
>>> org.apache.tuscany.binding.axis2.Axis2AsyncTargetInvoker.invokeTarget
>>> (Axis2AsyncTargetInvoker.java:58)
>>>        at 
>>> org.apache.tuscany.binding.axis2.Axis2AsyncTargetInvoker.invoke(Axis2
>>> AsyncTargetInvoker.java:70)
>>>        at 
>>> org.apache.tuscany.core.wire.InvokerInterceptor.invoke(InvokerInterce
>>> ptor.java:44)
>>>        at 
>>> org.apache.tuscany.core.databinding.impl.DataBindingInteceptor.invoke
>>> (DataBindingInteceptor.java:71)
>>>        ... 33 more
>>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.032 
>>> sec <<< FA
>>> ILURE!
>>>
>>> Results :
>>>
>>> Tests in error:
>>>  testWSClient(helloworld.HelloWorldWSClientTestCase)
>>>
>>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org