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 Sunesh Kumra <Su...@ericssonservices.co.uk> on 2008/02/15 17:50:35 UTC

More than 1 Spring .aar in Axis2

Hello,

I followed the example http://ws.apache.org/axis2/1_1/spring.html and
got a Axis2 service (not deployed in Servlet Container) using Spring to
work. I have not packaged spring.jar in the .aar but have included it in
<AXIS2_HOME>/lib and it all works fine.

However, the moment I deploy another .aar file into the Axis2, the
previous .aar stops working and the new one works fine. The error
returned is:
<soapenv:Body>
         <soapenv:Fault>
            <faultcode>soapenv:Server</faultcode>
            <faultstring>No bean named 'amountChargingServiceSkeleton'
is defined</faultstring>
            <detail />
         </soapenv:Fault>
      </soapenv:Body>

Part of applicationContext.xml is shown below:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
  <!-- Configure spring to give a hook to axis2 without a ServletContext
-->
  <bean id="applicationContext" 
	
class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHo
lder" />
 <!-- Wiring the AmountChargingServiceSkeleton with the Request
Handler's reference -->
   <bean id="amountChargingServiceSkeleton"
        class="test.AmountChargingServiceSkeleton">
  </bean>
// removed other parts of the file

Part of services.xml is shown below:

<?xml version="1.0" encoding="UTF-8"?>
<!-- This file was auto-generated from WSDL -->
<!-- by the Apache Axis2 version: 1.3  Built on : Aug 10, 2007 (04:45:47
LKT) -->
<serviceGroup>
    <service name="AmountChargingServiceSpringInit"
class="test.SpringInit">
        <description>This web service initializes Spring.</description>
        <parameter name="ServiceClass">	test.SpringInit</parameter>
        <parameter name="ServiceTCCL">composite</parameter>
        <parameter name="load-on-startup">true</parameter>
        <operation name="startUp">
            <messageReceiver
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
        </operation>
    </service>
    <service name="AmountChargingService">
        <messageReceivers>
            <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
class="test.AmountChargingServiceMessageReceiverInOut"/>
        </messageReceivers>
        <parameter
name="ServiceClass">test.AmountChargingServiceSkeleton</parameter>
        <parameter name="useOriginalwsdl">true</parameter>
        <parameter name="modifyUserWSDLPortAddress">true</parameter>
        <parameter name="ServiceObjectSupplier"
locked="false">org.apache.axis2.extensions.spring.receivers.SpringAppCon
textAwareObjectSupplier</parameter>
        <parameter name="SpringBeanName"
locked="false">amountChargingServiceSkeleton</parameter>
        <parameter name="ServiceTCCL"
locked="false">composite</parameter>
        <operation name="chargeAmount"
mep="http://www.w3.org/ns/wsdl/in-out">
       // removed other parts of the file

Has anyone got multiple .aar files which all include Spring to work in
Axis2 ?

Cheers,
	Sunesh

Ericsson Services Limited 
Registered Office: Unit 4, Midleton Gate, Guildford Business Park, Guildford, Surrey, GU2 8SG 
Registered Number in England and Wales: 3709800 
This communication is confidential and intended solely for the addressee(s). Any unauthorised review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify the sender by replying to this transmission and delete the message without disclosing it. Thank you. 
Ericsson Services Limited does not enter into contracts or contractual obligations via electronic mail, unless otherwise agreed in writing between the parties concerned.
E-mail including attachments is susceptible to data corruption, interruption, unauthorised amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof. 


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

Re: More than 1 Spring .aar in Axis2

Posted by neerja malik <ne...@yahoo.com>.
I moved the jars from WEB-INF/lib to aar/lib and its working perfectly .

Thanks,
Neerja


iksrazal wrote:
> 
> Having spring jars in <AXIS2_HOME>/lib when looking for AAR
> classloader seperation makes no sense, right ?
> 
> Please refer to the latest docs:
> 
> http://ws.apache.org/axis2/1_4/spring.html
> 
> HTH,
> Robert
> 
> On Fri, Jul 11, 2008 at 12:22 PM, neerja malik <ne...@yahoo.com>
> wrote:
>>
>> Hey,
>>
>> I am stuck with same issue. I am trying to deploy 2 spring enabled aars
>> in
>> Axis2 but its overriding the application context of second one. Please
>> lemme
>> know if you found solution to the problem.
>>
>> thanks,
>> Neerja
>>
>> Sunesh Kumra wrote:
>>>
>>> Hello,
>>>
>>> I followed the example http://ws.apache.org/axis2/1_1/spring.html and
>>> got a Axis2 service (not deployed in Servlet Container) using Spring to
>>> work. I have not packaged spring.jar in the .aar but have included it in
>>> <AXIS2_HOME>/lib and it all works fine.
>>>
>>> However, the moment I deploy another .aar file into the Axis2, the
>>> previous .aar stops working and the new one works fine. The error
>>> returned is:
>>> <soapenv:Body>
>>>          <soapenv:Fault>
>>>             <faultcode>soapenv:Server</faultcode>
>>>             <faultstring>No bean named 'amountChargingServiceSkeleton'
>>> is defined</faultstring>
>>>             <detail />
>>>          </soapenv:Fault>
>>>       </soapenv:Body>
>>>
>>> Part of applicationContext.xml is shown below:
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
>>> "http://www.springframework.org/dtd/spring-beans.dtd">
>>>
>>> <beans>
>>>   <!-- Configure spring to give a hook to axis2 without a ServletContext
>>> -->
>>>   <bean id="applicationContext"
>>>
>>> class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHo
>>> lder" />
>>>  <!-- Wiring the AmountChargingServiceSkeleton with the Request
>>> Handler's reference -->
>>>    <bean id="amountChargingServiceSkeleton"
>>>         class="test.AmountChargingServiceSkeleton">
>>>   </bean>
>>> // removed other parts of the file
>>>
>>> Part of services.xml is shown below:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!-- This file was auto-generated from WSDL -->
>>> <!-- by the Apache Axis2 version: 1.3  Built on : Aug 10, 2007 (04:45:47
>>> LKT) -->
>>> <serviceGroup>
>>>     <service name="AmountChargingServiceSpringInit"
>>> class="test.SpringInit">
>>>         <description>This web service initializes Spring.</description>
>>>         <parameter name="ServiceClass">      
>>> test.SpringInit</parameter>
>>>         <parameter name="ServiceTCCL">composite</parameter>
>>>         <parameter name="load-on-startup">true</parameter>
>>>         <operation name="startUp">
>>>             <messageReceiver
>>> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>>>         </operation>
>>>     </service>
>>>     <service name="AmountChargingService">
>>>         <messageReceivers>
>>>             <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
>>> class="test.AmountChargingServiceMessageReceiverInOut"/>
>>>         </messageReceivers>
>>>         <parameter
>>> name="ServiceClass">test.AmountChargingServiceSkeleton</parameter>
>>>         <parameter name="useOriginalwsdl">true</parameter>
>>>         <parameter name="modifyUserWSDLPortAddress">true</parameter>
>>>         <parameter name="ServiceObjectSupplier"
>>> locked="false">org.apache.axis2.extensions.spring.receivers.SpringAppCon
>>> textAwareObjectSupplier</parameter>
>>>         <parameter name="SpringBeanName"
>>> locked="false">amountChargingServiceSkeleton</parameter>
>>>         <parameter name="ServiceTCCL"
>>> locked="false">composite</parameter>
>>>         <operation name="chargeAmount"
>>> mep="http://www.w3.org/ns/wsdl/in-out">
>>>        // removed other parts of the file
>>>
>>> Has anyone got multiple .aar files which all include Spring to work in
>>> Axis2 ?
>>>
>>> Cheers,
>>>       Sunesh
>>>
>>> Ericsson Services Limited
>>> Registered Office: Unit 4, Midleton Gate, Guildford Business Park,
>>> Guildford, Surrey, GU2 8SG
>>> Registered Number in England and Wales: 3709800
>>> This communication is confidential and intended solely for the
>>> addressee(s). Any unauthorised review, use, disclosure or distribution
>>> is
>>> prohibited. If you believe this message has been sent to you in error,
>>> please notify the sender by replying to this transmission and delete the
>>> message without disclosing it. Thank you.
>>> Ericsson Services Limited does not enter into contracts or contractual
>>> obligations via electronic mail, unless otherwise agreed in writing
>>> between the parties concerned.
>>> E-mail including attachments is susceptible to data corruption,
>>> interruption, unauthorised amendment, tampering and viruses, and we only
>>> send and receive e-mails on the basis that we are not liable for any
>>> such
>>> corruption, interception, amendment, tampering or viruses or any
>>> consequences thereof.
>>>
>>>
>>> ______________________________________________________________________
>>> This email has been scanned by the MessageLabs Email Security System.
>>> For more information please visit http://www.messagelabs.com/email
>>> ______________________________________________________________________
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/More-than-1-Spring-.aar-in-Axis2-tp15505385p18406336.html
>> Sent from the Axis - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/More-than-1-Spring-.aar-in-Axis2-tp15505385p18409285.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: More than 1 Spring .aar in Axis2

Posted by robert lazarski <ro...@gmail.com>.
Having spring jars in <AXIS2_HOME>/lib when looking for AAR
classloader seperation makes no sense, right ?

Please refer to the latest docs:

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

HTH,
Robert

On Fri, Jul 11, 2008 at 12:22 PM, neerja malik <ne...@yahoo.com> wrote:
>
> Hey,
>
> I am stuck with same issue. I am trying to deploy 2 spring enabled aars in
> Axis2 but its overriding the application context of second one. Please lemme
> know if you found solution to the problem.
>
> thanks,
> Neerja
>
> Sunesh Kumra wrote:
>>
>> Hello,
>>
>> I followed the example http://ws.apache.org/axis2/1_1/spring.html and
>> got a Axis2 service (not deployed in Servlet Container) using Spring to
>> work. I have not packaged spring.jar in the .aar but have included it in
>> <AXIS2_HOME>/lib and it all works fine.
>>
>> However, the moment I deploy another .aar file into the Axis2, the
>> previous .aar stops working and the new one works fine. The error
>> returned is:
>> <soapenv:Body>
>>          <soapenv:Fault>
>>             <faultcode>soapenv:Server</faultcode>
>>             <faultstring>No bean named 'amountChargingServiceSkeleton'
>> is defined</faultstring>
>>             <detail />
>>          </soapenv:Fault>
>>       </soapenv:Body>
>>
>> Part of applicationContext.xml is shown below:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
>> "http://www.springframework.org/dtd/spring-beans.dtd">
>>
>> <beans>
>>   <!-- Configure spring to give a hook to axis2 without a ServletContext
>> -->
>>   <bean id="applicationContext"
>>
>> class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHo
>> lder" />
>>  <!-- Wiring the AmountChargingServiceSkeleton with the Request
>> Handler's reference -->
>>    <bean id="amountChargingServiceSkeleton"
>>         class="test.AmountChargingServiceSkeleton">
>>   </bean>
>> // removed other parts of the file
>>
>> Part of services.xml is shown below:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!-- This file was auto-generated from WSDL -->
>> <!-- by the Apache Axis2 version: 1.3  Built on : Aug 10, 2007 (04:45:47
>> LKT) -->
>> <serviceGroup>
>>     <service name="AmountChargingServiceSpringInit"
>> class="test.SpringInit">
>>         <description>This web service initializes Spring.</description>
>>         <parameter name="ServiceClass">       test.SpringInit</parameter>
>>         <parameter name="ServiceTCCL">composite</parameter>
>>         <parameter name="load-on-startup">true</parameter>
>>         <operation name="startUp">
>>             <messageReceiver
>> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>>         </operation>
>>     </service>
>>     <service name="AmountChargingService">
>>         <messageReceivers>
>>             <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
>> class="test.AmountChargingServiceMessageReceiverInOut"/>
>>         </messageReceivers>
>>         <parameter
>> name="ServiceClass">test.AmountChargingServiceSkeleton</parameter>
>>         <parameter name="useOriginalwsdl">true</parameter>
>>         <parameter name="modifyUserWSDLPortAddress">true</parameter>
>>         <parameter name="ServiceObjectSupplier"
>> locked="false">org.apache.axis2.extensions.spring.receivers.SpringAppCon
>> textAwareObjectSupplier</parameter>
>>         <parameter name="SpringBeanName"
>> locked="false">amountChargingServiceSkeleton</parameter>
>>         <parameter name="ServiceTCCL"
>> locked="false">composite</parameter>
>>         <operation name="chargeAmount"
>> mep="http://www.w3.org/ns/wsdl/in-out">
>>        // removed other parts of the file
>>
>> Has anyone got multiple .aar files which all include Spring to work in
>> Axis2 ?
>>
>> Cheers,
>>       Sunesh
>>
>> Ericsson Services Limited
>> Registered Office: Unit 4, Midleton Gate, Guildford Business Park,
>> Guildford, Surrey, GU2 8SG
>> Registered Number in England and Wales: 3709800
>> This communication is confidential and intended solely for the
>> addressee(s). Any unauthorised review, use, disclosure or distribution is
>> prohibited. If you believe this message has been sent to you in error,
>> please notify the sender by replying to this transmission and delete the
>> message without disclosing it. Thank you.
>> Ericsson Services Limited does not enter into contracts or contractual
>> obligations via electronic mail, unless otherwise agreed in writing
>> between the parties concerned.
>> E-mail including attachments is susceptible to data corruption,
>> interruption, unauthorised amendment, tampering and viruses, and we only
>> send and receive e-mails on the basis that we are not liable for any such
>> corruption, interception, amendment, tampering or viruses or any
>> consequences thereof.
>>
>>
>> ______________________________________________________________________
>> This email has been scanned by the MessageLabs Email Security System.
>> For more information please visit http://www.messagelabs.com/email
>> ______________________________________________________________________
>>
>
> --
> View this message in context: http://www.nabble.com/More-than-1-Spring-.aar-in-Axis2-tp15505385p18406336.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: More than 1 Spring .aar in Axis2

Posted by neerja malik <ne...@yahoo.com>.
Hey,

I am stuck with same issue. I am trying to deploy 2 spring enabled aars in
Axis2 but its overriding the application context of second one. Please lemme
know if you found solution to the problem.

thanks,
Neerja

Sunesh Kumra wrote:
> 
> Hello,
> 
> I followed the example http://ws.apache.org/axis2/1_1/spring.html and
> got a Axis2 service (not deployed in Servlet Container) using Spring to
> work. I have not packaged spring.jar in the .aar but have included it in
> <AXIS2_HOME>/lib and it all works fine.
> 
> However, the moment I deploy another .aar file into the Axis2, the
> previous .aar stops working and the new one works fine. The error
> returned is:
> <soapenv:Body>
>          <soapenv:Fault>
>             <faultcode>soapenv:Server</faultcode>
>             <faultstring>No bean named 'amountChargingServiceSkeleton'
> is defined</faultstring>
>             <detail />
>          </soapenv:Fault>
>       </soapenv:Body>
> 
> Part of applicationContext.xml is shown below:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
> "http://www.springframework.org/dtd/spring-beans.dtd">
> 
> <beans>
>   <!-- Configure spring to give a hook to axis2 without a ServletContext
> -->
>   <bean id="applicationContext" 
> 	
> class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHo
> lder" />
>  <!-- Wiring the AmountChargingServiceSkeleton with the Request
> Handler's reference -->
>    <bean id="amountChargingServiceSkeleton"
>         class="test.AmountChargingServiceSkeleton">
>   </bean>
> // removed other parts of the file
> 
> Part of services.xml is shown below:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- This file was auto-generated from WSDL -->
> <!-- by the Apache Axis2 version: 1.3  Built on : Aug 10, 2007 (04:45:47
> LKT) -->
> <serviceGroup>
>     <service name="AmountChargingServiceSpringInit"
> class="test.SpringInit">
>         <description>This web service initializes Spring.</description>
>         <parameter name="ServiceClass">	test.SpringInit</parameter>
>         <parameter name="ServiceTCCL">composite</parameter>
>         <parameter name="load-on-startup">true</parameter>
>         <operation name="startUp">
>             <messageReceiver
> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>         </operation>
>     </service>
>     <service name="AmountChargingService">
>         <messageReceivers>
>             <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
> class="test.AmountChargingServiceMessageReceiverInOut"/>
>         </messageReceivers>
>         <parameter
> name="ServiceClass">test.AmountChargingServiceSkeleton</parameter>
>         <parameter name="useOriginalwsdl">true</parameter>
>         <parameter name="modifyUserWSDLPortAddress">true</parameter>
>         <parameter name="ServiceObjectSupplier"
> locked="false">org.apache.axis2.extensions.spring.receivers.SpringAppCon
> textAwareObjectSupplier</parameter>
>         <parameter name="SpringBeanName"
> locked="false">amountChargingServiceSkeleton</parameter>
>         <parameter name="ServiceTCCL"
> locked="false">composite</parameter>
>         <operation name="chargeAmount"
> mep="http://www.w3.org/ns/wsdl/in-out">
>        // removed other parts of the file
> 
> Has anyone got multiple .aar files which all include Spring to work in
> Axis2 ?
> 
> Cheers,
> 	Sunesh
> 
> Ericsson Services Limited 
> Registered Office: Unit 4, Midleton Gate, Guildford Business Park,
> Guildford, Surrey, GU2 8SG 
> Registered Number in England and Wales: 3709800 
> This communication is confidential and intended solely for the
> addressee(s). Any unauthorised review, use, disclosure or distribution is
> prohibited. If you believe this message has been sent to you in error,
> please notify the sender by replying to this transmission and delete the
> message without disclosing it. Thank you. 
> Ericsson Services Limited does not enter into contracts or contractual
> obligations via electronic mail, unless otherwise agreed in writing
> between the parties concerned.
> E-mail including attachments is susceptible to data corruption,
> interruption, unauthorised amendment, tampering and viruses, and we only
> send and receive e-mails on the basis that we are not liable for any such
> corruption, interception, amendment, tampering or viruses or any
> consequences thereof. 
> 
> 
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email 
> ______________________________________________________________________
> 

-- 
View this message in context: http://www.nabble.com/More-than-1-Spring-.aar-in-Axis2-tp15505385p18406336.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: More than 1 Spring .aar in Axis2

Posted by ERaj <il...@yahoo.com>.
yes I'm using 
org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier


iksrazal wrote:
> 
> On Tue, Jan 20, 2009 at 9:31 PM, ERaj <il...@yahoo.com> wrote:
>>
>> I have copied the lib jars to aar/lib still it overwrites the first aar.
>> Can
>> you please explain little more?
>>
> 
> Are you using SpringAppContextAwareObjectSupplier ?
> 
>> iksrazal wrote:
>>>
>>> The idea in the 'multiple spring instances" case is to take advantage
>>> of the fact that each AAR has its own classloader, and therefore each
>>> spring instance with the proper init is in a completly seperate
>>> classloader per AAR. Using <AXIS2_HOME>/lib I think is what you really
>>> want to avoid, as that indicates a web app level classloader, ie, one
>>> spring instance will step on another.
>>>
>>> HTH,
>>> Robert
>>>
>>> On Fri, Feb 15, 2008 at 2:50 PM, Sunesh Kumra
>>> <Su...@ericssonservices.co.uk> wrote:
>>>>
>>>>
>>>>
>>>> Hello,
>>>>
>>>> I followed the example http://ws.apache.org/axis2/1_1/spring.html and
>>>> got
>>>> a
>>>> Axis2 service (not deployed in Servlet Container) using Spring to work.
>>>> I
>>>> have not packaged spring.jar in the .aar but have included it in
>>>> <AXIS2_HOME>/lib and it all works fine.
>>>>
>>>> However, the moment I deploy another .aar file into the Axis2, the
>>>> previous
>>>> .aar stops working and the new one works fine. The error returned is:
>>>>
>>>> <soapenv:Body>
>>>>          <soapenv:Fault>
>>>>             <faultcode>soapenv:Server</faultcode>
>>>>             <faultstring>No bean named 'amountChargingServiceSkeleton'
>>>> is
>>>> defined</faultstring>
>>>>             <detail />
>>>>          </soapenv:Fault>
>>>>       </soapenv:Body>
>>>>
>>>> Part of applicationContext.xml is shown below:
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
>>>> "http://www.springframework.org/dtd/spring-beans.dtd">
>>>>
>>>> <beans>
>>>>   <!-- Configure spring to give a hook to axis2 without a
>>>> ServletContext
>>>> -->
>>>>   <bean id="applicationContext"
>>>>
>>>> class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder"
>>>> />
>>>>  <!-- Wiring the AmountChargingServiceSkeleton with the Request
>>>> Handler's
>>>> reference -->
>>>>    <bean id="amountChargingServiceSkeleton"
>>>>         class="test.AmountChargingServiceSkeleton">
>>>>   </bean>
>>>> // removed other parts of the file
>>>>
>>>> Part of services.xml is shown below:
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <!-- This file was auto-generated from WSDL -->
>>>> <!-- by the Apache Axis2 version: 1.3  Built on : Aug 10, 2007
>>>> (04:45:47
>>>> LKT) -->
>>>> <serviceGroup>
>>>>     <service name="AmountChargingServiceSpringInit"
>>>> class="test.SpringInit">
>>>>         <description>This web service initializes Spring.</description>
>>>>         <parameter name="ServiceClass"> test.SpringInit</parameter>
>>>>         <parameter name="ServiceTCCL">composite</parameter>
>>>>         <parameter name="load-on-startup">true</parameter>
>>>>         <operation name="startUp">
>>>>             <messageReceiver
>>>> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>>>>         </operation>
>>>>     </service>
>>>>     <service name="AmountChargingService">
>>>>         <messageReceivers>
>>>>             <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
>>>> class="test.AmountChargingServiceMessageReceiverInOut"/>
>>>>
>>>>         </messageReceivers>
>>>>         <parameter
>>>> name="ServiceClass">test.AmountChargingServiceSkeleton</parameter>
>>>>         <parameter name="useOriginalwsdl">true</parameter>
>>>>         <parameter name="modifyUserWSDLPortAddress">true</parameter>
>>>>         <parameter name="ServiceObjectSupplier"
>>>> locked="false">org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier</parameter>
>>>>
>>>>         <parameter name="SpringBeanName"
>>>> locked="false">amountChargingServiceSkeleton</parameter>
>>>>         <parameter name="ServiceTCCL"
>>>> locked="false">composite</parameter>
>>>>         <operation name="chargeAmount"
>>>> mep="http://www.w3.org/ns/wsdl/in-out">
>>>>        // removed other parts of the file
>>>>
>>>> Has anyone got multiple .aar files which all include Spring to work in
>>>> Axis2
>>>> ?
>>>>
>>>> Cheers,
>>>>         Sunesh
>>>>
>>>> Ericsson Services Limited
>>>>
>>>> Registered Office: Unit 4, Midleton Gate, Guildford Business Park,
>>>> Guildford, Surrey, GU2 8SG
>>>>
>>>> Registered Number in England and Wales: 3709800
>>>>
>>>> This communication is confidential and intended solely for the
>>>> addressee(s).
>>>> Any unauthorised review, use, disclosure or distribution is prohibited.
>>>> If
>>>> you believe this message has been sent to you in error, please notify
>>>> the
>>>> sender by replying to this transmission and delete the message without
>>>> disclosing it. Thank you.
>>>>  Ericsson Services Limited does not enter into contracts or contractual
>>>> obligations via electronic mail, unless otherwise agreed in writing
>>>> between
>>>> the parties concerned.
>>>>  E-mail including attachments is susceptible to data corruption,
>>>> interruption, unauthorised amendment, tampering and viruses, and we
>>>> only
>>>> send and receive e-mails on the basis that we are not liable for any
>>>> such
>>>> corruption, interception, amendment, tampering or viruses or any
>>>> consequences thereof.
>>>>
>>>>
>>>>  ______________________________________________________________________
>>>>  This email has been scanned by the MessageLabs Email Security System.
>>>>  For more information please visit http://www.messagelabs.com/email
>>>>  ______________________________________________________________________
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/More-than-1-Spring-.aar-in-Axis2-tp15505385p21574864.html
>> Sent from the Axis - User mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/More-than-1-Spring-.aar-in-Axis2-tp15505385p21576316.html
Sent from the Axis - User mailing list archive at Nabble.com.


Re: More than 1 Spring .aar in Axis2

Posted by robert lazarski <ro...@gmail.com>.
On Tue, Jan 20, 2009 at 9:31 PM, ERaj <il...@yahoo.com> wrote:
>
> I have copied the lib jars to aar/lib still it overwrites the first aar. Can
> you please explain little more?
>

Are you using SpringAppContextAwareObjectSupplier ?

> iksrazal wrote:
>>
>> The idea in the 'multiple spring instances" case is to take advantage
>> of the fact that each AAR has its own classloader, and therefore each
>> spring instance with the proper init is in a completly seperate
>> classloader per AAR. Using <AXIS2_HOME>/lib I think is what you really
>> want to avoid, as that indicates a web app level classloader, ie, one
>> spring instance will step on another.
>>
>> HTH,
>> Robert
>>
>> On Fri, Feb 15, 2008 at 2:50 PM, Sunesh Kumra
>> <Su...@ericssonservices.co.uk> wrote:
>>>
>>>
>>>
>>> Hello,
>>>
>>> I followed the example http://ws.apache.org/axis2/1_1/spring.html and got
>>> a
>>> Axis2 service (not deployed in Servlet Container) using Spring to work. I
>>> have not packaged spring.jar in the .aar but have included it in
>>> <AXIS2_HOME>/lib and it all works fine.
>>>
>>> However, the moment I deploy another .aar file into the Axis2, the
>>> previous
>>> .aar stops working and the new one works fine. The error returned is:
>>>
>>> <soapenv:Body>
>>>          <soapenv:Fault>
>>>             <faultcode>soapenv:Server</faultcode>
>>>             <faultstring>No bean named 'amountChargingServiceSkeleton' is
>>> defined</faultstring>
>>>             <detail />
>>>          </soapenv:Fault>
>>>       </soapenv:Body>
>>>
>>> Part of applicationContext.xml is shown below:
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
>>> "http://www.springframework.org/dtd/spring-beans.dtd">
>>>
>>> <beans>
>>>   <!-- Configure spring to give a hook to axis2 without a ServletContext
>>> -->
>>>   <bean id="applicationContext"
>>>
>>> class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder"
>>> />
>>>  <!-- Wiring the AmountChargingServiceSkeleton with the Request Handler's
>>> reference -->
>>>    <bean id="amountChargingServiceSkeleton"
>>>         class="test.AmountChargingServiceSkeleton">
>>>   </bean>
>>> // removed other parts of the file
>>>
>>> Part of services.xml is shown below:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!-- This file was auto-generated from WSDL -->
>>> <!-- by the Apache Axis2 version: 1.3  Built on : Aug 10, 2007 (04:45:47
>>> LKT) -->
>>> <serviceGroup>
>>>     <service name="AmountChargingServiceSpringInit"
>>> class="test.SpringInit">
>>>         <description>This web service initializes Spring.</description>
>>>         <parameter name="ServiceClass"> test.SpringInit</parameter>
>>>         <parameter name="ServiceTCCL">composite</parameter>
>>>         <parameter name="load-on-startup">true</parameter>
>>>         <operation name="startUp">
>>>             <messageReceiver
>>> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>>>         </operation>
>>>     </service>
>>>     <service name="AmountChargingService">
>>>         <messageReceivers>
>>>             <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
>>> class="test.AmountChargingServiceMessageReceiverInOut"/>
>>>
>>>         </messageReceivers>
>>>         <parameter
>>> name="ServiceClass">test.AmountChargingServiceSkeleton</parameter>
>>>         <parameter name="useOriginalwsdl">true</parameter>
>>>         <parameter name="modifyUserWSDLPortAddress">true</parameter>
>>>         <parameter name="ServiceObjectSupplier"
>>> locked="false">org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier</parameter>
>>>
>>>         <parameter name="SpringBeanName"
>>> locked="false">amountChargingServiceSkeleton</parameter>
>>>         <parameter name="ServiceTCCL"
>>> locked="false">composite</parameter>
>>>         <operation name="chargeAmount"
>>> mep="http://www.w3.org/ns/wsdl/in-out">
>>>        // removed other parts of the file
>>>
>>> Has anyone got multiple .aar files which all include Spring to work in
>>> Axis2
>>> ?
>>>
>>> Cheers,
>>>         Sunesh
>>>
>>> Ericsson Services Limited
>>>
>>> Registered Office: Unit 4, Midleton Gate, Guildford Business Park,
>>> Guildford, Surrey, GU2 8SG
>>>
>>> Registered Number in England and Wales: 3709800
>>>
>>> This communication is confidential and intended solely for the
>>> addressee(s).
>>> Any unauthorised review, use, disclosure or distribution is prohibited.
>>> If
>>> you believe this message has been sent to you in error, please notify the
>>> sender by replying to this transmission and delete the message without
>>> disclosing it. Thank you.
>>>  Ericsson Services Limited does not enter into contracts or contractual
>>> obligations via electronic mail, unless otherwise agreed in writing
>>> between
>>> the parties concerned.
>>>  E-mail including attachments is susceptible to data corruption,
>>> interruption, unauthorised amendment, tampering and viruses, and we only
>>> send and receive e-mails on the basis that we are not liable for any such
>>> corruption, interception, amendment, tampering or viruses or any
>>> consequences thereof.
>>>
>>>
>>>  ______________________________________________________________________
>>>  This email has been scanned by the MessageLabs Email Security System.
>>>  For more information please visit http://www.messagelabs.com/email
>>>  ______________________________________________________________________
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/More-than-1-Spring-.aar-in-Axis2-tp15505385p21574864.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>

Re: More than 1 Spring .aar in Axis2

Posted by robert lazarski <ro...@gmail.com>.
On Fri, Aug 28, 2009 at 5:46 PM, sarcott<sa...@gmail.com> wrote:
>
> Does any one know if a patch for this issue was made available?
>
> thanks,
> sarcott
>
>

imho there is no problem - it works as designed. "More than 1 Spring
.aar in Axis2" is supported and documented since 1.0. Is there a
particular need that the current support doesn't cover? If not, open a
jira and even better, submit patches.

- R

> iksrazal wrote:
>>
>> On Sun, May 31, 2009 at 4:18 PM, Andreas Veithen
>> <an...@gmail.com> wrote:
>>> If what you are saying is true, then the Spring support in Axis2 has a
>>> serious flaw and needs to be fixed...
>>>
>>> Andreas
>>
>> Patches are welcome.
>>
>> - R
>>
>>
>
> --
> View this message in context: http://www.nabble.com/More-than-1-Spring-.aar-in-Axis2-tp15505385p25196714.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>

Re: More than 1 Spring .aar in Axis2

Posted by sarcott <sa...@gmail.com>.
Does any one know if a patch for this issue was made available?

thanks,
sarcott


iksrazal wrote:
> 
> On Sun, May 31, 2009 at 4:18 PM, Andreas Veithen
> <an...@gmail.com> wrote:
>> If what you are saying is true, then the Spring support in Axis2 has a
>> serious flaw and needs to be fixed...
>>
>> Andreas
> 
> Patches are welcome.
> 
> - R
> 
> 

-- 
View this message in context: http://www.nabble.com/More-than-1-Spring-.aar-in-Axis2-tp15505385p25196714.html
Sent from the Axis - User mailing list archive at Nabble.com.


Re: More than 1 Spring .aar in Axis2

Posted by robert lazarski <ro...@gmail.com>.
On Sun, May 31, 2009 at 4:18 PM, Andreas Veithen
<an...@gmail.com> wrote:
> If what you are saying is true, then the Spring support in Axis2 has a
> serious flaw and needs to be fixed...
>
> Andreas

Patches are welcome.

- R

Re: More than 1 Spring .aar in Axis2

Posted by Andreas Veithen <an...@gmail.com>.
If what you are saying is true, then the Spring support in Axis2 has a
serious flaw and needs to be fixed...

Andreas

On Fri, May 29, 2009 at 16:02, robert lazarski <ro...@gmail.com> wrote:
> On Fri, May 29, 2009 at 10:25 AM, sarcott <sa...@gmail.com> wrote:
>>
>> I tried this approach of making copies of the ApplicationContextHolder for
>> every .AAR file and left the spring.jar and axis2-spring-1.4.1.jar in
>> WEB-INF. I am still having the application context problem. The only way I
>> was able to make the multiple aar files work was by moving the jar files in
>> to the individual aar files.
>>
>> Has anyone had success with mutilple applicationContextHolder? The
>> spring.jar is 2.81 mb and we will be duplicating it in all the .aar files .
>> Is there any other way to avoid this and still have the applicationContext
>> work.
>>
>> thanks,
>> Sarcott
>>
>
> Please read the manual carefully - when you say "The only way I
> was able to make the multiple aar files work was by moving the jar files in
> to the individual aar files" , that's the only way it can work. It
> doesn't make sense - and its not supported - to have a completely
> separate spring instance in each aar by using the same jar copy of
> spring in WEB-INF. So yes, you do need multiple copies of the spring
> jar in each war - that's the price you need to pay for it to work.
> BTW, you may not need the full 2.8 mb spring jar - they ship smaller
> jars supporting each feature set - ymmv.
>
> Best regards,
> Robert
>

Re: More than 1 Spring .aar in Axis2

Posted by robert lazarski <ro...@gmail.com>.
On Fri, May 29, 2009 at 10:25 AM, sarcott <sa...@gmail.com> wrote:
>
> I tried this approach of making copies of the ApplicationContextHolder for
> every .AAR file and left the spring.jar and axis2-spring-1.4.1.jar in
> WEB-INF. I am still having the application context problem. The only way I
> was able to make the multiple aar files work was by moving the jar files in
> to the individual aar files.
>
> Has anyone had success with mutilple applicationContextHolder? The
> spring.jar is 2.81 mb and we will be duplicating it in all the .aar files .
> Is there any other way to avoid this and still have the applicationContext
> work.
>
> thanks,
> Sarcott
>

Please read the manual carefully - when you say "The only way I
was able to make the multiple aar files work was by moving the jar files in
to the individual aar files" , that's the only way it can work. It
doesn't make sense - and its not supported - to have a completely
separate spring instance in each aar by using the same jar copy of
spring in WEB-INF. So yes, you do need multiple copies of the spring
jar in each war - that's the price you need to pay for it to work.
BTW, you may not need the full 2.8 mb spring jar - they ship smaller
jars supporting each feature set - ymmv.

Best regards,
Robert

Re: More than 1 Spring .aar in Axis2

Posted by sarcott <sa...@gmail.com>.
I tried this approach of making copies of the ApplicationContextHolder for
every .AAR file and left the spring.jar and axis2-spring-1.4.1.jar in
WEB-INF. I am still having the application context problem. The only way I
was able to make the multiple aar files work was by moving the jar files in
to the individual aar files. 

Has anyone had success with mutilple applicationContextHolder? The
spring.jar is 2.81 mb and we will be duplicating it in all the .aar files .
Is there any other way to avoid this and still have the applicationContext
work.

thanks,
Sarcott



iksrazal wrote:
> 
> On Wed, Jan 21, 2009 at 8:52 AM, Paul French <pa...@kirona.com>
> wrote:
>> How about taking a copy of this one class and putting that in your
>> service
>> .aar file. I think that might work since each service will have its own
>> classloader and so own copy of the ApplicationContextHolder. You could
>> leave
>> the spring libraries in WEB-INF/lib then?
>>
> 
> FYI, you can't do spring in the aar and still have any spring related
> jars - springframework, axis2 or anything else - in WEB-INF. I tested
> this alot when I wrote the code and it doesn't work any other way.
> 
> - R
> 
> 

-- 
View this message in context: http://www.nabble.com/More-than-1-Spring-.aar-in-Axis2-tp15505385p23779990.html
Sent from the Axis - User mailing list archive at Nabble.com.


Re: More than 1 Spring .aar in Axis2

Posted by robert lazarski <ro...@gmail.com>.
On Wed, Jan 21, 2009 at 8:52 AM, Paul French <pa...@kirona.com> wrote:
> How about taking a copy of this one class and putting that in your service
> .aar file. I think that might work since each service will have its own
> classloader and so own copy of the ApplicationContextHolder. You could leave
> the spring libraries in WEB-INF/lib then?
>

FYI, you can't do spring in the aar and still have any spring related
jars - springframework, axis2 or anything else - in WEB-INF. I tested
this alot when I wrote the code and it doesn't work any other way.

- R

RE: More than 1 Spring .aar in Axis2

Posted by Paul French <pa...@kirona.com>.
How about taking a copy of this one class and putting that in your service
.aar file. I think that might work since each service will have its own
classloader and so own copy of the ApplicationContextHolder. You could leave
the spring libraries in WEB-INF/lib then? 

-----Original Message-----
From: robert lazarski [mailto:robertlazarski@gmail.com] 
Sent: 21 January 2009 10:47
To: axis-user@ws.apache.org
Subject: Re: More than 1 Spring .aar in Axis2

On Wed, Jan 21, 2009 at 1:18 AM, Amila Suriarachchi
<am...@gmail.com> wrote:
> I think the problem is with the
>
> org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder
>
>
> public class ApplicationContextHolder implements 
> ApplicationContextAware {
>
>     private static ApplicationContext appCtx;
>
>     public ApplicationContextHolder() {
>     }
>
>     /** Spring supplied interface method for injecting app context. */
>     public void setApplicationContext(ApplicationContext
applicationContext)
>             throws BeansException {
>         appCtx = applicationContext;
>     }
>
>     /** Access to spring wired beans. */
>     public static ApplicationContext getContext() {
>         return appCtx;
>     }
>
> }
>
> this class always keep the latest Application context which is used by 
> the object supplier. You may have to put the axis2-spring- .jar also 
> you your aar/lib folder instead of keeping it in WEB-INF/lib.
>
> thanks,
> Amila.
>>

Absolutely true, the docs mention this.

Robert

__________ NOD32 3784 (20090121) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



Re: More than 1 Spring .aar in Axis2

Posted by robert lazarski <ro...@gmail.com>.
On Wed, Jan 21, 2009 at 1:18 AM, Amila Suriarachchi
<am...@gmail.com> wrote:
> I think the problem is with the
>
> org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder
>
>
> public class ApplicationContextHolder implements ApplicationContextAware {
>
>     private static ApplicationContext appCtx;
>
>     public ApplicationContextHolder() {
>     }
>
>     /** Spring supplied interface method for injecting app context. */
>     public void setApplicationContext(ApplicationContext applicationContext)
>             throws BeansException {
>         appCtx = applicationContext;
>     }
>
>     /** Access to spring wired beans. */
>     public static ApplicationContext getContext() {
>         return appCtx;
>     }
>
> }
>
> this class always keep the latest Application context which is used by the
> object supplier. You may have to put the axis2-spring- .jar also you your
> aar/lib folder instead of keeping it in WEB-INF/lib.
>
> thanks,
> Amila.
>>

Absolutely true, the docs mention this.

Robert

Re: More than 1 Spring .aar in Axis2

Posted by Amila Suriarachchi <am...@gmail.com>.
On Wed, Jan 21, 2009 at 6:01 AM, ERaj <il...@yahoo.com> wrote:

>
> I have copied the lib jars to aar/lib still it overwrites the first aar.
> Can
> you please explain little more?


I think the problem is with the

org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder


public class ApplicationContextHolder implements ApplicationContextAware {

    private static ApplicationContext appCtx;

    public ApplicationContextHolder() {
    }

    /** Spring supplied interface method for injecting app context. */
    public void setApplicationContext(ApplicationContext applicationContext)
            throws BeansException {
        appCtx = applicationContext;
    }

    /** Access to spring wired beans. */
    public static ApplicationContext getContext() {
        return appCtx;
    }

}

this class always keep the latest Application context which is used by the
object supplier. You may have to put the axis2-spring- .jar also you your
aar/lib folder instead of keeping it in WEB-INF/lib.

thanks,
Amila.

>
>
> iksrazal wrote:
> >
> > The idea in the 'multiple spring instances" case is to take advantage
> > of the fact that each AAR has its own classloader, and therefore each
> > spring instance with the proper init is in a completly seperate
> > classloader per AAR. Using <AXIS2_HOME>/lib I think is what you really
> > want to avoid, as that indicates a web app level classloader, ie, one
> > spring instance will step on another.
> >
> > HTH,
> > Robert
> >
> > On Fri, Feb 15, 2008 at 2:50 PM, Sunesh Kumra
> > <Su...@ericssonservices.co.uk> wrote:
> >>
> >>
> >>
> >> Hello,
> >>
> >> I followed the example http://ws.apache.org/axis2/1_1/spring.html and
> got
> >> a
> >> Axis2 service (not deployed in Servlet Container) using Spring to work.
> I
> >> have not packaged spring.jar in the .aar but have included it in
> >> <AXIS2_HOME>/lib and it all works fine.
> >>
> >> However, the moment I deploy another .aar file into the Axis2, the
> >> previous
> >> .aar stops working and the new one works fine. The error returned is:
> >>
> >> <soapenv:Body>
> >>          <soapenv:Fault>
> >>             <faultcode>soapenv:Server</faultcode>
> >>             <faultstring>No bean named 'amountChargingServiceSkeleton'
> is
> >> defined</faultstring>
> >>             <detail />
> >>          </soapenv:Fault>
> >>       </soapenv:Body>
> >>
> >> Part of applicationContext.xml is shown below:
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
> >> "http://www.springframework.org/dtd/spring-beans.dtd">
> >>
> >> <beans>
> >>   <!-- Configure spring to give a hook to axis2 without a ServletContext
> >> -->
> >>   <bean id="applicationContext"
> >>
> >>
> class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder"
> >> />
> >>  <!-- Wiring the AmountChargingServiceSkeleton with the Request
> Handler's
> >> reference -->
> >>    <bean id="amountChargingServiceSkeleton"
> >>         class="test.AmountChargingServiceSkeleton">
> >>   </bean>
> >> // removed other parts of the file
> >>
> >> Part of services.xml is shown below:
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <!-- This file was auto-generated from WSDL -->
> >> <!-- by the Apache Axis2 version: 1.3  Built on : Aug 10, 2007 (04:45:47
> >> LKT) -->
> >> <serviceGroup>
> >>     <service name="AmountChargingServiceSpringInit"
> >> class="test.SpringInit">
> >>         <description>This web service initializes Spring.</description>
> >>         <parameter name="ServiceClass"> test.SpringInit</parameter>
> >>         <parameter name="ServiceTCCL">composite</parameter>
> >>         <parameter name="load-on-startup">true</parameter>
> >>         <operation name="startUp">
> >>             <messageReceiver
> >> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
> >>         </operation>
> >>     </service>
> >>     <service name="AmountChargingService">
> >>         <messageReceivers>
> >>             <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
> >> class="test.AmountChargingServiceMessageReceiverInOut"/>
> >>
> >>         </messageReceivers>
> >>         <parameter
> >> name="ServiceClass">test.AmountChargingServiceSkeleton</parameter>
> >>         <parameter name="useOriginalwsdl">true</parameter>
> >>         <parameter name="modifyUserWSDLPortAddress">true</parameter>
> >>         <parameter name="ServiceObjectSupplier"
> >>
> locked="false">org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier</parameter>
> >>
> >>         <parameter name="SpringBeanName"
> >> locked="false">amountChargingServiceSkeleton</parameter>
> >>         <parameter name="ServiceTCCL"
> >> locked="false">composite</parameter>
> >>         <operation name="chargeAmount"
> >> mep="http://www.w3.org/ns/wsdl/in-out">
> >>        // removed other parts of the file
> >>
> >> Has anyone got multiple .aar files which all include Spring to work in
> >> Axis2
> >> ?
> >>
> >> Cheers,
> >>         Sunesh
> >>
> >> Ericsson Services Limited
> >>
> >> Registered Office: Unit 4, Midleton Gate, Guildford Business Park,
> >> Guildford, Surrey, GU2 8SG
> >>
> >> Registered Number in England and Wales: 3709800
> >>
> >> This communication is confidential and intended solely for the
> >> addressee(s).
> >> Any unauthorised review, use, disclosure or distribution is prohibited.
> >> If
> >> you believe this message has been sent to you in error, please notify
> the
> >> sender by replying to this transmission and delete the message without
> >> disclosing it. Thank you.
> >>  Ericsson Services Limited does not enter into contracts or contractual
> >> obligations via electronic mail, unless otherwise agreed in writing
> >> between
> >> the parties concerned.
> >>  E-mail including attachments is susceptible to data corruption,
> >> interruption, unauthorised amendment, tampering and viruses, and we only
> >> send and receive e-mails on the basis that we are not liable for any
> such
> >> corruption, interception, amendment, tampering or viruses or any
> >> consequences thereof.
> >>
> >>
> >>  ______________________________________________________________________
> >>  This email has been scanned by the MessageLabs Email Security System.
> >>  For more information please visit http://www.messagelabs.com/email
> >>  ______________________________________________________________________
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/More-than-1-Spring-.aar-in-Axis2-tp15505385p21574864.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

Re: More than 1 Spring .aar in Axis2

Posted by ERaj <il...@yahoo.com>.
I have copied the lib jars to aar/lib still it overwrites the first aar. Can
you please explain little more?

iksrazal wrote:
> 
> The idea in the 'multiple spring instances" case is to take advantage
> of the fact that each AAR has its own classloader, and therefore each
> spring instance with the proper init is in a completly seperate
> classloader per AAR. Using <AXIS2_HOME>/lib I think is what you really
> want to avoid, as that indicates a web app level classloader, ie, one
> spring instance will step on another.
> 
> HTH,
> Robert
> 
> On Fri, Feb 15, 2008 at 2:50 PM, Sunesh Kumra
> <Su...@ericssonservices.co.uk> wrote:
>>
>>
>>
>> Hello,
>>
>> I followed the example http://ws.apache.org/axis2/1_1/spring.html and got
>> a
>> Axis2 service (not deployed in Servlet Container) using Spring to work. I
>> have not packaged spring.jar in the .aar but have included it in
>> <AXIS2_HOME>/lib and it all works fine.
>>
>> However, the moment I deploy another .aar file into the Axis2, the
>> previous
>> .aar stops working and the new one works fine. The error returned is:
>>
>> <soapenv:Body>
>>          <soapenv:Fault>
>>             <faultcode>soapenv:Server</faultcode>
>>             <faultstring>No bean named 'amountChargingServiceSkeleton' is
>> defined</faultstring>
>>             <detail />
>>          </soapenv:Fault>
>>       </soapenv:Body>
>>
>> Part of applicationContext.xml is shown below:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
>> "http://www.springframework.org/dtd/spring-beans.dtd">
>>
>> <beans>
>>   <!-- Configure spring to give a hook to axis2 without a ServletContext
>> -->
>>   <bean id="applicationContext"
>>
>> class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder"
>> />
>>  <!-- Wiring the AmountChargingServiceSkeleton with the Request Handler's
>> reference -->
>>    <bean id="amountChargingServiceSkeleton"
>>         class="test.AmountChargingServiceSkeleton">
>>   </bean>
>> // removed other parts of the file
>>
>> Part of services.xml is shown below:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!-- This file was auto-generated from WSDL -->
>> <!-- by the Apache Axis2 version: 1.3  Built on : Aug 10, 2007 (04:45:47
>> LKT) -->
>> <serviceGroup>
>>     <service name="AmountChargingServiceSpringInit"
>> class="test.SpringInit">
>>         <description>This web service initializes Spring.</description>
>>         <parameter name="ServiceClass"> test.SpringInit</parameter>
>>         <parameter name="ServiceTCCL">composite</parameter>
>>         <parameter name="load-on-startup">true</parameter>
>>         <operation name="startUp">
>>             <messageReceiver
>> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>>         </operation>
>>     </service>
>>     <service name="AmountChargingService">
>>         <messageReceivers>
>>             <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
>> class="test.AmountChargingServiceMessageReceiverInOut"/>
>>
>>         </messageReceivers>
>>         <parameter
>> name="ServiceClass">test.AmountChargingServiceSkeleton</parameter>
>>         <parameter name="useOriginalwsdl">true</parameter>
>>         <parameter name="modifyUserWSDLPortAddress">true</parameter>
>>         <parameter name="ServiceObjectSupplier"
>> locked="false">org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier</parameter>
>>
>>         <parameter name="SpringBeanName"
>> locked="false">amountChargingServiceSkeleton</parameter>
>>         <parameter name="ServiceTCCL"
>> locked="false">composite</parameter>
>>         <operation name="chargeAmount"
>> mep="http://www.w3.org/ns/wsdl/in-out">
>>        // removed other parts of the file
>>
>> Has anyone got multiple .aar files which all include Spring to work in
>> Axis2
>> ?
>>
>> Cheers,
>>         Sunesh
>>
>> Ericsson Services Limited
>>
>> Registered Office: Unit 4, Midleton Gate, Guildford Business Park,
>> Guildford, Surrey, GU2 8SG
>>
>> Registered Number in England and Wales: 3709800
>>
>> This communication is confidential and intended solely for the
>> addressee(s).
>> Any unauthorised review, use, disclosure or distribution is prohibited.
>> If
>> you believe this message has been sent to you in error, please notify the
>> sender by replying to this transmission and delete the message without
>> disclosing it. Thank you.
>>  Ericsson Services Limited does not enter into contracts or contractual
>> obligations via electronic mail, unless otherwise agreed in writing
>> between
>> the parties concerned.
>>  E-mail including attachments is susceptible to data corruption,
>> interruption, unauthorised amendment, tampering and viruses, and we only
>> send and receive e-mails on the basis that we are not liable for any such
>> corruption, interception, amendment, tampering or viruses or any
>> consequences thereof.
>>
>>
>>  ______________________________________________________________________
>>  This email has been scanned by the MessageLabs Email Security System.
>>  For more information please visit http://www.messagelabs.com/email
>>  ______________________________________________________________________
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/More-than-1-Spring-.aar-in-Axis2-tp15505385p21574864.html
Sent from the Axis - User mailing list archive at Nabble.com.


Re: More than 1 Spring .aar in Axis2

Posted by robert lazarski <ro...@gmail.com>.
The idea in the 'multiple spring instances" case is to take advantage
of the fact that each AAR has its own classloader, and therefore each
spring instance with the proper init is in a completly seperate
classloader per AAR. Using <AXIS2_HOME>/lib I think is what you really
want to avoid, as that indicates a web app level classloader, ie, one
spring instance will step on another.

HTH,
Robert

On Fri, Feb 15, 2008 at 2:50 PM, Sunesh Kumra
<Su...@ericssonservices.co.uk> wrote:
>
>
>
> Hello,
>
> I followed the example http://ws.apache.org/axis2/1_1/spring.html and got a
> Axis2 service (not deployed in Servlet Container) using Spring to work. I
> have not packaged spring.jar in the .aar but have included it in
> <AXIS2_HOME>/lib and it all works fine.
>
> However, the moment I deploy another .aar file into the Axis2, the previous
> .aar stops working and the new one works fine. The error returned is:
>
> <soapenv:Body>
>          <soapenv:Fault>
>             <faultcode>soapenv:Server</faultcode>
>             <faultstring>No bean named 'amountChargingServiceSkeleton' is
> defined</faultstring>
>             <detail />
>          </soapenv:Fault>
>       </soapenv:Body>
>
> Part of applicationContext.xml is shown below:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
> "http://www.springframework.org/dtd/spring-beans.dtd">
>
> <beans>
>   <!-- Configure spring to give a hook to axis2 without a ServletContext -->
>   <bean id="applicationContext"
>
> class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder"
> />
>  <!-- Wiring the AmountChargingServiceSkeleton with the Request Handler's
> reference -->
>    <bean id="amountChargingServiceSkeleton"
>         class="test.AmountChargingServiceSkeleton">
>   </bean>
> // removed other parts of the file
>
> Part of services.xml is shown below:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- This file was auto-generated from WSDL -->
> <!-- by the Apache Axis2 version: 1.3  Built on : Aug 10, 2007 (04:45:47
> LKT) -->
> <serviceGroup>
>     <service name="AmountChargingServiceSpringInit" class="test.SpringInit">
>         <description>This web service initializes Spring.</description>
>         <parameter name="ServiceClass"> test.SpringInit</parameter>
>         <parameter name="ServiceTCCL">composite</parameter>
>         <parameter name="load-on-startup">true</parameter>
>         <operation name="startUp">
>             <messageReceiver
> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>         </operation>
>     </service>
>     <service name="AmountChargingService">
>         <messageReceivers>
>             <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
> class="test.AmountChargingServiceMessageReceiverInOut"/>
>
>         </messageReceivers>
>         <parameter
> name="ServiceClass">test.AmountChargingServiceSkeleton</parameter>
>         <parameter name="useOriginalwsdl">true</parameter>
>         <parameter name="modifyUserWSDLPortAddress">true</parameter>
>         <parameter name="ServiceObjectSupplier"
> locked="false">org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier</parameter>
>
>         <parameter name="SpringBeanName"
> locked="false">amountChargingServiceSkeleton</parameter>
>         <parameter name="ServiceTCCL" locked="false">composite</parameter>
>         <operation name="chargeAmount"
> mep="http://www.w3.org/ns/wsdl/in-out">
>        // removed other parts of the file
>
> Has anyone got multiple .aar files which all include Spring to work in Axis2
> ?
>
> Cheers,
>         Sunesh
>
> Ericsson Services Limited
>
> Registered Office: Unit 4, Midleton Gate, Guildford Business Park,
> Guildford, Surrey, GU2 8SG
>
> Registered Number in England and Wales: 3709800
>
> This communication is confidential and intended solely for the addressee(s).
> Any unauthorised review, use, disclosure or distribution is prohibited. If
> you believe this message has been sent to you in error, please notify the
> sender by replying to this transmission and delete the message without
> disclosing it. Thank you.
>  Ericsson Services Limited does not enter into contracts or contractual
> obligations via electronic mail, unless otherwise agreed in writing between
> the parties concerned.
>  E-mail including attachments is susceptible to data corruption,
> interruption, unauthorised amendment, tampering and viruses, and we only
> send and receive e-mails on the basis that we are not liable for any such
> corruption, interception, amendment, tampering or viruses or any
> consequences thereof.
>
>
>  ______________________________________________________________________
>  This email has been scanned by the MessageLabs Email Security System.
>  For more information please visit http://www.messagelabs.com/email
>  ______________________________________________________________________
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org