You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "De Backer Frederik (DBB)" <Fr...@dexia.com> on 2011/11/16 12:20:19 UTC

CXF DOSGI and transactions

Hello, 
I have installed the latest single bundle release of CXF DOSGI in Apache
Aries 0.3. I have played around a bit with it and it works ok to
remotely expose a service (see blueprint definition below). However,
when I add a transaction attribute on the bean definition (in comment
below), the service is not exposed anymore. The purpose is not to do
transaction propagation from client to service but just to start a
transaction when the service method is invoked.
<service interface="dexia.osgipoc.sedm3.service.BankService" 
ref="bankServiceBean"> 
<service-properties> 
<entry key="service.exported.interfaces" value="*" /> 
<entry key="service.exported.configs" value="org.apache.cxf.ws" /> 
<entry key="org.apache.cxf.ws.address"
value="http://localhost:9090/bankservice" /> 
</service-properties> 
</service> 
<bean id="bankServiceBean"
class="dexia.osgipoc.sedm3.service.BankServiceImpl" 
activation="lazy"> 
<!-- tx:transaction method="*" value="Required" /--> 
<property name="actorService" ref="actorServiceRef" /> 
<property name="accountService" ref="accountServiceRef" /> 
</bean> 
In the console log I see (NULL for EndpointDescription): 
16-nov-2011 10:41:09
org.apache.cxf.dosgi.topologymanager.TopologyManager$2 run 
INFO: TopologyManager: export sucessful Endpoints:[Endpoint Desctiption
for Serv 
iceReference
{dexia.osgipoc.sedm3.service.BankService}={osgi.service.blueprint.c 
ompname=bankServiceBean,
org.apache.cxf.ws.address=http://localhost:9090/bankser 
vice, service.exported.interfaces=*,
service.exported.configs=org.apache.cxf.ws, 
service.id=107} 
*** EndpointDescription: **** 
---> NULL <---- 
*** Exception: null **** 
*** isClosed : false **** 
] 
While in the case that it works correctly, I see: 
INFO: TopologyManager: export sucessful Endpoints:[Endpoint Desctiption
for Serv 
iceReference
{dexia.osgipoc.sedm3.service.BankService}={osgi.service.blueprint.c 
ompname=bankServiceBean,
org.apache.cxf.ws.address=http://localhost:9090/bankser 
vice, service.exported.interfaces=*,
service.exported.configs=org.apache.cxf.ws, 
service.id=111} 
*** EndpointDescription: **** 
endpoint.framework.uuid => c39d5ef1-ca55-4141-9901-d976b0e59ed1 
endpoint.id => http://localhost:9090/bankservice 
endpoint.package.version.dexia.osgipoc.sedm3.service => 0.0.1.SNAPSHOT 
endpoint.service.id => 111 
objectClass => [Ljava.lang.String;@c67f69 
org.apache.cxf.ws.address => http://localhost:9090/bankservice 
osgi.service.blueprint.compname => bankServiceBean 
service.imported => true 
service.imported.configs => [Ljava.lang.String;@1d6e4a4 
service.intents => [Ljava.lang.String;@13ceab3 
*** Exception: null **** 
*** isClosed : false **** 
] 
Thx a lot for the support, 
Frederik. 

-------------------------------------------------------------------------
Dexia disclaimer:

http://www.dexia.com/maildisclaimer.htm
-------------------------------------------------------------------------


Re: CXF DOSGI and transactions

Posted by Sergey Beryozkin <sb...@gmail.com>.
I applied a patch submitted to the DOSGI JIRA project,
so this should be fixed on the trunk
Sergey
On 16/11/11 14:29, De Backer Frederik (DBB) wrote:
> Hi,
>
> As far as I can tell, Aries doesn't use AOP or CGLIB to proxy the
> service. Instead they use an interceptor mechanism: a Java class that
> contains methods to define the behaviour to be executed before and after
> the service invocation is done.
>
> Kr,
>
> Frederik.
>
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
> Sent: woensdag 16 november 2011 14:15
> To: users@cxf.apache.org
> Subject: Re: CXF DOSGI and transactions
>
> Hi
> On 16/11/11 11:20, De Backer Frederik (DBB) wrote:
>> Hello,
>> I have installed the latest single bundle release of CXF DOSGI in
>> Apache Aries 0.3. I have played around a bit with it and it works ok
>> to remotely expose a service (see blueprint definition below).
>> However, when I add a transaction attribute on the bean definition (in
>
>> comment below), the service is not exposed anymore. The purpose is not
>
>> to do transaction propagation from client to service but just to start
>
>> a transaction when the service method is invoked.
>> <service interface="dexia.osgipoc.sedm3.service.BankService"
>> ref="bankServiceBean">
>> <service-properties>
>> <entry key="service.exported.interfaces" value="*" />  <entry
>> key="service.exported.configs" value="org.apache.cxf.ws" />  <entry
>> key="org.apache.cxf.ws.address"
>> value="http://localhost:9090/bankservice" />  </service-properties>
>> </service>  <bean id="bankServiceBean"
>> class="dexia.osgipoc.sedm3.service.BankServiceImpl"
>> activation="lazy">
>> <!-- tx:transaction method="*" value="Required" /-->  <property
>> name="actorService" ref="actorServiceRef" />  <property
>> name="accountService" ref="accountServiceRef" />  </bean>  In the
>> console log I see (NULL for EndpointDescription):
>> 16-nov-2011 10:41:09
>> org.apache.cxf.dosgi.topologymanager.TopologyManager$2 run
>> INFO: TopologyManager: export sucessful Endpoints:[Endpoint
>> Desctiption for Serv iceReference
>> {dexia.osgipoc.sedm3.service.BankService}={osgi.service.blueprint.c
>> ompname=bankServiceBean,
>> org.apache.cxf.ws.address=http://localhost:9090/bankser
>> vice, service.exported.interfaces=*,
>> service.exported.configs=org.apache.cxf.ws,
>> service.id=107}
>> *** EndpointDescription: ****
>> --->   NULL<----
>> *** Exception: null ****
>> *** isClosed : false ****
>> ]
>>
>
> It is most likely a bug to do with DOSGi CXF not able to get to the
> actual interface class given that Aries must be proxifying it..
>
> CXF has utilities to deal with such cases but I'm wondering, how the
> proxification is done in this case, if Spring AOP or CGLIB is used then
> a fix may be applied, can you create a simple test case somehow ?
>
> As a workaround, please try experimenting with forcing CGLIB be used
>
> Cheers, Sergey
>
> While in the case that it works correctly, I see:
>> INFO: TopologyManager: export sucessful Endpoints:[Endpoint
>> Desctiption for Serv iceReference
>> {dexia.osgipoc.sedm3.service.BankService}={osgi.service.blueprint.c
>> ompname=bankServiceBean,
>> org.apache.cxf.ws.address=http://localhost:9090/bankser
>> vice, service.exported.interfaces=*,
>> service.exported.configs=org.apache.cxf.ws,
>> service.id=111}
>> *** EndpointDescription: ****
>> endpoint.framework.uuid =>   c39d5ef1-ca55-4141-9901-d976b0e59ed1
>> endpoint.id =>   http://localhost:9090/bankservice
>> endpoint.package.version.dexia.osgipoc.sedm3.service =>
>> 0.0.1.SNAPSHOT endpoint.service.id =>   111 objectClass =>
>> [Ljava.lang.String;@c67f69 org.apache.cxf.ws.address =>
>> http://localhost:9090/bankservice osgi.service.blueprint.compname =>
>> bankServiceBean service.imported =>   true service.imported.configs =>
>
>> [Ljava.lang.String;@1d6e4a4 service.intents =>
>> [Ljava.lang.String;@13ceab3
>> *** Exception: null ****
>> *** isClosed : false ****
>> ]
>> Thx a lot for the support,
>> Frederik.
>>
>> ----------------------------------------------------------------------
>> ---
>> Dexia disclaimer:
>>
>> http://www.dexia.com/maildisclaimer.htm
>> ----------------------------------------------------------------------
>> ---
>>
>>
>
> -------------------------------------------------------------------------
> Dexia disclaimer:
>
> http://www.dexia.com/maildisclaimer.htm
> -------------------------------------------------------------------------
>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

RE: CXF DOSGI and transactions

Posted by "De Backer Frederik (DBB)" <Fr...@dexia.com>.
Hi,

As far as I can tell, Aries doesn't use AOP or CGLIB to proxy the
service. Instead they use an interceptor mechanism: a Java class that
contains methods to define the behaviour to be executed before and after
the service invocation is done. 

Kr,

Frederik.   

-----Original Message-----
From: Sergey Beryozkin [mailto:sberyozkin@gmail.com] 
Sent: woensdag 16 november 2011 14:15
To: users@cxf.apache.org
Subject: Re: CXF DOSGI and transactions

Hi
On 16/11/11 11:20, De Backer Frederik (DBB) wrote:
> Hello,
> I have installed the latest single bundle release of CXF DOSGI in 
> Apache Aries 0.3. I have played around a bit with it and it works ok 
> to remotely expose a service (see blueprint definition below). 
> However, when I add a transaction attribute on the bean definition (in

> comment below), the service is not exposed anymore. The purpose is not

> to do transaction propagation from client to service but just to start

> a transaction when the service method is invoked.
> <service interface="dexia.osgipoc.sedm3.service.BankService"
> ref="bankServiceBean">
> <service-properties>
> <entry key="service.exported.interfaces" value="*" /> <entry 
> key="service.exported.configs" value="org.apache.cxf.ws" /> <entry 
> key="org.apache.cxf.ws.address"
> value="http://localhost:9090/bankservice" /> </service-properties> 
> </service> <bean id="bankServiceBean"
> class="dexia.osgipoc.sedm3.service.BankServiceImpl"
> activation="lazy">
> <!-- tx:transaction method="*" value="Required" /--> <property 
> name="actorService" ref="actorServiceRef" /> <property 
> name="accountService" ref="accountServiceRef" /> </bean> In the 
> console log I see (NULL for EndpointDescription):
> 16-nov-2011 10:41:09
> org.apache.cxf.dosgi.topologymanager.TopologyManager$2 run
> INFO: TopologyManager: export sucessful Endpoints:[Endpoint 
> Desctiption for Serv iceReference 
> {dexia.osgipoc.sedm3.service.BankService}={osgi.service.blueprint.c
> ompname=bankServiceBean,
> org.apache.cxf.ws.address=http://localhost:9090/bankser
> vice, service.exported.interfaces=*,
> service.exported.configs=org.apache.cxf.ws,
> service.id=107}
> *** EndpointDescription: ****
> --->  NULL<----
> *** Exception: null ****
> *** isClosed : false ****
> ]
>

It is most likely a bug to do with DOSGi CXF not able to get to the
actual interface class given that Aries must be proxifying it..

CXF has utilities to deal with such cases but I'm wondering, how the
proxification is done in this case, if Spring AOP or CGLIB is used then
a fix may be applied, can you create a simple test case somehow ?

As a workaround, please try experimenting with forcing CGLIB be used

Cheers, Sergey

While in the case that it works correctly, I see:
> INFO: TopologyManager: export sucessful Endpoints:[Endpoint 
> Desctiption for Serv iceReference 
> {dexia.osgipoc.sedm3.service.BankService}={osgi.service.blueprint.c
> ompname=bankServiceBean,
> org.apache.cxf.ws.address=http://localhost:9090/bankser
> vice, service.exported.interfaces=*,
> service.exported.configs=org.apache.cxf.ws,
> service.id=111}
> *** EndpointDescription: ****
> endpoint.framework.uuid =>  c39d5ef1-ca55-4141-9901-d976b0e59ed1
> endpoint.id =>  http://localhost:9090/bankservice 
> endpoint.package.version.dexia.osgipoc.sedm3.service =>  
> 0.0.1.SNAPSHOT endpoint.service.id =>  111 objectClass =>  
> [Ljava.lang.String;@c67f69 org.apache.cxf.ws.address =>  
> http://localhost:9090/bankservice osgi.service.blueprint.compname =>  
> bankServiceBean service.imported =>  true service.imported.configs =>

> [Ljava.lang.String;@1d6e4a4 service.intents =>  
> [Ljava.lang.String;@13ceab3
> *** Exception: null ****
> *** isClosed : false ****
> ]
> Thx a lot for the support,
> Frederik.
>
> ----------------------------------------------------------------------
> ---
> Dexia disclaimer:
>
> http://www.dexia.com/maildisclaimer.htm
> ----------------------------------------------------------------------
> ---
>
>

-------------------------------------------------------------------------
Dexia disclaimer:

http://www.dexia.com/maildisclaimer.htm
-------------------------------------------------------------------------



Re: CXF DOSGI and transactions

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 16/11/11 11:20, De Backer Frederik (DBB) wrote:
> Hello,
> I have installed the latest single bundle release of CXF DOSGI in Apache
> Aries 0.3. I have played around a bit with it and it works ok to
> remotely expose a service (see blueprint definition below). However,
> when I add a transaction attribute on the bean definition (in comment
> below), the service is not exposed anymore. The purpose is not to do
> transaction propagation from client to service but just to start a
> transaction when the service method is invoked.
> <service interface="dexia.osgipoc.sedm3.service.BankService"
> ref="bankServiceBean">
> <service-properties>
> <entry key="service.exported.interfaces" value="*" />
> <entry key="service.exported.configs" value="org.apache.cxf.ws" />
> <entry key="org.apache.cxf.ws.address"
> value="http://localhost:9090/bankservice" />
> </service-properties>
> </service>
> <bean id="bankServiceBean"
> class="dexia.osgipoc.sedm3.service.BankServiceImpl"
> activation="lazy">
> <!-- tx:transaction method="*" value="Required" /-->
> <property name="actorService" ref="actorServiceRef" />
> <property name="accountService" ref="accountServiceRef" />
> </bean>
> In the console log I see (NULL for EndpointDescription):
> 16-nov-2011 10:41:09
> org.apache.cxf.dosgi.topologymanager.TopologyManager$2 run
> INFO: TopologyManager: export sucessful Endpoints:[Endpoint Desctiption
> for Serv
> iceReference
> {dexia.osgipoc.sedm3.service.BankService}={osgi.service.blueprint.c
> ompname=bankServiceBean,
> org.apache.cxf.ws.address=http://localhost:9090/bankser
> vice, service.exported.interfaces=*,
> service.exported.configs=org.apache.cxf.ws,
> service.id=107}
> *** EndpointDescription: ****
> --->  NULL<----
> *** Exception: null ****
> *** isClosed : false ****
> ]
>

It is most likely a bug to do with DOSGi CXF not able to get to the 
actual interface class given that Aries must be proxifying it..

CXF has utilities to deal with such cases but I'm wondering, how the 
proxification is done in this case, if Spring AOP or CGLIB is used
then a fix may be applied, can you create a simple test case somehow ?

As a workaround, please try experimenting with forcing CGLIB be used

Cheers, Sergey

While in the case that it works correctly, I see:
> INFO: TopologyManager: export sucessful Endpoints:[Endpoint Desctiption
> for Serv
> iceReference
> {dexia.osgipoc.sedm3.service.BankService}={osgi.service.blueprint.c
> ompname=bankServiceBean,
> org.apache.cxf.ws.address=http://localhost:9090/bankser
> vice, service.exported.interfaces=*,
> service.exported.configs=org.apache.cxf.ws,
> service.id=111}
> *** EndpointDescription: ****
> endpoint.framework.uuid =>  c39d5ef1-ca55-4141-9901-d976b0e59ed1
> endpoint.id =>  http://localhost:9090/bankservice
> endpoint.package.version.dexia.osgipoc.sedm3.service =>  0.0.1.SNAPSHOT
> endpoint.service.id =>  111
> objectClass =>  [Ljava.lang.String;@c67f69
> org.apache.cxf.ws.address =>  http://localhost:9090/bankservice
> osgi.service.blueprint.compname =>  bankServiceBean
> service.imported =>  true
> service.imported.configs =>  [Ljava.lang.String;@1d6e4a4
> service.intents =>  [Ljava.lang.String;@13ceab3
> *** Exception: null ****
> *** isClosed : false ****
> ]
> Thx a lot for the support,
> Frederik.
>
> -------------------------------------------------------------------------
> Dexia disclaimer:
>
> http://www.dexia.com/maildisclaimer.htm
> -------------------------------------------------------------------------
>
>