Re: CXF Spring Transactions

2008-03-05 Thread Michael McCaskill

I have found the root of the problem, which fortunately isn't CXF related but
a Spring-AOP (AspectJ) problem. Thanks.
-- 
View this message in context: 
http://www.nabble.com/CXF---Spring-Transactions-tp15814197p15850223.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: CXF Spring Transactions

2008-03-05 Thread Michael McCaskill

I was having an Aspect do some things using a @Before annotation. It seems it
was interfering with the flow of things. It turns out this happens with
Spring-WS as well, which is how I found out. I simply disabled the aspect
and it is working (for the most part). I just have to fix my aspect.


David Castañeda wrote:
 
 Can you explain it?
 
 how is your configuration now?
 
 -- 
 David Castañeda R.
 
 

-- 
View this message in context: 
http://www.nabble.com/CXF---Spring-Transactions-tp15814197p15852485.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: CXF Spring Transactions

2008-03-05 Thread David Castañeda
Can you explain it?

how is your configuration now?

On Wed, Mar 5, 2008 at 8:36 AM, Michael McCaskill [EMAIL PROTECTED]
wrote:


 I have found the root of the problem, which fortunately isn't CXF related
 but
 a Spring-AOP (AspectJ) problem. Thanks.
 --
 View this message in context:
 http://www.nabble.com/CXF---Spring-Transactions-tp15814197p15850223.html
 Sent from the cxf-user mailing list archive at Nabble.com.




-- 
David Castañeda R.


Re: CXF Spring Transactions

2008-03-04 Thread Michael McCaskill

I have interfaces with @WebService annotations. Each implementation
implements the interfaces, and each has @WebService(endPointInterface),
along with @Transactional from Spring. Is that enough information?


Glen Mazza-2 wrote:
 
 Can you mock out the web service calls to confirm that it is CXF eating
 up your DBCP pool and nothing something else?
 
 Glen
 
 Am Montag, den 03.03.2008, 13:19 -0800 schrieb Michael McCaskill:
 I'm coming from Spring-Webservices. I like that CXF supports
 contract-last
 since I'm in a prototype, rapid development phase for my work project.
 But
 I've noticed that weird things happen when using CXF with Spring
 Transactions.
 
 It appears that after so many web service calls, the DBCP pool is
 exhausted
 and connections aren't returned. This wasn't happening with
 Spring-Webservices. I've tried the 2.1-incubator-SNAPSHOT as well. It
 needs
 to be said that I am filtering out the Spring-2.0.6 dependencies and
 opting
 for 2.5. I'm using Spring's @Transactional annotation, JAXB,
 JaxWsProxyFactoryBean on client, jaxws:endpoint on server, Hibernate 3.1
 and
 Oracle 9.2.0.8.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/CXF---Spring-Transactions-tp15814197p15833351.html
Sent from the cxf-user mailing list archive at Nabble.com.



CXF Spring Transactions

2008-03-03 Thread Michael McCaskill

I'm coming from Spring-Webservices. I like that CXF supports contract-last
since I'm in a prototype, rapid development phase for my work project. But
I've noticed that weird things happen when using CXF with Spring
Transactions.

It appears that after so many web service calls, the DBCP pool is exhausted
and connections aren't returned. This wasn't happening with
Spring-Webservices. I've tried the 2.1-incubator-SNAPSHOT as well. It needs
to be said that I am filtering out the Spring-2.0.6 dependencies and opting
for 2.5. I'm using Spring's @Transactional annotation, JAXB,
JaxWsProxyFactoryBean on client, jaxws:endpoint on server, Hibernate 3.1 and
Oracle 9.2.0.8.
-- 
View this message in context: 
http://www.nabble.com/CXF---Spring-Transactions-tp15814197p15814197.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: CXF Spring Transactions

2008-03-03 Thread Glen Mazza
Can you mock out the web service calls to confirm that it is CXF eating
up your DBCP pool and nothing something else?

Glen

Am Montag, den 03.03.2008, 13:19 -0800 schrieb Michael McCaskill:
 I'm coming from Spring-Webservices. I like that CXF supports contract-last
 since I'm in a prototype, rapid development phase for my work project. But
 I've noticed that weird things happen when using CXF with Spring
 Transactions.
 
 It appears that after so many web service calls, the DBCP pool is exhausted
 and connections aren't returned. This wasn't happening with
 Spring-Webservices. I've tried the 2.1-incubator-SNAPSHOT as well. It needs
 to be said that I am filtering out the Spring-2.0.6 dependencies and opting
 for 2.5. I'm using Spring's @Transactional annotation, JAXB,
 JaxWsProxyFactoryBean on client, jaxws:endpoint on server, Hibernate 3.1 and
 Oracle 9.2.0.8.



Re: cxf-spring-transactions anybody get it working?

2007-08-07 Thread Brad Harper
I'll be glad to write a testcase for you.. .problem is, I don't know what
format you need?  Are you talking about a JUnit testcase?  Really, all you
have to do to duplicate the issue is write any Spring based JAXws service:

 !-- Local --
bean id=TestServiceImpl class=
com.gdservices.service.thirdparty.TestServiceImpl
property name=daoFactory
ref bean=hibernateDAOFactory/
/property
/bean
!-- SOAP --
jaxws:endpoint
  id=testServiceSoap
  implementor=#TestServiceImpl
  address=/testService /

And add this snippet to your config:

aop:config
aop:advisor id=serviceTx advice-ref=txAdvice
pointcut=execution(* *..thirdparty..*.*(..)) order=0/
/aop:config

tx:advice id=txAdvice
tx:attributes
tx:method name=find* read-only=true/
tx:method name=get* read-only=true/
tx:method name=*/
/tx:attributes
/tx:advice

Note the pointcut reference to 'thirdparty'... just replace that with
whatever package your service is in.  Additionally, you'll need to add the
aop schema refs to your beans tag.  Here they are if you need them:

beans  xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:aop=http://www.springframework.org/schema/aop;
xmlns:tx=http://www.springframework.org/schema/tx;
xmlns:jaxws=http://cxf.apache.org/jaxws;
xsi:schemaLocation=http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd;

Once you add the AOP config snippet above, your services will fail because
CXF is attempting to generate the wsdl off the proxied class.. .not the real
impl or service.   I think Dan pointed out that the annotations get lost...

Regards,
Brad

On 8/6/07, Daniel Kulp [EMAIL PROTECTED] wrote:


 Could one of you send me a simple testcase again?   I think I had one at
 one point (from Brad maybe?) but I cannot seem to find it now.

 I should have a little time tomorrow or Wednesday to look into it if I
 can get a simple testcase.  I'm not at all familiar with the spring
 transaction stuff.Actualy, if a testcase could be attached to
 CXF-874 for tracking purposes, that would be great.

 Thanks!
 Dan

 On Monday 06 August 2007 18:27, Brad Harper wrote:
  No.  Neither work for me.
 
  On 8/6/07, Jeremy Isikoff [EMAIL PROTECTED] wrote:
   sorry to ask again but did anybody get either of those fixes for the
   spring transactions working on an jaxws:endpoint or jaxws:server?
  
  
  
   Jeremy Isikoff
  
  
  
  
   
   Got a little couch potato?
   Check out fun summer activities for kids.
  
   http://search.yahoo.com/search?fr=oni_on_mailp=summer+activities+fo
  r+kidscs=bz

 --
 J. Daniel Kulp
 Principal Engineer
 IONA
 P: 781-902-8727C: 508-380-7194
 [EMAIL PROTECTED]
 http://www.dankulp.com/blog



RE: cxf-spring-transactions anybody get it working?

2007-08-07 Thread Christopher Moesel
Hi Dan,

The txAdvice is looking for a transaction manager.  Since the spring.xml
doesn't give the txAdvice a reference to a transaction manager, it
defaults to looking for a bean with id transactionManager-- which your
spring.xml does not have.  

Spring can allow your transactions to be managed by JTA, Hibernate,
JDBC, etc.  The transaction manager you configure tells it which to use.

If you're running this in an app server that supports JTA, then you can
add this to the spring.xml:
bean id=transactionManager
 
class=org.springframework.transaction.jta.JtaTransactionManager/

I think you can also just create a stub that implements
org.springframework.transaction.PlatformTransactionManager and use that
instead:
bean id=transactionManager
  class=org.apache.cxf.test.MockTransactionManager/

You can check out the Spring docs for more info:
http://static.springframework.org/spring/docs/2.0.x/reference/transactio
n.html

-Chris

-Original Message-
From: Daniel Kulp [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 07, 2007 10:17 AM
To: cxf-user@incubator.apache.org
Cc: Brad Harper
Subject: Re: cxf-spring-transactions anybody get it working?



On Tuesday 07 August 2007 08:57, Brad Harper wrote:
 I'll be glad to write a testcase for you.. .problem is, I don't know
 what format you need? 

A standalone main method thing is perfectly OK as well.  The issue
will
probably what other jars do I need?

 Are you talking about a JUnit testcase?  
 Really, all you have to do to duplicate the issue is write any Spring
 based JAXws service:

I tried doing this to our 
  systests/src/test/java/org/apache/cxf/systest/servlet/spring.xml

as well as changed the pom.xml to grab the spring everything jar 
as well as aspectjweaver.   That now yields:

org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'txAdvice': 
Cannot resolve reference to bean 'transactionManager' while setting bean
property 'transactionManager'; 
nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean
named 'transactionManager' is defined
Caused by: 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean
named 'transactionManager' is defined

I'm probably missing a jar or something.   Not really sure.   Any ideas?

Dan






  !-- Local --
 bean id=TestServiceImpl class=
 com.gdservices.service.thirdparty.TestServiceImpl
 property name=daoFactory
 ref bean=hibernateDAOFactory/
 /property
 /bean
 !-- SOAP --
 jaxws:endpoint
   id=testServiceSoap
   implementor=#TestServiceImpl
   address=/testService /

 And add this snippet to your config:

 aop:config
 aop:advisor id=serviceTx advice-ref=txAdvice
 pointcut=execution(* *..thirdparty..*.*(..)) order=0/
 /aop:config

 tx:advice id=txAdvice
 tx:attributes
 tx:method name=find* read-only=true/
 tx:method name=get* read-only=true/
 tx:method name=*/
 /tx:attributes
 /tx:advice

 Note the pointcut reference to 'thirdparty'... just replace that with
 whatever package your service is in.  Additionally, you'll need to add
 the aop schema refs to your beans tag.  Here they are if you need
 them:

 beans  xmlns=http://www.springframework.org/schema/beans;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:aop=http://www.springframework.org/schema/aop;
 xmlns:tx=http://www.springframework.org/schema/tx;
 xmlns:jaxws=http://cxf.apache.org/jaxws;

 xsi:schemaLocation=http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
 http://www.springframework.org/schema/aop
 http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
 http://www.springframework.org/schema/tx
 http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
 http://cxf.apache.org/jaxws
 http://cxf.apache.org/schemas/jaxws.xsd;

 Once you add the AOP config snippet above, your services will fail
 because CXF is attempting to generate the wsdl off the proxied class..
 .not the real impl or service.   I think Dan pointed out that the
 annotations get lost...

 Regards,
 Brad

 On 8/6/07, Daniel Kulp [EMAIL PROTECTED] wrote:
  Could one of you send me a simple testcase again?   I think I had
  one at one point (from Brad maybe?) but I cannot seem to find it
  now.
 
  I should have a little time tomorrow or Wednesday to look into it if
  I can get a simple testcase.  I'm not at all familiar with the
  spring transaction stuff.Actualy, if a testcase could be
  attached to CXF-874 for tracking purposes, that would be great.
 
  Thanks!
  Dan
 
  On Monday 06 August 2007 18:27, Brad Harper wrote:
   No.  Neither work for me.
  
   On 8/6/07, Jeremy Isikoff [EMAIL PROTECTED] wrote:
sorry to ask again but did anybody get either of those fixes for
the spring transactions working

Re: cxf-spring-transactions anybody get it working?

2007-08-07 Thread Daniel Kulp

Chris,

Thanks!   This helped a ton.   I'm now getting:
org.apache.cxf.service.factory.ServiceConstructionException: Could not 
find definition for service $Proxy11Service.
at 
org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:114)

Which is the error I think I'm trying to diagnose.   :-)


Dan




On Tuesday 07 August 2007 11:13, Christopher Moesel wrote:
 Hi Dan,

 The txAdvice is looking for a transaction manager.  Since the
 spring.xml doesn't give the txAdvice a reference to a transaction
 manager, it defaults to looking for a bean with id
 transactionManager-- which your spring.xml does not have.

 Spring can allow your transactions to be managed by JTA, Hibernate,
 JDBC, etc.  The transaction manager you configure tells it which to
 use.

 If you're running this in an app server that supports JTA, then you
 can add this to the spring.xml:
 bean id=transactionManager

 class=org.springframework.transaction.jta.JtaTransactionManager/

 I think you can also just create a stub that implements
 org.springframework.transaction.PlatformTransactionManager and use
 that instead:
 bean id=transactionManager
   class=org.apache.cxf.test.MockTransactionManager/

 You can check out the Spring docs for more info:
 http://static.springframework.org/spring/docs/2.0.x/reference/transact
io n.html

 -Chris

 -Original Message-
 From: Daniel Kulp [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, August 07, 2007 10:17 AM
 To: cxf-user@incubator.apache.org
 Cc: Brad Harper
 Subject: Re: cxf-spring-transactions anybody get it working?

 On Tuesday 07 August 2007 08:57, Brad Harper wrote:
  I'll be glad to write a testcase for you.. .problem is, I don't know
  what format you need?

 A standalone main method thing is perfectly OK as well.  The issue
 will
 probably what other jars do I need?

  Are you talking about a JUnit testcase?
  Really, all you have to do to duplicate the issue is write any
  Spring based JAXws service:

 I tried doing this to our
   systests/src/test/java/org/apache/cxf/systest/servlet/spring.xml

 as well as changed the pom.xml to grab the spring everything jar
 as well as aspectjweaver.   That now yields:

 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'txAdvice':
 Cannot resolve reference to bean 'transactionManager' while setting
 bean property 'transactionManager';
 nested exception is
 org.springframework.beans.factory.NoSuchBeanDefinitionException: No
 bean named 'transactionManager' is defined
 Caused by:
 org.springframework.beans.factory.NoSuchBeanDefinitionException: No
 bean named 'transactionManager' is defined

 I'm probably missing a jar or something.   Not really sure.   Any
 ideas?

 Dan

   !-- Local --
  bean id=TestServiceImpl class=
  com.gdservices.service.thirdparty.TestServiceImpl
  property name=daoFactory
  ref bean=hibernateDAOFactory/
  /property
  /bean
  !-- SOAP --
  jaxws:endpoint
id=testServiceSoap
implementor=#TestServiceImpl
address=/testService /
 
  And add this snippet to your config:
 
  aop:config
  aop:advisor id=serviceTx advice-ref=txAdvice
  pointcut=execution(* *..thirdparty..*.*(..)) order=0/
  /aop:config
 
  tx:advice id=txAdvice
  tx:attributes
  tx:method name=find* read-only=true/
  tx:method name=get* read-only=true/
  tx:method name=*/
  /tx:attributes
  /tx:advice
 
  Note the pointcut reference to 'thirdparty'... just replace that
  with whatever package your service is in.  Additionally, you'll need
  to add the aop schema refs to your beans tag.  Here they are if you
  need them:
 
  beans  xmlns=http://www.springframework.org/schema/beans;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xmlns:aop=http://www.springframework.org/schema/aop;
  xmlns:tx=http://www.springframework.org/schema/tx;
  xmlns:jaxws=http://cxf.apache.org/jaxws;
 
  xsi:schemaLocation=http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://www.springframework.org/schema/aop
  http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
  http://www.springframework.org/schema/tx
  http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
  http://cxf.apache.org/jaxws
  http://cxf.apache.org/schemas/jaxws.xsd;
 
  Once you add the AOP config snippet above, your services will fail
  because CXF is attempting to generate the wsdl off the proxied
  class.. .not the real impl or service.   I think Dan pointed out
  that the annotations get lost...
 
  Regards,
  Brad
 
  On 8/6/07, Daniel Kulp [EMAIL PROTECTED] wrote:
   Could one of you send me a simple testcase again?   I think I had
   one at one point (from Brad maybe?) but I cannot seem to find it
   now.
  
   I should have a little time tomorrow or Wednesday to look

Re: cxf-spring-transactions anybody get it working?

2007-08-07 Thread Daniel Kulp

Brad,

For my test case, if I just modify the jaxws:endpoint tag to have:
jaxws:endpoint id=endpoint2 
  implementor=#TestServiceImpl
  address=/services/Greeter2
 implementorClass=org.apache.hello_world_soap_http.GreeterImpl
  / 

it works fine.   If I omit the implementorClass, it barfs due to the 
proxy.   Can you verify that on your side?   (I think this requires the 
2.0.1 or latest 2.1-SNAPSHOT code.


Dan


On Tuesday 07 August 2007 08:57, Brad Harper wrote:
 I'll be glad to write a testcase for you.. .problem is, I don't know
 what format you need?  Are you talking about a JUnit testcase? 
 Really, all you have to do to duplicate the issue is write any Spring
 based JAXws service:

  !-- Local --
 bean id=TestServiceImpl class=
 com.gdservices.service.thirdparty.TestServiceImpl
 property name=daoFactory
 ref bean=hibernateDAOFactory/
 /property
 /bean
 !-- SOAP --
 jaxws:endpoint
   id=testServiceSoap
   implementor=#TestServiceImpl
   address=/testService /

 And add this snippet to your config:

 aop:config
 aop:advisor id=serviceTx advice-ref=txAdvice
 pointcut=execution(* *..thirdparty..*.*(..)) order=0/
 /aop:config

 tx:advice id=txAdvice
 tx:attributes
 tx:method name=find* read-only=true/
 tx:method name=get* read-only=true/
 tx:method name=*/
 /tx:attributes
 /tx:advice

 Note the pointcut reference to 'thirdparty'... just replace that with
 whatever package your service is in.  Additionally, you'll need to add
 the aop schema refs to your beans tag.  Here they are if you need
 them:

 beans  xmlns=http://www.springframework.org/schema/beans;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:aop=http://www.springframework.org/schema/aop;
 xmlns:tx=http://www.springframework.org/schema/tx;
 xmlns:jaxws=http://cxf.apache.org/jaxws;

 xsi:schemaLocation=http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
 http://www.springframework.org/schema/aop
 http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
 http://www.springframework.org/schema/tx
 http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
 http://cxf.apache.org/jaxws
 http://cxf.apache.org/schemas/jaxws.xsd;

 Once you add the AOP config snippet above, your services will fail
 because CXF is attempting to generate the wsdl off the proxied class..
 .not the real impl or service.   I think Dan pointed out that the
 annotations get lost...

 Regards,
 Brad

 On 8/6/07, Daniel Kulp [EMAIL PROTECTED] wrote:
  Could one of you send me a simple testcase again?   I think I had
  one at one point (from Brad maybe?) but I cannot seem to find it
  now.
 
  I should have a little time tomorrow or Wednesday to look into it if
  I can get a simple testcase.  I'm not at all familiar with the
  spring transaction stuff.Actualy, if a testcase could be
  attached to CXF-874 for tracking purposes, that would be great.
 
  Thanks!
  Dan
 
  On Monday 06 August 2007 18:27, Brad Harper wrote:
   No.  Neither work for me.
  
   On 8/6/07, Jeremy Isikoff [EMAIL PROTECTED] wrote:
sorry to ask again but did anybody get either of those fixes for
the spring transactions working on an jaxws:endpoint or
jaxws:server?
   
   
   
Jeremy Isikoff
   
   
   
   

     Got a little couch potato?
Check out fun summer activities for kids.
   
http://search.yahoo.com/search?fr=oni_on_mailp=summer+activitie
   s+fo r+kidscs=bz
 
  --
  J. Daniel Kulp
  Principal Engineer
  IONA
  P: 781-902-8727C: 508-380-7194
  [EMAIL PROTECTED]
  http://www.dankulp.com/blog

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727C: 508-380-7194
[EMAIL PROTECTED]
http://www.dankulp.com/blog


cxf-spring-transactions anybody get it working?

2007-08-06 Thread Jeremy Isikoff
sorry to ask again but did anybody get either of those fixes for the spring 
transactions working on an jaxws:endpoint or jaxws:server?



Jeremy Isikoff


   

Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mailp=summer+activities+for+kidscs=bz