axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gunith Devasurendra <gun...@gmail.com>
Subject Re: What's the best place to keep the libraries of an Axis2 service?
Date Tue, 17 Jul 2012 02:08:44 GMT
Thanks Deepal for your quick response!

But I'm trying to use Spring with Hibernate and its giving issues. (I use
an edit of the Spring POJO example from the Axis2 samples.)

When tomcat starts it gives the following in catalina.out.

[INFO] Refreshing
org.springframework.context.support.ClassPathXmlApplicationContext@11e831:
startup date [Tue Jul 17 06:40:23 IST 2012]; root of context hierarchy
[INFO] Loading XML bean definitions from class path resource
[applicationContext.xml]
[INFO] *Pre-instantiating singletons* in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1c794cc:
defining beans
[applicationContext,weatherSpringService,weatherBean,mysqlDataSource,sessionFactory,employeeDao,employeeBusiness,employeeService];
root of factory hierarchy
[INFO] *Destroying singletons* in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1c794cc:
defining beans
[applicationContext,weatherSpringService,weatherBean,mysqlDataSource,sessionFactory,employeeDao,employeeBusiness,employeeService];
root of factory hierarchy
org.apache.axis2.deployment.DeploymentException: *Error loading class
*[org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder]
for bean with name 'applicationContext' defined in class path resource
[applicationContext.xml]: problem with class file or dependent class;
nested exception is java.lang.NoClassDefFoundError: *
org/springframework/context/ApplicationContextAware*
    at
org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:150)
    at
org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:82)
    at
org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
    at
org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:813)
    at
org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
    at
org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377)
    at
org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254)
    ...............


My expanded AAR looks like this now,
.
├── applicationContext.xml
├── gunith
│   └── hrapp
│       ├── business
│       │   ├── ....
│       └── service
│           ├── Axis2SpringContextHolder.class
│           ├── BasicEmployeeService.class
│           ├── EmployeeService.class
│           └── SpringInit.class
├── lib
│   ├── ...
│   ├── axis2-spring-1.6.2.jar
│   ├── ....
│   ├── hibernate3.jar
│   ├── hibernate-annotations.jar
│   ├── hibernate-commons-annotations.jar
│   ├── hibernate-entitymanager.jar
│   ├── ...
│   ├── spring-asm-3.2.0.M1.jar
│   ├── spring-beans-3.2.0.M1.jar
│   ├── spring-context-3.2.0.M1.jar
│   ├── spring-context-support-3.2.0.M1.jar
│   ├── spring-core-3.2.0.M1.jar
│   ├── spring-expression-3.2.0.M1.jar
│   ├── spring-jdbc-3.2.0.M1.jar
│   ├── spring-orm-3.2.0.M1.jar
│   ├── spring-tx-3.2.0.M1.jar
│   ├── ....
├── META-INF
│   ├── MANIFEST.MF
│   └── services.xml

I also tried having my lib in the services folder, still with no luck.

I Googled up this issue and read that it could be a class loader issue. So
I tried the solution in
http://old.nabble.com/RE%3A-Problem-with-Using-Spring-and-Hibernate-with-Axis2-p14038959.html.
But unfortunately I'm still getting the same issue. I attached my
SpringInit and my services.xml. Any suggestions on what I'm doing wrong?

Also in the same thread (
http://old.nabble.com/RE%3A-Problem-with-Using-Spring-and-Hibernate-with-Axis2-p14094348.html)
they recommend having a non-AAR approach for deployment. Appreciate if you
can direct me to a place with proper instructions.

Thanks a lot!

Gunith Devasurendra  - ගුණිත් දේවසුරේන්ද්‍ර

gunith.com *|* linkedin <http://linkedin.com/in/gunith> *|*
facebook<http://facebook.com/gunith>
*|* google+ <http://gplus.to/gunith> *|* twitter <http://twitter.com/gunith>
*|* flickr <http://flickr.com/people/gunith> *|* foss.lk
*Everything eventually becomes a past...*



On Sun, Jul 15, 2012 at 9:16 AM, Deepal jayasinghe <deepalk@gmail.com>wrote:

>  You can put all your (service specific) libraries to service archive file
> itself. Have a look at the following:
>
> http://www.ibm.com/developerworks/library/ws-axis2soap/index.html
>
> Deepal
>
> Hi all,
>
> The topic sums it up. My problem is, I don't want to clog the
> AXIS2_HOME/lib with my app specific libraries.
>
> Any thoughts are appreciated.
>
> Thanks!
>
> Gunith Devasurendra  - ගුණිත් දේවසුරේන්ද්‍ර
>
> gunith.com *|* linkedin <http://linkedin.com/in/gunith> *|* facebook<http://facebook.com/gunith>
> *|* google+ <http://gplus.to/gunith> *|* twitter<http://twitter.com/gunith>
> *|* flickr <http://flickr.com/people/gunith> *|* foss.lk
> *Everything eventually becomes a past...*
>
>
>

Mime
View raw message