You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xml-commons-dev@xerces.apache.org by Norman Walsh <nd...@nwalsh.com> on 2005/05/04 22:15:14 UTC

Re: failure of new entity resolver on some OS

/ David Crossley <cr...@apache.org> was heard to say:
| Here are the unsuccessful startup messages on Win ...
| (using Windows XP SP2 + Cygwin)

What is in your CatalogManager.properties file?

| ------
| Parse catalog: 
| file:/D:/openSource/forrest/main/webapp/resources/schema/catalog.
| xcat
| Loading catalog: 
| file:/D:/openSource/forrest/main/webapp/resources/schema/catalo
| g.xcat
| Default BASE: 
| file://D:/D:/openSource/forrest/main/webapp/resources/schema/catal
| og.xcat

That looks really odd.

| Parse  text/plain catalog on input stream
| No CatalogReader for MIME type:  text/plain

Why is there an extra space in there? How did it decide the media type
was " text/plain"?

| When we revert to the old resolver.jar everything works
| on both platforms.

I can't reproduce the problems your experience, though I am
experiencing my own baffling problems.

C:\Documents and Settings\Norman Walsh\Java\tests\resolver>java -cp ..\..;..\..\
resolver.jar org.apache.xml.resolver.apps.xread test1.xml
Parse catalog: catalogs/main.catalog
Loading catalog: catalogs/main.catalog
Default BASE: file://C:/Documents and Settings/Norman Walsh/Java/tests/resolver/
catalogs/main.catalog
pcf: file://C:/Documents and Settings/Norman Walsh/Java/tests/resolver/catalogs/
main.catalog
java.net.UnknownHostException: C
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at sun.net.NetworkClient.doConnect(Unknown Source)
        at sun.net.NetworkClient.openServer(Unknown Source)
        at sun.net.ftp.FtpClient.openServer(Unknown Source)
        at sun.net.ftp.FtpClient.<init>(Unknown Source)
        at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(Unknown Sour
ce)
        at java.net.URL.openStream(Unknown Source)
        at org.apache.xml.resolver.Catalog.parseCatalogFile(Unknown Source)


The "pcf:" debugging message above convinces me that I've got a file: URI
in a URL object and I called 

  inStream = new DataInputStream(base.openStream());

and it failed with

java.net.UnknownHostException: C

which seems completely bogus to me.

Any Windows users out there have a clue?

                                        Be seeing you,
                                          norm

-- 
Norman.Walsh@Sun.COM / XML Standards Architect / Sun Microsystems, Inc.
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information.
Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.

Re: failure of new entity resolver on some OS

Posted by Norman Walsh <nd...@nwalsh.com>.
/ George Cristian Bina <ge...@sync.ro> was heard to say:
| The problem is that a file URL needs to either specify no host or
| specify it as empty, that is you can have either
| file:/path
| or
| file:///path
| Otherwise if you write file://c:/etc then c will be interpreated as
| host and thus the unknown host exception.

Bleh. Ok, I'll go through the code and take steps to make sure that
the file:// form isn't generated where base URIs and catalog file
names are manipulated.

I'm on vacation[1] starting, well, to be honest, as soon as I hit send
on this message :-), so I won't be able to commit any fixes before
19/20 May. Sorry for the delay.

                                        Be seeing you,
                                          norm

[1] http://norman.walsh.name/2005/itinerary/05-09-vacation
-- 
Norman.Walsh@Sun.COM / XML Standards Architect / Sun Microsystems, Inc.
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information.
Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.

Re: failure of new entity resolver on some OS

Posted by George Cristian Bina <ge...@sync.ro>.
Hi Norm,

The problem is that a file URL needs to either specify no host or 
specify it as empty, that is you can have either
file:/path
or
file:///path
Otherwise if you write file://c:/etc then c will be interpreated as host 
and thus the unknown host exception.

Hope that helps,
George
------------------------
http://www.oxygenxml.com

Norman Walsh wrote:
> / David Crossley <cr...@apache.org> was heard to say:
> | Here are the unsuccessful startup messages on Win ...
> | (using Windows XP SP2 + Cygwin)
> 
> What is in your CatalogManager.properties file?
> 
> | ------
> | Parse catalog: 
> | file:/D:/openSource/forrest/main/webapp/resources/schema/catalog.
> | xcat
> | Loading catalog: 
> | file:/D:/openSource/forrest/main/webapp/resources/schema/catalo
> | g.xcat
> | Default BASE: 
> | file://D:/D:/openSource/forrest/main/webapp/resources/schema/catal
> | og.xcat
> 
> That looks really odd.
> 
> | Parse  text/plain catalog on input stream
> | No CatalogReader for MIME type:  text/plain
> 
> Why is there an extra space in there? How did it decide the media type
> was " text/plain"?
> 
> | When we revert to the old resolver.jar everything works
> | on both platforms.
> 
> I can't reproduce the problems your experience, though I am
> experiencing my own baffling problems.
> 
> C:\Documents and Settings\Norman Walsh\Java\tests\resolver>java -cp ..\..;..\..\
> resolver.jar org.apache.xml.resolver.apps.xread test1.xml
> Parse catalog: catalogs/main.catalog
> Loading catalog: catalogs/main.catalog
> Default BASE: file://C:/Documents and Settings/Norman Walsh/Java/tests/resolver/
> catalogs/main.catalog
> pcf: file://C:/Documents and Settings/Norman Walsh/Java/tests/resolver/catalogs/
> main.catalog
> java.net.UnknownHostException: C
>         at java.net.PlainSocketImpl.connect(Unknown Source)
>         at java.net.Socket.connect(Unknown Source)
>         at java.net.Socket.connect(Unknown Source)
>         at sun.net.NetworkClient.doConnect(Unknown Source)
>         at sun.net.NetworkClient.openServer(Unknown Source)
>         at sun.net.ftp.FtpClient.openServer(Unknown Source)
>         at sun.net.ftp.FtpClient.<init>(Unknown Source)
>         at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)
>         at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(Unknown Sour
> ce)
>         at java.net.URL.openStream(Unknown Source)
>         at org.apache.xml.resolver.Catalog.parseCatalogFile(Unknown Source)
> 
> 
> The "pcf:" debugging message above convinces me that I've got a file: URI
> in a URL object and I called 
> 
>   inStream = new DataInputStream(base.openStream());
> 
> and it failed with
> 
> java.net.UnknownHostException: C
> 
> which seems completely bogus to me.
> 
> Any Windows users out there have a clue?
> 
>                                         Be seeing you,
>                                           norm
> 

Re: failure of new entity resolver on some OS

Posted by David Crossley <cr...@apache.org>.
Norman Walsh wrote:
> / David Crossley <cr...@apache.org> was heard to say:
> | Here are the unsuccessful startup messages on Win ...
> | (using Windows XP SP2 + Cygwin)
> 
> What is in your CatalogManager.properties file?

Not much at all. We load the main catalogs via programmatic
mechanisms when the app starts. We only have a CatalogManager.properties
file to silence the message about it not being found when the
parser starts.

Let me reinforce one major point. Everything worked beautifully
with the current release of the resolver. When we tried this
new version, a Windows user is now reporting these problems.

> | ------
> | Parse catalog: 
> | file:/D:/openSource/forrest/main/webapp/resources/schema/catalog.
> | xcat
> | Loading catalog: 
> | file:/D:/openSource/forrest/main/webapp/resources/schema/catalo
> | g.xcat
> | Default BASE: 
> | file://D:/D:/openSource/forrest/main/webapp/resources/schema/catal
> | og.xcat
> 
> That looks really odd.

Yes. In that catalog.xcat we do not declare a "BASE". So perhaps
it is the construction of the "Default BASE" URI on Windows that
is failing. No such problems on UNIX.

As George said, it needs to be either
file:/D:/openSource/...
or
file:///D:/openSource/...

> | Parse  text/plain catalog on input stream
> | No CatalogReader for MIME type:  text/plain
> 
> Why is there an extra space in there? How did it decide the media type
> was " text/plain"?

Dunno. Probably a side-effect of the broken URI.

> | When we revert to the old resolver.jar everything works
> | on both platforms.
> 
> I can't reproduce the problems your experience, though I am
> experiencing my own baffling problems.

Your issues below sound very similar.

--David

> C:\Documents and Settings\Norman Walsh\Java\tests\resolver>java -cp ..\..;..\..\
> resolver.jar org.apache.xml.resolver.apps.xread test1.xml
> Parse catalog: catalogs/main.catalog
> Loading catalog: catalogs/main.catalog
> Default BASE: file://C:/Documents and Settings/Norman Walsh/Java/tests/resolver/
> catalogs/main.catalog
> pcf: file://C:/Documents and Settings/Norman Walsh/Java/tests/resolver/catalogs/
> main.catalog
> java.net.UnknownHostException: C
>         at java.net.PlainSocketImpl.connect(Unknown Source)
>         at java.net.Socket.connect(Unknown Source)
>         at java.net.Socket.connect(Unknown Source)
>         at sun.net.NetworkClient.doConnect(Unknown Source)
>         at sun.net.NetworkClient.openServer(Unknown Source)
>         at sun.net.ftp.FtpClient.openServer(Unknown Source)
>         at sun.net.ftp.FtpClient.<init>(Unknown Source)
>         at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)
>         at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(Unknown Sour
> ce)
>         at java.net.URL.openStream(Unknown Source)
>         at org.apache.xml.resolver.Catalog.parseCatalogFile(Unknown Source)
> 
> 
> The "pcf:" debugging message above convinces me that I've got a file: URI
> in a URL object and I called 
> 
>   inStream = new DataInputStream(base.openStream());
> 
> and it failed with
> 
> java.net.UnknownHostException: C
> 
> which seems completely bogus to me.
> 
> Any Windows users out there have a clue?
> 
>                                         Be seeing you,
>                                           norm
> 
> -- 
> Norman.Walsh@Sun.COM / XML Standards Architect / Sun Microsystems, Inc.
> NOTICE: This email message is for the sole use of the intended
> recipient(s) and may contain confidential and privileged information.
> Any unauthorized review, use, disclosure or distribution is prohibited.
> If you are not the intended recipient, please contact the sender by
> reply email and destroy all copies of the original message.