axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Pfeifer" <john.pfei...@hnpsolutions.com>
Subject RE: [AXIS2]Classloader error while using Hibernate with AXIS2.
Date Mon, 22 Jan 2007 11:05:27 GMT
If you use axis2/spring integration, you can load the spring context and
hibernate files in the SpringInit service.  Before the spring context is
loaded, save a reference to the context classloader, then set the
context classloader to be the service classloader, load your spring
config file, then set the context classloader back to it's original
value.  Works for me.

Thanks,
Jp4

-----Original Message-----
From: Deepal Jayasinghe [mailto:deepal@opensource.lk] 
Sent: Friday, January 19, 2007 11:18 AM
To: axis-user@ws.apache.org
Subject: Re: [AXIS2]Classloader error while using Hibernate with AXIS2.

Hi  Hemanth;

Yes, if you want to use Hibernate then you need to put Hibernate
configuration file in the location where it can find. As I know
Hibernate has implement to load config files from context class loader
and there is no way to provide a class loader into it. If you put config
file inside the aar file then those file can not be access from the
context class loader , therefore to solve the problem we need to put
those files into WEB-INF/lib directory.

Thanks
Deepal

> Hi All,
>  
>  
> I am using Hibernate with AXIS2 . My application runs stand-alone from
> Eclipse.However, when I try deploying it as a service on Tomcat, the
> class-loader is unable to load the xml files related to Hibernate.
> THis was because AXIS will load the service in its own classloader.
> One of my team-member suggested that I should make a jar of all the
> xml files,class files and place it
> in  *<TOMCAT_HOME>/webapps/axis/WEB-INF/lib.*
> *Previously*:
> 1.Built all the classfiles, xml input  files,
> services.xml,manifest.mf, wsdl file into an .aar file
> 2.Placed the .aar file in <TOMCAT_HOME>/webapps/axis/WEB-INF/services
> folder.
>  
>  
>  
> *Now*:
> 1.Created a jar of all the classfiles, xml input  files
> 2.Placed the jar file in  <TOMCAT_HOME>/webapps/axis/WEB-INF/lib
folder.
> 3.Built the services.xml,manifest.mf, wsdl file into an .aar file
> 4.Placed the .aar file in <TOMCAT_HOME>/webapps/axis/WEB-INF/services
> folder.
>  
> Now, I am able to use Hibernate to connect to the database and the
> relevant files are also being loaded by classloader.
>  
> *But my query is why should I place the jar containing service
> specific files in the /WEB-INF/lib which will make the jar available
> to all the services.*
> *Is there any other way to get this working..*
>  
>  
> Please give your inputs on the same.
>  
>  
>  
>  
>  
> Regards,
> ** 
> *Yamini *
>  
>
------------------------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender
> does not intend to waive confidentiality or privilege. Use of this
> email is prohibited when received in error.
>

-- 
Thanks,
Deepal
................................................................
"The highest tower is built one brick at a time"




---------------------------------------------------------------------
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


Mime
View raw message