axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SGruver...@intellicare.com
Subject Re: loading resources from service archive?
Date Thu, 28 Feb 2008 15:27:07 GMT
Anthony,

Thanks for your suggestion - still not working for me.

Here's what I tried - perhaps you can spot something newbie I'm doing:

public class MyService implements MyServiceInterface{

      // Session startup handler.
      public void init( ServiceContext ctx ) {

            ClassLoader cl = MyService.class.getClassLoader();
            ClassLoader clp = MyService.class.getClassLoader().getParent();

            InputStream input = cl.getResourceAsStream( "log4j.xml");
            InputStream input2 = cl.getResourceAsStream( "log4j.xml");

            JarFile jar;
            ZipEntry ze;
            try {
                  jar = new JarFile(
"C:\\dev\\wspace\\MyService\\WebContent\\WEB-INF\\services\\MyService.aar"
);
                  ze = jar.getEntry( "log4j.xml");

            } catch (IOException e) {
            }
      }

      // ... service operations implementations
}

Notes:
   At the moment I'm doing this in Eclipse - that does tend to complicate
   things.
   MyServiceInterface is the renamed skeleton interface generate by
   WSDL2Java.
   Both class loaders return (different) non-null references.
   Both input streams return null.
   The aar file and the contained xml file that I'm trying to load as a
   resource are both found.

Any further suggestion are most appreciated!

- Steve



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message