You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Seem <si...@gmx.de> on 2009/06/30 15:12:28 UTC

unpacked service in tomcat, getResource Problem - wrong Classloader

Hi,

i built a Webservice like the given Tutorial from Eclipse:
http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html

so I can get a standalone WS which is unpacked and not inside an .aar. In
this way, I can easily debug und develop the service with eclipse and
tomcat. But now I have to read a file which is inside the META-INF of my
service and i can not get the right operation to access the file. I do not
want to hardcode the absolute path. I tried the following:

        	InputStream is =
myClass.class.getClassLoader().getResourceAsStream("META-INF/info.xml");

when i check the actual classloader, then it points to:
        	tomcat/apache-tomcat-6.0.20/lib/
and not inside my Service, which should be under
        
tomcat/apache-tomcat-6.0.20/webapps/test/WEB-INF/services/TestService/

I tried to use ServletContext context = getServletConfig(
).getServletContext( );
 InputStream is  = context.getResourceAsStream(...); 

but it is inside a POJO, so i have no access to the ServletContext.

What can I do?

Is there another way to handle a AXiS2 WS in an unpacked way on the server?
 Because I want to do some I/O operations and i want to handle files inside
the service folders, which is inpossible with an .aar archive.

Thanks,
Seem


-- 
View this message in context: http://www.nabble.com/unpacked-service-in-tomcat%2C-getResource-Problem---wrong-Classloader-tp24271633p24271633.html
Sent from the Axis - User mailing list archive at Nabble.com.