You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Kris82 <ki...@gmail.com> on 2009/04/20 18:07:04 UTC

How to run Multiple Spring with in AAR in single Axis Container

Hi,

I have been successful in creating AAR with Spring and Hibernate in it with
the help of the Axis2 Spring POJO guide. Now my problem is if i have 2 or
more AAR's with Spring and Hibernate in it deployed in the same axis
container (i.e.; deployed in services folder) only one service works as it
is picking only one application context . Can you tell me how to resolve it

To be more clear heres an example. I have here 2 aars(xyz and abc) with
spring and hibernate in it. These 2 services are deployed in the services
folder in Axis2 container with no errors. But when i try to test the
services only one service works but not both because the Axis2 container is
maintaining/loading only one applicationContext while startup or may be
overriding the applicationContext(appCtx = new
 ClassPathXmlApplicationContext(new String[] {"applicationContext.xml"},
false))

Both the services work if i deploy them in 2 different Axis2 containers.
Hope u understood the problem. Can you please suggest me how to have many
aar files with its one copy of applicationContext availabel to them

xyz.aar                                                        abc.aar
com                                                             org
 --Simpleservice.class                                       
--ComplexService  
 --SpringInIt.class                                            
--XSpringInIt.class
com.repository                                               org.repository
  --DAO's.class                                                
--DAO's.class
com.resources                                                com.resources
 --x.hbm.xml                                                     --y.hbm.xml
lib                                                                 libs
--*.jar(all the jars needed to work)                      --jars
META-INF                                                       META-INF
--MANIFEST.MF                                                --MANIFEST.MF                  
--services.xml                                                 
--services.xml
applicationContext.xml                                      
--applicationContext.xml

Thanks
Kris
-- 
View this message in context: http://www.nabble.com/How-to-run-Multiple-Spring-with-in-AAR-in-single-Axis-Container-tp23139715p23139715.html
Sent from the Axis - User mailing list archive at Nabble.com.


Re: How to run Multiple Spring with in AAR in single Axis Container

Posted by Kris82 <ki...@gmail.com>.
Thanks a lot Andreas , It works.. I moved the *. jars and its working fine.

iksrazal wrote:
> 
> On Mon, Apr 20, 2009 at 5:37 PM, Kris82 <ki...@gmail.com> wrote:
>>
>> I tried this, I moved the jars and still it does do any good.
>>
>> Andreas Veithen-2 wrote:
>>>
>>> You need to carefully follow the instructions in the section "Spring
>>> Inside an AAR". In particular, you need to make sure that the
>>> axis2-spring-*.jar is _not_ located in WEB-INF/lib, but inside the
>>> AAR(s).
>>>
>>> Andreas
>>>
> 
> Are you following this guide, particularly in the "Spring Inside an
> AAR" section?
> 
> http://ws.apache.org/axis2/1_4_1/spring.html
> 
> If so, you should be able to get spring loaded and isolated per AAR.
> Keep in mind that the spring distro libs as well as the axis2-spring*
> libs must be in the lib dir of the AAR. If you are still stuck, post
> your error or current aar contents and maybe we can help.
> 
> - R
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-run-Multiple-Spring-with-in-AAR-in-single-Axis-Container-tp23139715p23175503.html
Sent from the Axis - User mailing list archive at Nabble.com.


Re: How to run Multiple Spring with in AAR in single Axis Container

Posted by robert lazarski <ro...@gmail.com>.
On Mon, Apr 20, 2009 at 5:37 PM, Kris82 <ki...@gmail.com> wrote:
>
> I tried this, I moved the jars and still it does do any good.
>
> Andreas Veithen-2 wrote:
>>
>> You need to carefully follow the instructions in the section "Spring
>> Inside an AAR". In particular, you need to make sure that the
>> axis2-spring-*.jar is _not_ located in WEB-INF/lib, but inside the
>> AAR(s).
>>
>> Andreas
>>

Are you following this guide, particularly in the "Spring Inside an
AAR" section?

http://ws.apache.org/axis2/1_4_1/spring.html

If so, you should be able to get spring loaded and isolated per AAR.
Keep in mind that the spring distro libs as well as the axis2-spring*
libs must be in the lib dir of the AAR. If you are still stuck, post
your error or current aar contents and maybe we can help.

- R

Re: How to run Multiple Spring with in AAR in single Axis Container

Posted by Kris82 <ki...@gmail.com>.
I tried this, I moved the jars and still it does do any good. 

Andreas Veithen-2 wrote:
> 
> You need to carefully follow the instructions in the section "Spring
> Inside an AAR". In particular, you need to make sure that the
> axis2-spring-*.jar is _not_ located in WEB-INF/lib, but inside the
> AAR(s).
> 
> Andreas
> 
> On Mon, Apr 20, 2009 at 18:07, Kris82 <ki...@gmail.com> wrote:
>>
>> Hi,
>>
>> I have been successful in creating AAR with Spring and Hibernate in it
>> with
>> the help of the Axis2 Spring POJO guide. Now my problem is if i have 2 or
>> more AAR's with Spring and Hibernate in it deployed in the same axis
>> container (i.e.; deployed in services folder) only one service works as
>> it
>> is picking only one application context . Can you tell me how to resolve
>> it
>>
>> To be more clear heres an example. I have here 2 aars(xyz and abc) with
>> spring and hibernate in it. These 2 services are deployed in the services
>> folder in Axis2 container with no errors. But when i try to test the
>> services only one service works but not both because the Axis2 container
>> is
>> maintaining/loading only one applicationContext while startup or may be
>> overriding the applicationContext(appCtx = new
>>  ClassPathXmlApplicationContext(new String[] {"applicationContext.xml"},
>> false))
>>
>> Both the services work if i deploy them in 2 different Axis2 containers.
>> Hope u understood the problem. Can you please suggest me how to have many
>> aar files with its one copy of applicationContext availabel to them
>>
>> xyz.aar                                                        abc.aar
>> com                                                             org
>>  --Simpleservice.class
>> --ComplexService
>>  --SpringInIt.class
>> --XSpringInIt.class
>> com.repository                                              
>> org.repository
>>  --DAO's.class
>> --DAO's.class
>> com.resources                                              
>>  com.resources
>>  --x.hbm.xml                                                    
>> --y.hbm.xml
>> lib                                                                 libs
>> --*.jar(all the jars needed to work)                      --jars
>> META-INF                                                       META-INF
>> --MANIFEST.MF                                              
>>  --MANIFEST.MF
>> --services.xml
>> --services.xml
>> applicationContext.xml
>> --applicationContext.xml
>>
>> Thanks
>> Kris
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-run-Multiple-Spring-with-in-AAR-in-single-Axis-Container-tp23139715p23139715.html
>> Sent from the Axis - User mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-run-Multiple-Spring-with-in-AAR-in-single-Axis-Container-tp23139715p23144414.html
Sent from the Axis - User mailing list archive at Nabble.com.


Re: How to run Multiple Spring with in AAR in single Axis Container

Posted by Andreas Veithen <an...@gmail.com>.
You need to carefully follow the instructions in the section "Spring
Inside an AAR". In particular, you need to make sure that the
axis2-spring-*.jar is _not_ located in WEB-INF/lib, but inside the
AAR(s).

Andreas

On Mon, Apr 20, 2009 at 18:07, Kris82 <ki...@gmail.com> wrote:
>
> Hi,
>
> I have been successful in creating AAR with Spring and Hibernate in it with
> the help of the Axis2 Spring POJO guide. Now my problem is if i have 2 or
> more AAR's with Spring and Hibernate in it deployed in the same axis
> container (i.e.; deployed in services folder) only one service works as it
> is picking only one application context . Can you tell me how to resolve it
>
> To be more clear heres an example. I have here 2 aars(xyz and abc) with
> spring and hibernate in it. These 2 services are deployed in the services
> folder in Axis2 container with no errors. But when i try to test the
> services only one service works but not both because the Axis2 container is
> maintaining/loading only one applicationContext while startup or may be
> overriding the applicationContext(appCtx = new
>  ClassPathXmlApplicationContext(new String[] {"applicationContext.xml"},
> false))
>
> Both the services work if i deploy them in 2 different Axis2 containers.
> Hope u understood the problem. Can you please suggest me how to have many
> aar files with its one copy of applicationContext availabel to them
>
> xyz.aar                                                        abc.aar
> com                                                             org
>  --Simpleservice.class
> --ComplexService
>  --SpringInIt.class
> --XSpringInIt.class
> com.repository                                               org.repository
>  --DAO's.class
> --DAO's.class
> com.resources                                                com.resources
>  --x.hbm.xml                                                     --y.hbm.xml
> lib                                                                 libs
> --*.jar(all the jars needed to work)                      --jars
> META-INF                                                       META-INF
> --MANIFEST.MF                                                --MANIFEST.MF
> --services.xml
> --services.xml
> applicationContext.xml
> --applicationContext.xml
>
> Thanks
> Kris
> --
> View this message in context: http://www.nabble.com/How-to-run-Multiple-Spring-with-in-AAR-in-single-Axis-Container-tp23139715p23139715.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>

RE: How to run Multiple Spring with in AAR in single Axis Container

Posted by "Caristi, Joe" <jc...@whisolutions.com>.
I'm not sure about an AAR-based solution, but this can easily be accomplished with multiple WAR files in an EAR using a parent context.  It's likely that something similar will be needed for multiple AAR deployment into Axis2.  Look here for an explanation of how it works in an EAR:
http://blog.springsource.com/2007/06/11/using-a-shared-parent-application-context-in-a-multi-war-spring-application/


-----Original Message-----
From: Kris82 [mailto:kitu82@gmail.com]
Sent: Monday, April 20, 2009 12:07 PM
To: axis-user@ws.apache.org
Subject: How to run Multiple Spring with in AAR in single Axis Container


Hi,

I have been successful in creating AAR with Spring and Hibernate in it with
the help of the Axis2 Spring POJO guide. Now my problem is if i have 2 or
more AAR's with Spring and Hibernate in it deployed in the same axis
container (i.e.; deployed in services folder) only one service works as it
is picking only one application context . Can you tell me how to resolve it

To be more clear heres an example. I have here 2 aars(xyz and abc) with
spring and hibernate in it. These 2 services are deployed in the services
folder in Axis2 container with no errors. But when i try to test the
services only one service works but not both because the Axis2 container is
maintaining/loading only one applicationContext while startup or may be
overriding the applicationContext(appCtx = new
 ClassPathXmlApplicationContext(new String[] {"applicationContext.xml"},
false))

Both the services work if i deploy them in 2 different Axis2 containers.
Hope u understood the problem. Can you please suggest me how to have many
aar files with its one copy of applicationContext availabel to them

xyz.aar                                                        abc.aar
com                                                             org
 --Simpleservice.class
--ComplexService
 --SpringInIt.class
--XSpringInIt.class
com.repository                                               org.repository
  --DAO's.class
--DAO's.class
com.resources                                                com.resources
 --x.hbm.xml                                                     --y.hbm.xml
lib                                                                 libs
--*.jar(all the jars needed to work)                      --jars
META-INF                                                       META-INF
--MANIFEST.MF                                                --MANIFEST.MF
--services.xml
--services.xml
applicationContext.xml
--applicationContext.xml

Thanks
Kris
--
View this message in context: http://www.nabble.com/How-to-run-Multiple-Spring-with-in-AAR-in-single-Axis-Container-tp23139715p23139715.html
Sent from the Axis - User mailing list archive at Nabble.com.


STATEMENT OF CONFIDENTIALITY:



The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain confidential or privileged information. If you are not the intended
recipient, please notify WHI Solutions immediately at gc@whisolutions.com,
and destroy all copies of this message and any attachments.