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 Iwan Memruk <im...@lohika.odessa.ua> on 2005/12/08 12:42:58 UTC

[Axis2] Axis2 0.93 doesn't find resources in .aar

Hello axis-user,

  Axis2 version 0.93

  ..doesn't load resources from .aar for me.

  And so did 0.92.

  If i deploy the resources to axis2/WEB-INF/classes, they get loaded
  OK.
  
  Someone else faced this problem?

-- 
Best regards,
 Iwan                          mailto:imemruk@lohika.odessa.ua


Re: Re[2]: [Axis2] Axis2 0.93 doesn't find resources in .aar

Posted by Yves Langisch <li...@langisch.ch>.
This was an answer from Deepal from a similar posting:

The correct way is get the ServiceDescription from , MessageContxt and
then 
you can get the correct classloader for that service (which has all you
lib 
files) from serviceDescription
ClassLoader cl = sd.getClassLoader();
 
next you can load the properties you want.

Yves

On Thu, 2005-12-08 at 16:12 +0200, Iwan Memruk wrote:
> Hello Chathura,
> 
> Thursday, December 8, 2005, 4:08:15 PM, you wrote:
> 
> CH> Well i am not sure whethe i got your question right, if you are
> CH> talking about deploying an service then the .aar files should go to
> CH> $CATALINA_HOME\webapps\axis2\WEB-INF\services
> 
> CH> or pls use our nice admin interface to upload the aar.
> 
> CH> Chathura
> 
> Thanks for your concern. Here's a more detailed explanation:
> 
> 1. My application loads Hibernate config file (an XML) as a resource.
> 2. It works locally, e.g. when unit-testing.
> 3. It works when the service is deployed in the extracted form, i.e. classes AND
> resources in axis2/WEB-INF/classes, service as a directory in
> WEB-INF/services etc. My Hibernate config gets loaded OK.
> 4. When deployed as an .aar, the resources are not found, even though
> they are included in the .aar together with the classes.
> 
> CH> On 12/8/05, Iwan Memruk <im...@lohika.odessa.ua> wrote:
> >> Hello axis-user,
> >>
> >>   Axis2 version 0.93
> >>
> >>   ..doesn't load resources from .aar for me.
> >>
> >>   And so did 0.92.
> >>
> >>   If i deploy the resources to axis2/WEB-INF/classes, they get loaded
> >>   OK.
> >>
> >>   Someone else faced this problem?
> >>
> >> --
> >> Best regards,
> >>  Iwan                          mailto:imemruk@lohika.odessa.ua
> >>
> >>
> 
> 
> CH> --
> CH> Chathura Herath
> CH> http://www.bloglines.com/blog/chathurah
> 
> 
> 
> 


Re[4]: [Axis2] Axis2 0.93 doesn't find resources in .aar

Posted by Iwan Memruk <im...@lohika.odessa.ua>.
Hello Deepal,

Friday, December 9, 2005, 5:00:57 AM, you wrote:

DJ> Hi Iwan ;

DJ> To load your resources the right way is get the class loader from 
DJ> AxisService and using that load your resources. As an example say your
DJ> archive file name is foo.aar then the step is as follows;
DJ>    1. If you are going to use that at the MessageReciever level , get the
DJ> axisService from msgContext and then
DJ>    2. axisService.getClassLoader(); will give you the class loader
DJ> corresponding to the service , and using that you can load your resources in
DJ> archive file.

DJ> If you are in a place that you do not have a msgContext , then you have to
DJ> get your service from AxisConfiguration and ask its class loader.

    How exactly can I do that?

    Thanks!

DJ> Note : Since axis2 service are isolated (they have their own class loader) ,
DJ> the resources you put into archive file can not be taken from CCL.

DJ> Thanks,
DJ>  Deepal
DJ> ................................................................
DJ> ~Future is Open~

DJ> ----- Original Message ----- 
DJ> From: "Iwan Memruk" <im...@lohika.odessa.ua>
DJ> To: "Chathura Herath" <ch...@gmail.com>
DJ> Cc: <ax...@ws.apache.org>
DJ> Sent: Thursday, December 08, 2005 8:12 PM
DJ> Subject: Re[2]: [Axis2] Axis2 0.93 doesn't find resources in .aar


>> Hello Chathura,
>>
>> Thursday, December 8, 2005, 4:08:15 PM, you wrote:
>>
>> CH> Well i am not sure whethe i got your question right, if you are
>> CH> talking about deploying an service then the .aar files should go to
>> CH> $CATALINA_HOME\webapps\axis2\WEB-INF\services
>>
>> CH> or pls use our nice admin interface to upload the aar.
>>
>> CH> Chathura
>>
>> Thanks for your concern. Here's a more detailed explanation:
>>
>> 1. My application loads Hibernate config file (an XML) as a resource.
>> 2. It works locally, e.g. when unit-testing.
>> 3. It works when the service is deployed in the extracted form, i.e.
>> classes AND
>> resources in axis2/WEB-INF/classes, service as a directory in
>> WEB-INF/services etc. My Hibernate config gets loaded OK.
>> 4. When deployed as an .aar, the resources are not found, even though
>> they are included in the .aar together with the classes.
>>
>> CH> On 12/8/05, Iwan Memruk <im...@lohika.odessa.ua> wrote:
>>>> Hello axis-user,
>>>>
>>>>   Axis2 version 0.93
>>>>
>>>>   ..doesn't load resources from .aar for me.
>>>>
>>>>   And so did 0.92.
>>>>
>>>>   If i deploy the resources to axis2/WEB-INF/classes, they get loaded
>>>>   OK.
>>>>
>>>>   Someone else faced this problem?
>>>>
>>>> --
>>>> Best regards,
>>>>  Iwan                          mailto:imemruk@lohika.odessa.ua
>>>>
>>>>
>>
>>
>> CH> --
>> CH> Chathura Herath
>> CH> http://www.bloglines.com/blog/chathurah
>>
>>
>>
>>
>> -- 
>> Best regards,
>> Iwan                            mailto:imemruk@lohika.odessa.ua
>>
>> 





-- 
Best regards,
 Iwan                            mailto:imemruk@lohika.odessa.ua


Re: Re[2]: [Axis2] Axis2 0.93 doesn't find resources in .aar

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Iwan ;

To load your resources the right way is get the class loader from 
AxisService and using that load your resources. As an example say your 
archive file name is foo.aar then the step is as follows;
   1. If you are going to use that at the MessageReciever level , get the 
axisService from msgContext and then
   2. axisService.getClassLoader(); will give you the class loader 
corresponding to the service , and using that you can load your resources in 
archive file.

If you are in a place that you do not have a msgContext , then you have to 
get your service from AxisConfiguration and ask its class loader.

Note : Since axis2 service are isolated (they have their own class loader) , 
the resources you put into archive file can not be taken from CCL.

Thanks,
 Deepal
................................................................
~Future is Open~

----- Original Message ----- 
From: "Iwan Memruk" <im...@lohika.odessa.ua>
To: "Chathura Herath" <ch...@gmail.com>
Cc: <ax...@ws.apache.org>
Sent: Thursday, December 08, 2005 8:12 PM
Subject: Re[2]: [Axis2] Axis2 0.93 doesn't find resources in .aar


> Hello Chathura,
>
> Thursday, December 8, 2005, 4:08:15 PM, you wrote:
>
> CH> Well i am not sure whethe i got your question right, if you are
> CH> talking about deploying an service then the .aar files should go to
> CH> $CATALINA_HOME\webapps\axis2\WEB-INF\services
>
> CH> or pls use our nice admin interface to upload the aar.
>
> CH> Chathura
>
> Thanks for your concern. Here's a more detailed explanation:
>
> 1. My application loads Hibernate config file (an XML) as a resource.
> 2. It works locally, e.g. when unit-testing.
> 3. It works when the service is deployed in the extracted form, i.e. 
> classes AND
> resources in axis2/WEB-INF/classes, service as a directory in
> WEB-INF/services etc. My Hibernate config gets loaded OK.
> 4. When deployed as an .aar, the resources are not found, even though
> they are included in the .aar together with the classes.
>
> CH> On 12/8/05, Iwan Memruk <im...@lohika.odessa.ua> wrote:
>>> Hello axis-user,
>>>
>>>   Axis2 version 0.93
>>>
>>>   ..doesn't load resources from .aar for me.
>>>
>>>   And so did 0.92.
>>>
>>>   If i deploy the resources to axis2/WEB-INF/classes, they get loaded
>>>   OK.
>>>
>>>   Someone else faced this problem?
>>>
>>> --
>>> Best regards,
>>>  Iwan                          mailto:imemruk@lohika.odessa.ua
>>>
>>>
>
>
> CH> --
> CH> Chathura Herath
> CH> http://www.bloglines.com/blog/chathurah
>
>
>
>
> -- 
> Best regards,
> Iwan                            mailto:imemruk@lohika.odessa.ua
>
> 



Re: [Axis2] Axis2 0.93 doesn't find resources in .aar

Posted by iksrazal <ik...@gmail.com>.
Just a quick comment. This is a known problem that some people on the dev list 
are working on. 

In the meantime, this is how I deploy, using spring/hibernate etc . 

AAR: 

 .
./SWALoginEndpoint.aar
./META-INF
./META-INF/MANIFEST.MF
./META-INF/SWALoginEndpoint.wsdl
./META-INF/services.xml
./com
./com/siemens
./com/siemens/swa
./com/siemens/swa/plugins
./com/siemens/swa/plugins/webservices
./com/siemens/swa/plugins/webservices/autodispatch
./com/siemens/swa/plugins/webservices/autodispatch/SWALoginEndpointSkeleton.class

All wsdl2java generated files go into a jar in WEB-INF/lib, except 
SWALoginEndpointSkeleton.class , and your *CallbackHandler if you change/use 
it. 

All dependencies go under WEB-INF/lib or WEB-INF/classes . 

This hopefully will get worked out soon, as hot deploy becomes an issue if 
there are dependencies in WEB-INF/lib and/or WEB-INF/classes . 

HTH, 
iksrazal

Em Quinta 08 Dezembro 2005 12:12, o Iwan Memruk escreveu:
> Hello Chathura,
>
> Thursday, December 8, 2005, 4:08:15 PM, you wrote:
>
> CH> Well i am not sure whethe i got your question right, if you are
> CH> talking about deploying an service then the .aar files should go to
> CH> $CATALINA_HOME\webapps\axis2\WEB-INF\services
>
> CH> or pls use our nice admin interface to upload the aar.
>
> CH> Chathura
>
> Thanks for your concern. Here's a more detailed explanation:
>
> 1. My application loads Hibernate config file (an XML) as a resource.
> 2. It works locally, e.g. when unit-testing.
> 3. It works when the service is deployed in the extracted form, i.e.
> classes AND resources in axis2/WEB-INF/classes, service as a directory in
> WEB-INF/services etc. My Hibernate config gets loaded OK.
> 4. When deployed as an .aar, the resources are not found, even though
> they are included in the .aar together with the classes.
>
> CH> On 12/8/05, Iwan Memruk <im...@lohika.odessa.ua> wrote:
> >> Hello axis-user,
> >>
> >>   Axis2 version 0.93
> >>
> >>   ..doesn't load resources from .aar for me.
> >>
> >>   And so did 0.92.
> >>
> >>   If i deploy the resources to axis2/WEB-INF/classes, they get loaded
> >>   OK.
> >>
> >>   Someone else faced this problem?
> >>
> >> --
> >> Best regards,
> >>  Iwan                          mailto:imemruk@lohika.odessa.ua
>
> CH> --
> CH> Chathura Herath
> CH> http://www.bloglines.com/blog/chathurah

Re[2]: [Axis2] Axis2 0.93 doesn't find resources in .aar

Posted by Iwan Memruk <im...@lohika.odessa.ua>.
Hello Chathura,

Thursday, December 8, 2005, 4:08:15 PM, you wrote:

CH> Well i am not sure whethe i got your question right, if you are
CH> talking about deploying an service then the .aar files should go to
CH> $CATALINA_HOME\webapps\axis2\WEB-INF\services

CH> or pls use our nice admin interface to upload the aar.

CH> Chathura

Thanks for your concern. Here's a more detailed explanation:

1. My application loads Hibernate config file (an XML) as a resource.
2. It works locally, e.g. when unit-testing.
3. It works when the service is deployed in the extracted form, i.e. classes AND
resources in axis2/WEB-INF/classes, service as a directory in
WEB-INF/services etc. My Hibernate config gets loaded OK.
4. When deployed as an .aar, the resources are not found, even though
they are included in the .aar together with the classes.

CH> On 12/8/05, Iwan Memruk <im...@lohika.odessa.ua> wrote:
>> Hello axis-user,
>>
>>   Axis2 version 0.93
>>
>>   ..doesn't load resources from .aar for me.
>>
>>   And so did 0.92.
>>
>>   If i deploy the resources to axis2/WEB-INF/classes, they get loaded
>>   OK.
>>
>>   Someone else faced this problem?
>>
>> --
>> Best regards,
>>  Iwan                          mailto:imemruk@lohika.odessa.ua
>>
>>


CH> --
CH> Chathura Herath
CH> http://www.bloglines.com/blog/chathurah




-- 
Best regards,
 Iwan                            mailto:imemruk@lohika.odessa.ua


Re: [Axis2] Axis2 0.93 doesn't find resources in .aar

Posted by Chathura Herath <ch...@gmail.com>.
Well i am not sure whethe i got your question right, if you are
talking about deploying an service then the .aar files should go to
$CATALINA_HOME\webapps\axis2\WEB-INF\services

or pls use our nice admin interface to upload the aar.

Chathura

On 12/8/05, Iwan Memruk <im...@lohika.odessa.ua> wrote:
> Hello axis-user,
>
>   Axis2 version 0.93
>
>   ..doesn't load resources from .aar for me.
>
>   And so did 0.92.
>
>   If i deploy the resources to axis2/WEB-INF/classes, they get loaded
>   OK.
>
>   Someone else faced this problem?
>
> --
> Best regards,
>  Iwan                          mailto:imemruk@lohika.odessa.ua
>
>


--
Chathura Herath
http://www.bloglines.com/blog/chathurah

Re: Re[2]: [Axis2] Axis2 0.93 doesn't find resources in .aar

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Iwan;

hmmm , as you have explained that hibernate dose not take some other class 
loader rather it use TCCL , so my suggestion is to use that , I think this 
is special case that system need to use service resources so the best 
solution is to put ur resources into WEB-INF/lib or WEB-INF/classes.

If you are going to use service class loader , you have to explicitly ask 
that from the service , it wont come out of the box.

Thanks,
 Deepal
................................................................
~Future is Open~

----- Original Message ----- 
From: "Iwan Memruk" <im...@lohika.odessa.ua>
To: "Ajith Ranabahu" <aj...@gmail.com>
Cc: <ax...@ws.apache.org>
Sent: Friday, December 09, 2005 2:07 AM
Subject: Re[2]: [Axis2] Axis2 0.93 doesn't find resources in .aar


> Hello Ajith,
>
> Friday, December 9, 2005, 5:16:30 AM, you wrote:
>
> AR> Hmm..
> AR> I guess the problem is likely to be that hibernate internally
> AR> tries toload some of its classes by itself and picks up a wrong
> AR> classloader! I'm not an expert of Hibernate but is there a way to
> AR> specifythe classloader when creating/calling hibernate methods ?
>
> I  must  specify that the problem is not with Hibernate. The Hibernate
> mapping file was just an example. Other resources, such as spring bean
> XML descriptor and others don't get loaded either.
>
> Deepal  --  could you please explain -- does it work out of the box or
> did you have to do the trick with getting the classloader that you had
> described to me?
>
> The  problem  is, I could get the classloader as you specified, but it
> would break the code elegance (my business code is agnostic w.r.t. the
> service  platform  used). Plus Hibernate does not allow to specify the
> classloader to use in order to load its config.
>
> Thanks everybody for helping.
>
> AR> On 12/9/05, Deepal Jayasinghe <de...@opensource.lk> wrote:Hi Iwan;
>
> AR> I just checked and it worked me as required.
>
> AR> Thanks,
> AR>  Deepal
> AR> ................................................................
> AR> ~Future is Open~
>
> AR> ----- Original Message -----
> AR> From: "Iwan Memruk" <im...@lohika.odessa.ua>
> AR> To: <ax...@ws.apache.org>
> AR> Sent: Thursday, December 08, 2005 5:42 PM
> AR> Subject: [Axis2] Axis2 0.93 doesn't find resources in .aar
>
>
>>> Hello axis-user,
>>>
>>> Axis2 version 0.93
>>>
>>> ..doesn't load resources from .aar for me.
>>>
>>> And so did 0.92.
>>>
>>> If i deploy the resources to axis2/WEB-INF/classes, they get loaded
>>> OK.
>>>
>>> Someone else faced this problem?
>>>
>>> --
>>> Best regards,
>>>Iwan mailto:imemruk@lohika.odessa.ua
>>>
>>>
>
>
>
>
>
>
>
>
>
>
>
> -- 
> Best regards,
> Iwan                            mailto:imemruk@lohika.odessa.ua
>
> 



Re[2]: [Axis2] Axis2 0.93 doesn't find resources in .aar

Posted by Iwan Memruk <im...@lohika.odessa.ua>.
Hello Ajith,

Friday, December 9, 2005, 5:16:30 AM, you wrote:

AR> Hmm..
AR> I guess the problem is likely to be that hibernate internally
AR> tries toload some of its classes by itself  and picks up a wrong
AR> classloader! I'm not an expert of Hibernate but is there a way to
AR> specifythe classloader when creating/calling hibernate methods ?

I  must  specify that the problem is not with Hibernate. The Hibernate
mapping file was just an example. Other resources, such as spring bean
XML descriptor and others don't get loaded either.

Deepal  --  could you please explain -- does it work out of the box or
did you have to do the trick with getting the classloader that you had
described to me?

The  problem  is, I could get the classloader as you specified, but it
would break the code elegance (my business code is agnostic w.r.t. the
service  platform  used). Plus Hibernate does not allow to specify the
classloader to use in order to load its config.

Thanks everybody for helping.

AR> On 12/9/05, Deepal Jayasinghe <de...@opensource.lk> wrote:Hi Iwan;

AR> I just checked and it worked me as required.

AR> Thanks,
AR>  Deepal
AR> ................................................................
AR> ~Future is Open~

AR> ----- Original Message -----
AR> From: "Iwan Memruk" <im...@lohika.odessa.ua>
AR> To: <ax...@ws.apache.org>
AR> Sent: Thursday, December 08, 2005 5:42 PM
AR> Subject: [Axis2] Axis2 0.93 doesn't find resources in .aar


>> Hello axis-user,
>>
>>  Axis2 version 0.93
>>
>>  ..doesn't load resources from .aar for me.
>>
>>  And so did 0.92.
>>
>>  If i deploy the resources to axis2/WEB-INF/classes, they get loaded
>>  OK.
>>
>>  Someone else faced this problem?
>>
>> --
>> Best regards,
>>Iwan                          mailto:imemruk@lohika.odessa.ua
>>
>>











-- 
Best regards,
 Iwan                            mailto:imemruk@lohika.odessa.ua


Re: [Axis2] Axis2 0.93 doesn't find resources in .aar

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hmm..
I guess the problem is likely to be that hibernate internally tries to load
some of its classes by itself  and picks up a wrong class loader! I'm not an
expert of Hibernate but is there a way to specify the classloader when
creating/calling hibernate methods ?

On 12/9/05, Deepal Jayasinghe <de...@opensource.lk> wrote:
>
> Hi Iwan;
>
> I just checked and it worked me as required.
>
> Thanks,
> Deepal
> ................................................................
> ~Future is Open~
>
> ----- Original Message -----
> From: "Iwan Memruk" <im...@lohika.odessa.ua>
> To: <ax...@ws.apache.org>
> Sent: Thursday, December 08, 2005 5:42 PM
> Subject: [Axis2] Axis2 0.93 doesn't find resources in .aar
>
>
> > Hello axis-user,
> >
> >  Axis2 version 0.93
> >
> >  ..doesn't load resources from .aar for me.
> >
> >  And so did 0.92.
> >
> >  If i deploy the resources to axis2/WEB-INF/classes, they get loaded
> >  OK.
> >
> >  Someone else faced this problem?
> >
> > --
> > Best regards,
> > Iwan                          mailto:imemruk@lohika.odessa.ua
> >
> >
>
>


--
Ajith Ranabahu

Re: [Axis2] Axis2 0.93 doesn't find resources in .aar

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Iwan;

I just checked and it worked me as required.

Thanks,
 Deepal
................................................................
~Future is Open~

----- Original Message ----- 
From: "Iwan Memruk" <im...@lohika.odessa.ua>
To: <ax...@ws.apache.org>
Sent: Thursday, December 08, 2005 5:42 PM
Subject: [Axis2] Axis2 0.93 doesn't find resources in .aar


> Hello axis-user,
> 
>  Axis2 version 0.93
> 
>  ..doesn't load resources from .aar for me.
> 
>  And so did 0.92.
> 
>  If i deploy the resources to axis2/WEB-INF/classes, they get loaded
>  OK.
>  
>  Someone else faced this problem?
> 
> -- 
> Best regards,
> Iwan                          mailto:imemruk@lohika.odessa.ua
> 
>