You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Ramkumar R <ra...@gmail.com> on 2008/08/22 13:16:21 UTC

Callback issue when reference is set with getter & setter method.

Hi All,
I see this strange issue, while working with callbacks using sample
callback-ws-client. Here is what i tried....

I just replaced the reference set with annotations as shown below in
MyClientImpl.java at line number 37

   @Reference
   protected MyService myService;

with the getter and setter method as shown below.

   //@Reference
   //protected MyService myService;

    protected MyService myService;

    public void setMyService(MyService theBean) {
        this.myService = theBean;
    }

    public MyService getMyService() {
        return this.myService;
    }

I was under an impression that, both means the same and should not have any
issue. But things are different in this case.

Now the sample, seems to throw an exception as shown below.

aClientMethod return from someMethod on thread Thread[main,5,main]
Aug 22, 2008 4:32:56 PM
org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceInOutSyncMessageReceiver
invokeBusinessLogic
SEVERE: No matching operation for receiveResult is found in service
MyClientComponent#myService
org.osoa.sca.ServiceRuntimeException: No matching operation for
receiveResult is found in service MyClientComponent#myService
    at
org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationChains(RuntimeWireImpl.java:178)
    at
org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChains(RuntimeWireImpl.java:109)
    at
org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChain(RuntimeWireImpl.java:115)
    at
org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:84)
    at
org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:79)
    at
org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.invoke(RuntimeWireImpl.java:138)

Is it mandatory that, only annotations should be used in case of Callbacks?

-- 
Thanks & Regards,
Ramkumar Ramalingam

Re: Callback issue when reference is set with getter & setter method.

Posted by Ramkumar R <ra...@gmail.com>.
On Fri, Aug 22, 2008 at 7:28 PM, Simon Laws <si...@googlemail.com>wrote:

>
> Hi
>
> By "Tried annotating the setter method and things seems be working." did
> you mean that it works if you annotate the setter? Your comments following
> this statement seem to suggest the opposite.
>
> Simon
>

Hi Simon,
Yeah, I meant that it works after annotating the setter method.

-- 
Thanks & Regards,
Ramkumar Ramalingam

Re: Callback issue when reference is set with getter & setter method.

Posted by Simon Laws <si...@googlemail.com>.
On Fri, Aug 22, 2008 at 2:48 PM, Ramkumar R <ra...@gmail.com> wrote:

> On Fri, Aug 22, 2008 at 5:55 PM, Vamsavardhana Reddy <c1...@gmail.com>wrote:
>
>>
>> On Fri, Aug 22, 2008 at 5:21 PM, Ramkumar R <ra...@gmail.com>wrote:
>>
>>> Hi Simon,
>>>
>>> Tried annotating the setter method and things seems be working.
>>>
>>> Did you mean that, I should use the annotation at the setter method to
>>> make it work?
>>>
>>> Like to know what should be done, if I don't want to use the annotation
>>> in any ways? As this special requirement comes from Spring Implementation.
>>>
>> It will work without annotation when MyService interface has @Remotable
>> annotation and there are no other @Reference or @Property annotations in the
>> implementation class.
>>
>>>
>>>
> Hi Vamsi,
> As mentioned, I have MyService interface with @Remotable annotation and
> there are no other @Reference or @Property annotations in the implementation
> class, but looks like the issue still exist.
>
> --
> Thanks & Regards,
> Ramkumar Ramalingam
>

Hi

By "Tried annotating the setter method and things seems be working." did you
mean that it works if you annotate the setter? Your comments following this
statement seem to suggest the opposite.

Simon

Re: Callback issue when reference is set with getter & setter method.

Posted by Vamsavardhana Reddy <c1...@gmail.com>.
The problem is in HeuristicPojoProcessor while computing the interface
contract for the reference.  Will fix it soon.

++Vamsi

On Fri, Aug 22, 2008 at 9:42 PM, Ramkumar R <ra...@gmail.com> wrote:

> On Fri, Aug 22, 2008 at 9:28 PM, Vamsavardhana Reddy <c1...@gmail.com>wrote:
>
>> That's what I missed.  HeuristicPojoProcessor is computing the reference
>> alright.  The problem seems to be somewhere else.  I suggest you create a
>> JIRA.
>>
>> ++Vamsi
>>
>>
>>
> I have raised jira TUSCANY-2562 for the same.
>
> --
> Thanks & Regards,
> Ramkumar Ramalingam
>

Re: Callback issue when reference is set with getter & setter method.

Posted by Ramkumar R <ra...@gmail.com>.
On Fri, Aug 22, 2008 at 9:28 PM, Vamsavardhana Reddy <c1...@gmail.com>wrote:

> That's what I missed.  HeuristicPojoProcessor is computing the reference
> alright.  The problem seems to be somewhere else.  I suggest you create a
> JIRA.
>
> ++Vamsi
>
>
>
I have raised jira TUSCANY-2562 for the same.

-- 
Thanks & Regards,
Ramkumar Ramalingam

Re: Callback issue when reference is set with getter & setter method.

Posted by Vamsavardhana Reddy <c1...@gmail.com>.
That's what I missed.  HeuristicPojoProcessor is computing the reference
alright.  The problem seems to be somewhere else.  I suggest you create a
JIRA.

++Vamsi

On Fri, Aug 22, 2008 at 9:15 PM, Ramkumar R <ra...@gmail.com> wrote:

> On Fri, Aug 22, 2008 at 9:00 PM, Vamsavardhana Reddy <c1...@gmail.com>wrote:
>
>> Hi Ram,
>>
>> I have made the changes as you suggested and ran the
>> CallbackClientTestCase in Eclipse.  I have verified in the debugger that the
>> reference is computed without any @Reference annotation in the class and the
>> test ran fine.  What am I missing?
>>
>> You can set a breakpoint at line 121 in HeuristicPojoProcessor and verify
>> that 'type' has a reference as expected.
>>
>> ++Vamsi
>>
>>
> Hi Vamsi,
>
> I believe, you might be missing to start the CallbackServer.java from
> callback-ws-service sample before running the CallbackClientTestCase.
>
> --
> Thanks & Regards,
> Ramkumar Ramalingam
>

Re: Callback issue when reference is set with getter & setter method.

Posted by Ramkumar R <ra...@gmail.com>.
On Fri, Aug 22, 2008 at 9:00 PM, Vamsavardhana Reddy <c1...@gmail.com>wrote:

> Hi Ram,
>
> I have made the changes as you suggested and ran the CallbackClientTestCase
> in Eclipse.  I have verified in the debugger that the reference is computed
> without any @Reference annotation in the class and the test ran fine.  What
> am I missing?
>
> You can set a breakpoint at line 121 in HeuristicPojoProcessor and verify
> that 'type' has a reference as expected.
>
> ++Vamsi
>
>
Hi Vamsi,

I believe, you might be missing to start the CallbackServer.java from
callback-ws-service sample before running the CallbackClientTestCase.

-- 
Thanks & Regards,
Ramkumar Ramalingam

Re: Callback issue when reference is set with getter & setter method.

Posted by Vamsavardhana Reddy <c1...@gmail.com>.
Hi Ram,

I have made the changes as you suggested and ran the CallbackClientTestCase
in Eclipse.  I have verified in the debugger that the reference is computed
without any @Reference annotation in the class and the test ran fine.  What
am I missing?

You can set a breakpoint at line 121 in HeuristicPojoProcessor and verify
that 'type' has a reference as expected.

++Vamsi

On Fri, Aug 22, 2008 at 8:05 PM, Ramkumar R <ra...@gmail.com> wrote:

> Hi Vamsi,
>
> To reproduce the same, please refer sample callback-ws-client. As I
> explained in my first message replace the
>
> @Reference protected MyService myService;
>
> in MyClientImpl.java at line number 37 with the getter and setter message
> as shown above.
>
> --
> Thanks & Regards,
> Ramkumar Ramalingam
>

Re: Callback issue when reference is set with getter & setter method.

Posted by Ramkumar R <ra...@gmail.com>.
Hi Vamsi,

To reproduce the same, please refer sample callback-ws-client. As I
explained in my first message replace the

@Reference protected MyService myService;

in MyClientImpl.java at line number 37 with the getter and setter message as
shown above.

-- 
Thanks & Regards,
Ramkumar Ramalingam

Re: Callback issue when reference is set with getter & setter method.

Posted by Vamsavardhana Reddy <c1...@gmail.com>.
Ram,

Can you post the entire source from your implementation class?

Vamsi

On Fri, Aug 22, 2008 at 7:18 PM, Ramkumar R <ra...@gmail.com> wrote:

> On Fri, Aug 22, 2008 at 5:55 PM, Vamsavardhana Reddy <c1...@gmail.com>wrote:
>
>>
>> On Fri, Aug 22, 2008 at 5:21 PM, Ramkumar R <ra...@gmail.com>wrote:
>>
>>> Hi Simon,
>>>
>>> Tried annotating the setter method and things seems be working.
>>>
>>> Did you mean that, I should use the annotation at the setter method to
>>> make it work?
>>>
>>> Like to know what should be done, if I don't want to use the annotation
>>> in any ways? As this special requirement comes from Spring Implementation.
>>>
>> It will work without annotation when MyService interface has @Remotable
>> annotation and there are no other @Reference or @Property annotations in the
>> implementation class.
>>
>>>
>>>
> Hi Vamsi,
> As mentioned, I have MyService interface with @Remotable annotation and
> there are no other @Reference or @Property annotations in the implementation
> class, but looks like the issue still exist.
>
> --
> Thanks & Regards,
> Ramkumar Ramalingam
>

Re: Callback issue when reference is set with getter & setter method.

Posted by Ramkumar R <ra...@gmail.com>.
On Fri, Aug 22, 2008 at 5:55 PM, Vamsavardhana Reddy <c1...@gmail.com>wrote:

>
> On Fri, Aug 22, 2008 at 5:21 PM, Ramkumar R <ra...@gmail.com> wrote:
>
>> Hi Simon,
>>
>> Tried annotating the setter method and things seems be working.
>>
>> Did you mean that, I should use the annotation at the setter method to
>> make it work?
>>
>> Like to know what should be done, if I don't want to use the annotation in
>> any ways? As this special requirement comes from Spring Implementation.
>>
> It will work without annotation when MyService interface has @Remotable
> annotation and there are no other @Reference or @Property annotations in the
> implementation class.
>
>>
>>
Hi Vamsi,
As mentioned, I have MyService interface with @Remotable annotation and
there are no other @Reference or @Property annotations in the implementation
class, but looks like the issue still exist.

-- 
Thanks & Regards,
Ramkumar Ramalingam

Re: Callback issue when reference is set with getter & setter method.

Posted by Vamsavardhana Reddy <c1...@gmail.com>.
On Fri, Aug 22, 2008 at 5:21 PM, Ramkumar R <ra...@gmail.com> wrote:

> Hi Simon,
>
> Tried annotating the setter method and things seems be working.
>
> Did you mean that, I should use the annotation at the setter method to make
> it work?
>
> Like to know what should be done, if I don't want to use the annotation in
> any ways? As this special requirement comes from Spring Implementation.
>
It will work without annotation when MyService interface has @Remotable
annotation and there are no other @Reference or @Property annotations in the
implementation class.

>
>
> On Fri, Aug 22, 2008 at 5:08 PM, Simon Laws <si...@googlemail.com>wrote:
>
>>
>>
>> On Fri, Aug 22, 2008 at 12:16 PM, Ramkumar R <ra...@gmail.com>wrote:
>>
>>> Hi All,
>>> I see this strange issue, while working with callbacks using sample
>>> callback-ws-client. Here is what i tried....
>>>
>>> I just replaced the reference set with annotations as shown below in
>>> MyClientImpl.java at line number 37
>>>
>>>    @Reference
>>>    protected MyService myService;
>>>
>>> with the getter and setter method as shown below.
>>>
>>>    //@Reference
>>>    //protected MyService myService;
>>>
>>>     protected MyService myService;
>>>
>>>     public void setMyService(MyService theBean) {
>>>         this.myService = theBean;
>>>     }
>>>
>>>     public MyService getMyService() {
>>>         return this.myService;
>>>     }
>>>
>>> I was under an impression that, both means the same and should not have
>>> any issue. But things are different in this case.
>>>
>>> Now the sample, seems to throw an exception as shown below.
>>>
>>> aClientMethod return from someMethod on thread Thread[main,5,main]
>>> Aug 22, 2008 4:32:56 PM
>>> org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceInOutSyncMessageReceiver
>>> invokeBusinessLogic
>>> SEVERE: No matching operation for receiveResult is found in service
>>> MyClientComponent#myService
>>> org.osoa.sca.ServiceRuntimeException: No matching operation for
>>> receiveResult is found in service MyClientComponent#myService
>>>     at
>>> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationChains(RuntimeWireImpl.java:178)
>>>     at
>>> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChains(RuntimeWireImpl.java:109)
>>>     at
>>> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChain(RuntimeWireImpl.java:115)
>>>     at
>>> org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:84)
>>>     at
>>> org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:79)
>>>     at
>>> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.invoke(RuntimeWireImpl.java:138)
>>>
>>> Is it mandatory that, only annotations should be used in case of
>>> Callbacks?
>>>
>>> --
>>> Thanks & Regards,
>>> Ramkumar Ramalingam
>>>
>>
>> Hi Ram
>>
>> Can you try annotating the setter method with @Reference and see what
>> happens.
>>
>> Simon
>>
>
>
>
> --
> Thanks & Regards,
> Ramkumar Ramalingam
>

Re: Callback issue when reference is set with getter & setter method.

Posted by Vamsavardhana Reddy <c1...@gmail.com>.
On Fri, Aug 22, 2008 at 5:21 PM, Ramkumar R <ra...@gmail.com> wrote:

> Hi Simon,
>
> Tried annotating the setter method and things seems be working.
>
> Did you mean that, I should use the annotation at the setter method to make
> it work?
>
That's correct.  The annotation has to be either on the field or on the
setter method.

>
>
> Like to know what should be done, if I don't want to use the annotation in
> any ways? As this special requirement comes from Spring Implementation.
>
>
> On Fri, Aug 22, 2008 at 5:08 PM, Simon Laws <si...@googlemail.com>wrote:
>
>>
>>
>> On Fri, Aug 22, 2008 at 12:16 PM, Ramkumar R <ra...@gmail.com>wrote:
>>
>>> Hi All,
>>> I see this strange issue, while working with callbacks using sample
>>> callback-ws-client. Here is what i tried....
>>>
>>> I just replaced the reference set with annotations as shown below in
>>> MyClientImpl.java at line number 37
>>>
>>>    @Reference
>>>    protected MyService myService;
>>>
>>> with the getter and setter method as shown below.
>>>
>>>    //@Reference
>>>    //protected MyService myService;
>>>
>>>     protected MyService myService;
>>>
>>>     public void setMyService(MyService theBean) {
>>>         this.myService = theBean;
>>>     }
>>>
>>>     public MyService getMyService() {
>>>         return this.myService;
>>>     }
>>>
>>> I was under an impression that, both means the same and should not have
>>> any issue. But things are different in this case.
>>>
>>> Now the sample, seems to throw an exception as shown below.
>>>
>>> aClientMethod return from someMethod on thread Thread[main,5,main]
>>> Aug 22, 2008 4:32:56 PM
>>> org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceInOutSyncMessageReceiver
>>> invokeBusinessLogic
>>> SEVERE: No matching operation for receiveResult is found in service
>>> MyClientComponent#myService
>>> org.osoa.sca.ServiceRuntimeException: No matching operation for
>>> receiveResult is found in service MyClientComponent#myService
>>>     at
>>> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationChains(RuntimeWireImpl.java:178)
>>>     at
>>> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChains(RuntimeWireImpl.java:109)
>>>     at
>>> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChain(RuntimeWireImpl.java:115)
>>>     at
>>> org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:84)
>>>     at
>>> org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:79)
>>>     at
>>> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.invoke(RuntimeWireImpl.java:138)
>>>
>>> Is it mandatory that, only annotations should be used in case of
>>> Callbacks?
>>>
>>> --
>>> Thanks & Regards,
>>> Ramkumar Ramalingam
>>>
>>
>> Hi Ram
>>
>> Can you try annotating the setter method with @Reference and see what
>> happens.
>>
>> Simon
>>
>
>
>
> --
> Thanks & Regards,
> Ramkumar Ramalingam
>

Re: Callback issue when reference is set with getter & setter method.

Posted by Ramkumar R <ra...@gmail.com>.
Hi Simon,

Tried annotating the setter method and things seems be working.

Did you mean that, I should use the annotation at the setter method to make
it work?

Like to know what should be done, if I don't want to use the annotation in
any ways? As this special requirement comes from Spring Implementation.

On Fri, Aug 22, 2008 at 5:08 PM, Simon Laws <si...@googlemail.com>wrote:

>
>
> On Fri, Aug 22, 2008 at 12:16 PM, Ramkumar R <ra...@gmail.com>wrote:
>
>> Hi All,
>> I see this strange issue, while working with callbacks using sample
>> callback-ws-client. Here is what i tried....
>>
>> I just replaced the reference set with annotations as shown below in
>> MyClientImpl.java at line number 37
>>
>>    @Reference
>>    protected MyService myService;
>>
>> with the getter and setter method as shown below.
>>
>>    //@Reference
>>    //protected MyService myService;
>>
>>     protected MyService myService;
>>
>>     public void setMyService(MyService theBean) {
>>         this.myService = theBean;
>>     }
>>
>>     public MyService getMyService() {
>>         return this.myService;
>>     }
>>
>> I was under an impression that, both means the same and should not have
>> any issue. But things are different in this case.
>>
>> Now the sample, seems to throw an exception as shown below.
>>
>> aClientMethod return from someMethod on thread Thread[main,5,main]
>> Aug 22, 2008 4:32:56 PM
>> org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceInOutSyncMessageReceiver
>> invokeBusinessLogic
>> SEVERE: No matching operation for receiveResult is found in service
>> MyClientComponent#myService
>> org.osoa.sca.ServiceRuntimeException: No matching operation for
>> receiveResult is found in service MyClientComponent#myService
>>     at
>> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationChains(RuntimeWireImpl.java:178)
>>     at
>> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChains(RuntimeWireImpl.java:109)
>>     at
>> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChain(RuntimeWireImpl.java:115)
>>     at
>> org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:84)
>>     at
>> org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:79)
>>     at
>> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.invoke(RuntimeWireImpl.java:138)
>>
>> Is it mandatory that, only annotations should be used in case of
>> Callbacks?
>>
>> --
>> Thanks & Regards,
>> Ramkumar Ramalingam
>>
>
> Hi Ram
>
> Can you try annotating the setter method with @Reference and see what
> happens.
>
> Simon
>



-- 
Thanks & Regards,
Ramkumar Ramalingam

Re: Callback issue when reference is set with getter & setter method.

Posted by Simon Laws <si...@googlemail.com>.
On Fri, Aug 22, 2008 at 12:16 PM, Ramkumar R <ra...@gmail.com> wrote:

> Hi All,
> I see this strange issue, while working with callbacks using sample
> callback-ws-client. Here is what i tried....
>
> I just replaced the reference set with annotations as shown below in
> MyClientImpl.java at line number 37
>
>    @Reference
>    protected MyService myService;
>
> with the getter and setter method as shown below.
>
>    //@Reference
>    //protected MyService myService;
>
>     protected MyService myService;
>
>     public void setMyService(MyService theBean) {
>         this.myService = theBean;
>     }
>
>     public MyService getMyService() {
>         return this.myService;
>     }
>
> I was under an impression that, both means the same and should not have any
> issue. But things are different in this case.
>
> Now the sample, seems to throw an exception as shown below.
>
> aClientMethod return from someMethod on thread Thread[main,5,main]
> Aug 22, 2008 4:32:56 PM
> org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceInOutSyncMessageReceiver
> invokeBusinessLogic
> SEVERE: No matching operation for receiveResult is found in service
> MyClientComponent#myService
> org.osoa.sca.ServiceRuntimeException: No matching operation for
> receiveResult is found in service MyClientComponent#myService
>     at
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationChains(RuntimeWireImpl.java:178)
>     at
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChains(RuntimeWireImpl.java:109)
>     at
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChain(RuntimeWireImpl.java:115)
>     at
> org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:84)
>     at
> org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:79)
>     at
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.invoke(RuntimeWireImpl.java:138)
>
> Is it mandatory that, only annotations should be used in case of Callbacks?
>
> --
> Thanks & Regards,
> Ramkumar Ramalingam
>

Hi Ram

Can you try annotating the setter method with @Reference and see what
happens.

Simon