axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Glosband <aglosb...@macromedia.com>
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 [mailto:mdelanoy@niku.com]
Sent: Tuesday, August 07, 2001 5:52 PM
To: axis-dev@xml.apache.org
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
 
java.io.FileNotFoundException:
D:\niku\union\src\webrootWEB-INF\server-config.xml (The system cannot find
the path specified)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at org.apache.axis.AxisEngine.saveConfiguration(AxisEngine.java:245)
        at org.apache.axis.utils.Admin.processEngineConfig(Admin.java:194)
        at org.apache.axis.AxisEngine.readConfiguration(AxisEngine.java:231)
        at org.apache.axis.AxisEngine.init(AxisEngine.java:191)
        at org.apache.axis.AxisEngine.<init>(AxisEngine.java:139)
        at org.apache.axis.server.AxisServer.<init>(AxisServer.java:93)
        at
org.apache.axis.server.AxisServer.getSingleton(AxisServer.java:108)
        at
org.apache.axis.transport.http.AdminServlet.init(AdminServlet.java:81)
        at javax.servlet.GenericServlet.init(GenericServlet.java:44)
        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 com.evermind._in.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
        at com.evermind._if.run(Unknown Source)
Orion/1.5.2 initialized


Mime
View raw message