You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Juan Medín Piñeiro <ju...@gmail.com> on 2005/11/29 13:58:57 UTC

Can't parse configuration file

I was trying to run a faces application without being connected to
Internet. I get the following message:

[JavaServer Faces] 13:47:56  WARN ConfigureListener : 239 - Can't
parse configuration
file:jar:file:/C:/Projects/nsi/WebContent/WEB-INF/lib/tomahawk.jar!/META-INF/faces-config.xml
java.net.UnknownHostException: java.sun.com
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
	at java.net.Socket.connect(Socket.java:507)
	at java.net.Socket.connect(Socket.java:457)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:157)


Even when I explicitly disable the xml validation:

    <context-param>
        <param-name>com.sun.faces.validateXml</param-name>
        <param-value>false</param-value>
    </context-param>

Any comment would be really welcome. I don't know why it is trying to
validate that xml.

Regards,

- Juan

Re: Can't parse configuration file

Posted by Mike Kienenberger <mk...@gmail.com>.
For me, putting it in the WEB-INF directory has always worked for web apps.
The one time I had to write an EntityResolver was when I was parsing
dtd files in a batch job instead of a web app.

On 12/5/05, Juan Medín Piñeiro <ju...@gmail.com> wrote:
> Unfortunately putting the file in the WEB-INF dir doesn't work for me
> (other people have the same problem:
> http://forum.java.sun.com/thread.jspa?threadID=676326).
>
> Isn't writing your own EntityResolver a bit too much for this problem?
>
> Regards,
>
> - Juan
>
> On 11/29/05, Mike Kienenberger <mk...@gmail.com> wrote:
> > What works for me is to add the dtd files to the WEB-INF directory,
> > and the xml parser searches there before trying the URL.
> > I think the solution to this problem depends on your xml parser, though.
> > I've also seen others suggest writing your own EntityResolver.
>

Re: Can't parse configuration file

Posted by Juan Medín Piñeiro <ju...@gmail.com>.
Unfortunately putting the file in the WEB-INF dir doesn't work for me
(other people have the same problem:
http://forum.java.sun.com/thread.jspa?threadID=676326).

Isn't writing your own EntityResolver a bit too much for this problem?

Regards,

- Juan

On 11/29/05, Mike Kienenberger <mk...@gmail.com> wrote:
> What works for me is to add the dtd files to the WEB-INF directory,
> and the xml parser searches there before trying the URL.
> I think the solution to this problem depends on your xml parser, though.
> I've also seen others suggest writing your own EntityResolver.

Re: Can't parse configuration file

Posted by Mike Kienenberger <mk...@gmail.com>.
What works for me is to add the dtd files to the WEB-INF directory,
and the xml parser searches there before trying the URL.
I think the solution to this problem depends on your xml parser, though.
I've also seen others suggest writing your own EntityResolver.

On 11/29/05, Juan Medín Piñeiro <ju...@gmail.com> wrote:
> Wayne, thank you for your help.
>
> The problem is that it isn't my faces-config, it's the tomahawk.jar
> one. I could change its xml and zip again the file, but that'd be a
> hack.
>
> I wonder if isn't there any way to disable the DTD check or, at least,
> add it to a xml DTD catalog to redirect it to local DTD.
>
> Regards,
>
> - Juan
>
> On 11/29/05, Wayne Fay <wa...@gmail.com> wrote:
> > Look at your faces-config.xml
> >
> > <?xml version="1.0" encoding="ISO-8859-1" ?>
> > <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD
> > JavaServer Faces Config 1.1//EN"
> > "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
> >
> > Since it specifies a remote DTD, your server will always attempt to
> > download this DTD when it loads the config file.
> >
> > You can change this line to a local file path instead ie:
> > <?xml version="1.0" encoding="ISO-8859-1" ?>
> > <!DOCTYPE faces-config SYSTEM "/path/to/dtd/web-facesconfig_1_1.dtd">
> >
> > And then download and copy this file to the specified place in your file system.
> >
> > Wayne
> >
> >
> > On 11/29/05, Juan Medín Piñeiro <ju...@gmail.com> wrote:
> > > I was trying to run a faces application without being connected to
> > > Internet. I get the following message:
> > >
> > > [JavaServer Faces] 13:47:56  WARN ConfigureListener : 239 - Can't
> > > parse configuration
> > > file:jar:file:/C:/Projects/nsi/WebContent/WEB-INF/lib/tomahawk.jar!/META-INF/faces-config.xml
> > > java.net.UnknownHostException: java.sun.com
> > >        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
> > >        at java.net.Socket.connect(Socket.java:507)
> > >        at java.net.Socket.connect(Socket.java:457)
> > >        at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
> > >
> > >
> > > Even when I explicitly disable the xml validation:
> > >
> > >    <context-param>
> > >        <param-name>com.sun.faces.validateXml</param-name>
> > >        <param-value>false</param-value>
> > >    </context-param>
> > >
> > > Any comment would be really welcome. I don't know why it is trying to
> > > validate that xml.
> > >
> > > Regards,
> > >
> > > - Juan
> > >
> >
>

Re: Can't parse configuration file

Posted by Juan Medín Piñeiro <ju...@gmail.com>.
Wayne, thank you for your help.

The problem is that it isn't my faces-config, it's the tomahawk.jar
one. I could change its xml and zip again the file, but that'd be a
hack.

I wonder if isn't there any way to disable the DTD check or, at least,
add it to a xml DTD catalog to redirect it to local DTD.

Regards,

- Juan

On 11/29/05, Wayne Fay <wa...@gmail.com> wrote:
> Look at your faces-config.xml
>
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD
> JavaServer Faces Config 1.1//EN"
> "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
>
> Since it specifies a remote DTD, your server will always attempt to
> download this DTD when it loads the config file.
>
> You can change this line to a local file path instead ie:
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <!DOCTYPE faces-config SYSTEM "/path/to/dtd/web-facesconfig_1_1.dtd">
>
> And then download and copy this file to the specified place in your file system.
>
> Wayne
>
>
> On 11/29/05, Juan Medín Piñeiro <ju...@gmail.com> wrote:
> > I was trying to run a faces application without being connected to
> > Internet. I get the following message:
> >
> > [JavaServer Faces] 13:47:56  WARN ConfigureListener : 239 - Can't
> > parse configuration
> > file:jar:file:/C:/Projects/nsi/WebContent/WEB-INF/lib/tomahawk.jar!/META-INF/faces-config.xml
> > java.net.UnknownHostException: java.sun.com
> >        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
> >        at java.net.Socket.connect(Socket.java:507)
> >        at java.net.Socket.connect(Socket.java:457)
> >        at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
> >
> >
> > Even when I explicitly disable the xml validation:
> >
> >    <context-param>
> >        <param-name>com.sun.faces.validateXml</param-name>
> >        <param-value>false</param-value>
> >    </context-param>
> >
> > Any comment would be really welcome. I don't know why it is trying to
> > validate that xml.
> >
> > Regards,
> >
> > - Juan
> >
>

Re: Can't parse configuration file

Posted by Wayne Fay <wa...@gmail.com>.
Look at your faces-config.xml

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD
JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

Since it specifies a remote DTD, your server will always attempt to
download this DTD when it loads the config file.

You can change this line to a local file path instead ie:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE faces-config SYSTEM "/path/to/dtd/web-facesconfig_1_1.dtd">

And then download and copy this file to the specified place in your file system.

Wayne


On 11/29/05, Juan Medín Piñeiro <ju...@gmail.com> wrote:
> I was trying to run a faces application without being connected to
> Internet. I get the following message:
>
> [JavaServer Faces] 13:47:56  WARN ConfigureListener : 239 - Can't
> parse configuration
> file:jar:file:/C:/Projects/nsi/WebContent/WEB-INF/lib/tomahawk.jar!/META-INF/faces-config.xml
> java.net.UnknownHostException: java.sun.com
>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
>        at java.net.Socket.connect(Socket.java:507)
>        at java.net.Socket.connect(Socket.java:457)
>        at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
>
>
> Even when I explicitly disable the xml validation:
>
>    <context-param>
>        <param-name>com.sun.faces.validateXml</param-name>
>        <param-value>false</param-value>
>    </context-param>
>
> Any comment would be really welcome. I don't know why it is trying to
> validate that xml.
>
> Regards,
>
> - Juan
>