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 Giles Paterson <gp...@runservicenet.com> on 2002/09/26 18:34:42 UTC

RC1 Bug (Was: RE: RC1 Deployment problem, possible bug?)

> -----Original Message-----
> From: Giles Paterson
> Sent: 26 September 2002 10:07
> To: axis-user@xml.apache.org
> Subject: FW: RC1 Deployment problem, possible bug?
> 
> 
> When stepping through the code, it looks as though axis can't find the
> server-config.wsdd file (which resides within the WAR file's WEB-INF
> directory).
> Further investigation reveals that the following line in AxisServletBase:
> 
> String webInfPath = context.getRealPath("/WEB-INF");
> 
> is returning null.
> 
> Am I just missing some configuration parameters or is this, as I suspect,
> a bug similar to 10512 where getRealPath() can't be used within a war or
> ear file.

I've done some further investigation and have found a fix to the problem. Unfortunately it has required a number of small changes to the axis code.

Basically this problem is related to the use of getRealPath() in various classes.

According to the javax.servlet.ServletContext (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html#getResource(java.lang.String)) JavaDoc:

"This method returns null  if the servlet container cannot translate the virtual path to a real path for any reason (such as when the content is being made available from a .war archive)."

To work around this problem, I have taken the fix suggested in Bug 10512 and applied it to all instances of getRealPath in the axis code. After each use of getRealPath I have checked to see if the result was null and if it was, I called getResource() instead.

The classes I modified were:

org.apache.axis.configuration.EngineConfigurationFactoryServlet
org.apache.axis.server.JNDIAxisServerFactory
org.apache.axis.transport.http.AxisServlet
org.apache.axis.transport.http.AxisServletBase

Whilst this fix works, I'm not sure if it is an optimal solution as I haven't fully delved into the intricacies of the axis source (what with pressing deadlines and all ;-) 

Does anyone have any comments or suggestions to make about this? Should I post a message to the axis-dev list, and does anyone know if this is a known bug or not (I haven't found anything apart from 10512 in bugzilla that relates to this)?

In my view the reason that this problem is often overlooked, is that some application servers, such as tomcat implement getRealPath in such a way that it works within war files, however app servers such as Weblogic don't. Although I can't find the URL at the moment, I remember reading in the servlet spec that app servers aren't required to expand WAR files on execution and hence aren't required to return values to getRealPath.

Regards,

-- 
Giles Paterson