Re: Axis2 / Spring3 / .aar file

"robertlazarski ." <[email protected]>
Newsgroups gmane.text.xml.axis.user
Message-ID <CABpPLBUXB4SUicnuEz5hy1bVMynF73Gnik6sbPhCmDjusYb9Vg@mail.gmail.com>
On Tue, Oct 15, 2013 at 7:03 AM, Simone <[email protected]> wrote:
> Hi,
>
> I try to deploy a webservice with axis2 and spring 3.2.
>
> I wrote a SpringInit:
>  ClassLoader classLoader = service.getClassLoader();
>             ClassPathXmlApplicationContext appCtx = new
> ClassPathXmlApplicationContext(
>                     new String[] { "application.xml" }, false);
>             appCtx.setClassLoader(classLoader);
>             appCtx.refresh();
>
> Added following lines to my application.xml
>
> <bean id="applicationContext"
> class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder"
> />
>     <bean id="springAwareService"
> class="com.ids.dam.impl.DAMServiceSkeleton">
>     </bean>
>
> and this is my services.xml
>
> <service name="SpringInit" class="com.ids.dam.impl.SpringInit">
>         <description>
>             This web service initializes Spring.
>         </description>
>         <parameter name="ServiceClass">com.ids.dam.impl.SpringInit
>         </parameter>
>         <parameter name="ServiceTCCL">composite</parameter>
>         <parameter name="load-on-startup">true</parameter>
>         <operation name="sprintInit">
>             <messageReceiver
> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
>         </operation>
>     </service>
>
> .
>
> At the start of tomcat I get the following error:
>
>  java.lang.NoClassDefFoundError:
> org/springframework/context/ApplicationContextAware
>
>
>
> But all spring jars exists in .aar/lib folder.
>
> Please help :-)
>
> Kind regards, SImone

Did you do this step?

"move the axis2-spring-*.jar from WEB-INF/lib to inside the AAR, as
shown below - it will not work otherwise."

Make sure that jar is only in the aar. Also, try expanding your
springframework jar to verify
org/springframework/context/ApplicationContextAware is inside. A quick
look at the springframework docs indicates that the class is still in
the distro, but we need to double check.

- R
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.