You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Jörn Gebhardt <Jo...@ptv.de> on 2004/03/16 15:59:01 UTC

ENTITY resolving difference between Win XP and Win 2000??!!!

HI,

we encounter the following very strange problem:

We have an XML document that looks like this:

  <?xml version="1.0"?>

  <!DOCTYPE dependencies [
    <!ENTITY ProductDependencies SYSTEM "../product-dep.xml">
  ]>

  <project
      xmlns:j="jelly:core">
  ...
      <dependencies>
          <!-- insert dependencies from ../product-dep.xml file -->
          &ProductDependencies;
  ...
     </dependencies>
  ...
  </project>

I.e. we want to include some entries in the dependencies section from
another file (by the way, this XML docuemnt is a Maven project description
file...). As this works perfectly fine under Windows 2000 and Windows NT it
causes the following problem unter Windows XP:

java.net.UnknownHostException:
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
        at java.net.Socket.connect(Socket.java:452)
        at java.net.Socket.connect(Socket.java:402)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
        at sun.net.NetworkClient.openServer(NetworkClient.java:118)
        at sun.net.ftp.FtpClient.openServer(FtpClient.java:423)
        at sun.net.ftp.FtpClient.<init>(FtpClient.java:692)
        at
sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.ja
va:175)
        at
sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnec
tion.java:257)
        at java.net.URL.openStream(URL.java:913)
        at
org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown So
urce)
        at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown
Source)
        at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEntityRefer
ence(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.commons.digester.Digester.parse(Digester.java:1527)
        at org.apache.maven.MavenUtils.getProject(MavenUtils.java:201)
        at org.apache.maven.MavenUtils.getProject(MavenUtils.java:161)
        at
org.apache.maven.MavenSession.initializeRootProject(MavenSession.java
:324)
        at org.apache.maven.MavenSession.initialize(MavenSession.java:234)
        at org.apache.maven.cli.App.doMain(App.java:532)
        at org.apache.maven.cli.App.main(App.java:1109)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.werken.forehead.Forehead.run(Forehead.java:551)
        at com.werken.forehead.Forehead.main(Forehead.java:581)


For some strange reasons Xerces tries to open a FTP connection under XP
instead of just reading the file. Has anybody an idea what is going on here
and why this problem occurs only under Windows XP?

Thanks in advance,
Joern


Re: ENTITY resolving difference between Win XP and Win 2000??!!!

Posted by Michael Glavassevich <mr...@apache.org>.
Hi,

What is the base URI of your document? I would guess that it looks
something like 'file://C:/file.xml' (in which case you probably meant
'file:///C:/file.xml') or 'file://somehost/C:/file.xml', which would
explain why it's trying to fetch the entity over FTP.

On Tue, 16 Mar 2004, [iso-8859-1] J�rn Gebhardt wrote:

> HI,
>
> we encounter the following very strange problem:
>
> We have an XML document that looks like this:
>
>   <?xml version="1.0"?>
>
>   <!DOCTYPE dependencies [
>     <!ENTITY ProductDependencies SYSTEM "../product-dep.xml">
>   ]>
>
>   <project
>       xmlns:j="jelly:core">
>   ...
>       <dependencies>
>           <!-- insert dependencies from ../product-dep.xml file -->
>           &ProductDependencies;
>   ...
>      </dependencies>
>   ...
>   </project>
>
> I.e. we want to include some entries in the dependencies section from
> another file (by the way, this XML docuemnt is a Maven project description
> file...). As this works perfectly fine under Windows 2000 and Windows NT it
> causes the following problem unter Windows XP:
>
> java.net.UnknownHostException:
>         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
>         at java.net.Socket.connect(Socket.java:452)
>         at java.net.Socket.connect(Socket.java:402)
>         at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
>         at sun.net.NetworkClient.openServer(NetworkClient.java:118)
>         at sun.net.ftp.FtpClient.openServer(FtpClient.java:423)
>         at sun.net.ftp.FtpClient.<init>(FtpClient.java:692)
>         at
> sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.ja
> va:175)
>         at
> sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnec
> tion.java:257)
>         at java.net.URL.openStream(URL.java:913)
>         at
> org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown So
> urce)
>         at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown
> Source)
>         at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown
> Source)
>         at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEntityRefer
> ence(Unknown Source)
>         at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
> Dispatcher.dispatch(Unknown Source)
>         at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
> known Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>         at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>         at org.apache.commons.digester.Digester.parse(Digester.java:1527)
>         at org.apache.maven.MavenUtils.getProject(MavenUtils.java:201)
>         at org.apache.maven.MavenUtils.getProject(MavenUtils.java:161)
>         at
> org.apache.maven.MavenSession.initializeRootProject(MavenSession.java
> :324)
>         at org.apache.maven.MavenSession.initialize(MavenSession.java:234)
>         at org.apache.maven.cli.App.doMain(App.java:532)
>         at org.apache.maven.cli.App.main(App.java:1109)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at com.werken.forehead.Forehead.run(Forehead.java:551)
>         at com.werken.forehead.Forehead.main(Forehead.java:581)
>
>
> For some strange reasons Xerces tries to open a FTP connection under XP
> instead of just reading the file. Has anybody an idea what is going on here
> and why this problem occurs only under Windows XP?
>
> Thanks in advance,
> Joern

---------------------------
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org