axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Glosband <>
Subject RE: Trying to find server-config.xml
Date Wed, 08 Aug 2001 15:14:18 GMT
I think you are much safer using getRealPath("") instead of
getRealPath("/"). You are supposed to pass getRealPath a virtual path to a
file on your file system, you would not have a file "/" so I am not suprised
that many vendors ignore this. If my webapp is installed under
D:\jakarta-tomcat\myApp, calling getRealPath("/foo.html"), the file
"foo.html" doesn't have to exist, will return
"D:\jakarta-tomcat\myApp\foo.html". Calling getRealPath("/") may return the
path to "/", so "D:\jakarta-tomcat\myApp\" or it might ignore it giving you
"D:\jakarta-tomcat\myApp". If you want the base path to your webapp, I would
always use getRealPath(""), then you can tack on the rest of the path to
your file, so "\WEB-INF\server-config.xml".
 -----Original Message-----
From: Mark DeLanoy []
Sent: Tuesday, August 07, 2001 5:52 PM
Subject: Trying to find server-config.xml

I'm running orion server 1.5.2 on Windows NT 4.0 SP6 and during the server
startup I get an exception.  It looks as though Axis is NOT adding a
backslash to the path.  For portability across j2ee vendor reasons we test
to see if there's a backslash and if not we add it prior to appending the
any relative paths.  Here's some sample code of a possible fix.
        ServletContext servletContext = getServletContext();
        // save servlet real path
        realPath = servletContext.getRealPath( "/" );
        if( !realPath.endsWith( "/" ) && !realPath.endsWith( "\\" ) )
          realPath += "/";

        // After the realPath you could add the WEB-INF\server-config.xml
With this fix you'd be able to run on Orionserver (also the new Oracle 9i),
IPlanet, Websphere, BEA and JRUN as we're running on all of those.  Could
someone make this fix as I don't have access to CVS.   Thanks, MD
D:\niku\union\src\webrootWEB-INF\server-config.xml (The system cannot find
the path specified)
        at Method)
        at<init>(Unknown Source)
        at<init>(Unknown Source)
        at org.apache.axis.AxisEngine.saveConfiguration(
        at org.apache.axis.utils.Admin.processEngineConfig(
        at org.apache.axis.AxisEngine.readConfiguration(
        at org.apache.axis.AxisEngine.init(
        at org.apache.axis.AxisEngine.<init>(
        at org.apache.axis.server.AxisServer.<init>(
        at javax.servlet.GenericServlet.init(
        at com.evermind._ah._axe(Unknown Source)
        at com.evermind._ah._fpd(Unknown Source)
        at com.evermind._ah._bae(Unknown Source)
        at com.evermind._ah._bie(Unknown Source)
        at com.evermind._ah.<init>(Unknown Source)
        at com.evermind._ck._czc(Unknown Source)
        at com.evermind._ae._czc(Unknown Source)
        at com.evermind._ab._crc(Unknown Source)
        at com.evermind._ab._at(Unknown Source)
        at com.evermind._ae._an(Unknown Source)
        at com.evermind._ae._at(Unknown Source)
        at com.evermind.server.ApplicationServer._wh(Unknown Source)
        at com.evermind.server.ApplicationServer._at(Unknown Source)
        at Source)
        at Source)
        at Source)
Orion/1.5.2 initialized

View raw message