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 "Hemanth, Yamini (MSAS Sys Dev IBD)" <Ya...@morganstanley.com> on 2007/01/17 12:56:32 UTC

[AXIS2]Classloader error while using Hibernate with AXIS2.

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.

Re: [AXIS2]Classloader error while using Hibernate with AXIS2.

Posted by Davanum Srinivas <da...@gmail.com>.
Yamini,

Please add this:

<parameter name="ServiceTCCL" locked="false">service</parameter>

to your services.xml. See spring example here:
http://ws.apache.org/axis2/1_1/spring.html#263

Which illustrates how to set it to composite. Some more information is here:
http://marc2.theaimsgroup.com/?l=axis-cvs&m=115946726426905&w=3

thanks,
dims

PS: Looks like we need to add a faq on ServiceTCCL options to set
axis2 classloader behavior for services ( default / composite /
service )

On 1/17/07, Hemanth, Yamini (MSAS Sys Dev IBD)
<Ya...@morganstanley.com> wrote:
>
>
>
> 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.
>


-- 
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)

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


Re: [AXIS2]Classloader error while using Hibernate with AXIS2.

Posted by Deepal Jayasinghe <de...@opensource.lk>.
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