Lets take the following scenario;
- you deploy a module called "foo.mar" into modules directory in the
repository
- The module contains service archives inside it (in side the services
directory of the module)
- In the mean while repository has folder called services and that has
services.list file too (current war bistro is like that)
- So deployment guy will create a URL class loader pointing to foo.mar
and the parent class loader of this class loader is the system class loader.
-Do all the module related stuff (reading module.xml etc etc...)
-When you adding service to AxisConfiguration it will get the module
and its class loader
- Using that class loader (as I know) you can get any resource inside
it , but you have to use relative path, for example if the archive file
like ;
foo.mar
MEAT-INF
-----
lib
myresourec.txt
InputStream in = classloader.getResourceAsStream("lib/
myresourec.txt"); , in this case in will not null , and if you try to
access resource using following (adding module name as prefix) it will
return null;
InputStream in = classloader.getResourceAsStream("foo.mar!/lib/
myresourec.txt");
Is this you mean by adding module name as prefix , or I am misunderstand
what you say
Sanjiva Weerawarana wrote:
>I'd like to understand why my proposed solution doesn't work first
>before taking a second choice solution ...
>
>Sanjiva.
>
>On Wed, 2006-06-28 at 18:01 +0530, Deepal Jayasinghe wrote:
>
>
>> +1
>>
>>
>>Davanum Srinivas wrote:
>>
>>
>>
>>>or even "module-services" and "module-services.list"
>>>
>>>-- dims
>>>
>>>On 6/28/06, Sanjiva Weerawarana <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>>
>>>>Hi Deepal,
>>>>
>>>>I *hate* "aars" :( .. uglier than hell!
>>>>
>>>>
>>>>
>>>>>That is what we had yesterday :) , but it causes problems in war
>>>>>distribution.
>>>>>The problem is this;
>>>>> When ever we show a module (at the deployment time) , get its class
>>>>>loader and try to invoke the following
>>>>> ClassLoader cl = module.getModuleClassLoader();
>>>>> InputStream fin =
>>>>>
>>>>>
>>>>moduleClassLoader.getResourceAsStream("services/"
>>>>
>>>>
>>>>>+ servicename);
>>>>>
>>>>>So in war case since we have services directory and services.list file
>>>>>in it , the inputstream is not null in all the cases (b'coz parent
>>>>>
>>>>>
>>>>class
>>>>
>>>>
>>>>>loader has the request resources). So when I deploy axis2.war into
>>>>>tomcat it failed today.
>>>>>
>>>>>
>>>>Why can't you prefix the module name to this code and avoid the problem?
>>>>
>>>>Sanjiva.
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>For additional commands, e-mail: [EMAIL PROTECTED]
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
--
Thanks,
Deepal
................................................................
~Future is Open~
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]