Is it blowing up or just not finding your data file?
In my services, I have to use a different class-loader depending on
whether or not the .aar file is exploded.
E.g.
InputStream input =
AuthenticationHandler.class.getClassLoader().getResourceAsStream(
"service.properties");
if ( input == null) {
// Loading from an .aar file, so have to use parent class loader!
input =
AuthenticationHandler.class.getClassLoader().getParent().getResourceAsStream(
"service.properties");
}
props.load( input);
Brian Panulla wrote:
I'm just getting started with Axis2. I have a data file for testing my
first Web service that I would like to bundle up in the aar file, but
I can't seem to read the file when I deploy the service to the Web
server. I'm using Axis 2 1.3.2, running using the built in Web server.
My aar is structured like this:
/
|_____data/myDatafile
|
|_____edu.psu.ist.nc2if.ws.myWebService
|
|____ META-INF/services.xml
Here's what I'm trying to do as part of myWebService:
String inputDataFile = "/data/myDataFile";
// Build a URL object as a handle to the sample data file
URL DataUrl = getClass().getResource(inputDataFile);
/* URL InputStream through a Buffered read to read a line
at a time */
BufferedReader bufRead = new BufferedReader(
new InputStreamReader( DataUrl.openStream() ));
This works great when I unit test within Eclipse, but there's
something blowing up when I build the aar and deploy it.
I need to learn more about logging and debugging services, so that's
definitely my next step, but I thought I'd ping the list to see if
this is something i'm just not seeing here.
Any suggestions?
-B
--
Anthony
-------------------------------------
Anthony Bull
Senior Developer
Black Coffee Software Ltd
PO Box 10-192 The Terrace
Wellington, New Zealand
[EMAIL PROTECTED]
Ph +64 4 472 8818
Fax +64 4 472 8811
-------------------------------------
www.bcsoft.co.nz
---------------------------------------------------------------
This email may contain confidential or privileged information,
and is intended for use only by the addressee, or addressees.
If you are not the intended recipient please advise the sender
immediately and do not copy, use or disclose the contents to
any other person or organisation.
Black Coffee Software Ltd accepts no responsibility for viruses
received with this email, or to any changes made to the original
content. Any views or opinions expressed in this email may be
personal to the sender and are not necessarily those of Black
Coffee Software Ltd.
---------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]