Hi all, a question similar to this message-context [1]
[1] http://www.nabble.com/Path-to-a-resource-inside-an-aar-tp19506606p195083 56.html I followed Deepal's link to http://wso2.org/library/259 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); and >getClass().getClassLoader().getResourceAsStream("file.txt"); Both ways don't find the file. If I debug my read-method, the loader shows in both cases: WebappClassLoader delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: [EMAIL PROTECTED] 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 ? Thanks, Markus --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
