Here is some more information.  I continued down the path of trying to import 
my other spring configuration in to the component's spring config file.  I 
basically added one bean at a time until it failed.  What is happening is that 
there is a NullPointerException being thrown that is getting eaten up in the 
SCADomain class.  In my case it happens as soon as I add  <tx:annotation-driven 
/> to my configuration.  However, I discovered that the same  null pointer 
occurs if there is an unsatisfied dependency in the spring config.  In other 
words, if you have one bean that defines a reference to another bean and the 
second bean does not exist in the configuration.  If using Spring by itself you 
would receive an exception indicating what the problem is.  Here it appears 
that the real problem is being suppressed.  In the case I described above there 
are no unsatisfied dependencies so the problem is caused by something else.  
Below, Simon said that SCAParentApplicationContext should already hold the 
existing Spring configuration.  However, this does not appear to be the case.  
In fact, the javadoc says the following:

"The Parent application context is responsible for handling those entities 
within a Spring
application context that actually belong to SCA rather than to Spring."

Clearly there are some issues with the spring implementation that need to be 
resolved.  Unfortunately, right now I don't have the time to continue to 
investigate.

Phil

From: Simon Laws [mailto:[email protected]]
Sent: Friday, January 23, 2009 8:55 AM
To: [email protected]
Subject: Re: More Tuscany and Spring Questions


On Thu, Jan 22, 2009 at 3:33 PM, Sykes, Phil 
<[email protected]<mailto:[email protected]>> wrote:

Hi,



Our current application is a Spring/Hibernate app.  I am trying to convert it 
to use Tuscany and SCA.  We currently use Spring for transaction management 
using the aspectj annotations.  After integrating Tuscany I can call my 
components but a transaction is never started.  Each component has its own 
spring context file.  However, all of the transaction configuration, aspects, 
jpa config etc. are in separate context files.  These files are loaded via 
web.xml.  I was wondering, does tuscany create a new spring context for each 
component?  If so, that could explain why transactions (or any of the other aop 
stuff) are not working.  I tried importing the other spring files into my 
component's spring file but then the application would not deply.  I'm assuming 
that either my config is wrong or this kind of thing is simply not supported.  
Anyone ever try something like this?  Any suggestions?



Thanks,



Phil



Philip Sykes * Principal Java Developer, Banner Product Engineering * SunGard 
Higher Education * 3 Country View Road, Malvern PA 19335 * Tel 610 578 5185 * 
[email protected]<mailto:[email protected]> * 
www.sungardhe.com<http://www.sungardhe.com/>


Hi Phil

Not sure I'm going to be too much use to you here. Ram, who's knows 
implementation.spring is away for a bit I think. Looking at the code, the 
implementation.spring provider creates a couple of application contexts for 
each component that has a spring implementation;

SCAParentApplicationContext - to hold any SCA specific spring artifacts defined 
either explicitly or implicitly in the real application context
   GenericApplicationContext - the actual application context

If you have multiple contexts which provide additional information I'm not sure 
how that should be specified in the context of a Tuscany component. What errors 
did you see when you imported them into your application context?

The best thing for us to do is find or set up a test case that replicates what 
you need to do. If you have one ready made that you could attach to a JIRA that 
would be a good starting point. If not I'm sure we can adapt on of the existing 
tests.

Simon

Reply via email to