axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grimm, Markus" <>
Subject READ a resource inside an aar
Date Thu, 18 Sep 2008 13:17:32 GMT
Hi all,

a question similar to this message-context [1]


I followed Deepal's link to
and tried to read a file inside the service-archive (*.aar). 
the file is in the same folder as the ServiceImpl-class and
the SerciveImpl-class wants to read the file as an inutStream.

I tried both ways:

> 	MessageContext ctx = MessageContext.getCurrentMessageContext();
> 	AxisService svc = ctx.getAxisService();
> 	ClassLoader loader = svc.getClassLoader();
> 	String filename = (String)svc.getParameterValue("file.txt");
> 	InputStream is = loader.getResourceAsStream(filename);



Both ways don't find the file. If I debug my read-method, the loader
shows in both cases:

  delegate: false
----------> Parent Classloader:

So, if I put the 'file.txt' to the /WEB-INF/classes/ -folder, I can read
the file.
How can I get the classloader of the single service, so I can read a
resouce that resides inside of an archive ?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message