axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Lepine" <mlep...@goperiscope.com>
Subject RE: service classpath
Date Thu, 21 Jun 2007 13:00:07 GMT
That makes sense. Thank you for the response.

 

________________________________

From: Chad DeBauch [mailto:cdebauch@gmail.com] 
Sent: Wednesday, June 20, 2007 8:45 PM
To: axis-user@ws.apache.org
Subject: Re: service classpath

 

Each aar file that you deploy has its own ClassLoader.  If there is code
in your service that needs to get resources such as xml files you need
to pass it the ClassLoader for that service.  For example if you have
this iBatis method in your service Resources.getResourceAsReader(String
resource), you must use this one instead
Resources.getResourceAsReader(ClassLoader classLoader, String resource).
You can get access to the ClassLoader for that service by calling

MessageContext.getCurrentMessageContext().getAxisService().getClassLoade
r();

If you are not able to change the code that gets the resources, then you
have to put the resources in the WEB-INF/classes directory or if it is
bundled in a jar put it in WEB-INF/lib directory. 

Chad

On 6/20/07, Michael Lepine <mlepine@goperiscope.com> wrote:

Hello all. I still have classpath issues with my deployed aar archive
file and am hoping for some guidance. (My original post is below and
mentions log4j configuration as part of my issue, but that a side effect
of my classpath issue.)  I've reviewed the docs, faqs and wiki entries
on the Axis2 site and cannot find any topics on this, so I probably am
just missing something.

 

There are XML configuration files that my service needs access to when
deployed; however, with the aar configuration below, it does not find
them on the classpath once deployed. 

 

How do I deploy my service with configuration files so that it can find
and access those resources? Do I need to deploy the service differently?

 

Any guidance (and your time) is appreciated. Thank you.

 

 

________________________________

From: Michael Lepine [mailto:mlepine@goperiscope.com] 
Sent: Tuesday, June 19, 2007 10:23 AM
To: axis-user@ws.apache.org
Subject: service classpath

 

I'm not overly familiar with web services, but I've created a POJO-based
web service and am having difficultly logging from the service. The aar
archive has the following top-level directory structure:

 

com - class files under the com.xxx.xxx... package

META-INF - folder containing the services.xml

lib - folder containing library (jar/zip) files for service

commons-logging.properties - property file for logging configuration

log4j.properties - property file for log4j configuration

other.xml - other xml files that need to be accessible via the classpath

 

I'm deploying the aar file to the following folder under the tomcat
(version 5.0.28) installation directory:

 

[TOMCAT_HOME]\webapps\axis\WEB-INF\services

 

The service is being deployed correctly and appears to be working.

 

So, should my properties and xml files be accessible via the classpath
or am I doing something wrong?

 

Any guidance is appreciated. Thank you.

 

- Mike

 


Mime
View raw message