문제

I am located behind a corporate proxy/firewall and, occasionally, my ANT build will fail with the following Exception:

java.io.IOException: Server returned HTTP response code: 502 for URL: http://java.sun.com/dtd/web-app_2_3.dtd

The web.xml in question is part of a third party library and I cannot change it and it has to be included in the .ear file.

I've tried to download the various dtds in question to a local folder add them to an XML Catalog, an extract below:

    <xmlcatalog id="dtds">
        <dtd publicid="-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN" location="${atg.home}/xsd/web-app_2_4.xsd" />
        <dtd publicid="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" location="${atg.home}/xsd/web-app_2_4.xsd" />
    </xmlcatalog>

The questions are:

a) Is it possible to disable validating the web.xml? Its part of the Application Server that doesn't change.

b) If I can't disable it, is xmlcatalog the correct approach to try and resolve it locally? Having followed the docs around this, I'm probably doing something wrong that means it doesn't work.

c) Are there alternatives?

Any help appreciated.

ps. I can happily build my application when not on the corporate network but then I don't have access to other services.

도움이 되었습니까?

해결책

Host the DTDs in question on a local server and override your hosts file to point at this new server.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top