You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Roger Varley <ro...@googlemail.com> on 2007/05/23 15:07:54 UTC

[S2] Inappropriate Error Message

I'm developing using Struts 2 with the Spring plugin within Netbeans
5.5 using the embedded Tomcat as the servlet engine. If I screw up my
Spring applicationContext.xml by incorrectly specifying the path to
the class in a bean element, then when I try to deploy the project I
get the error message in the Tomcat start up logs.

SEVERE: Parse Fatal Error at line 1 column 1: Content is not allowed in prolog.
org.xml.sax.SAXParseException: Content is not allowed in prolog.

rather than a more helpful "can't find class foo.bar.baz.class" It's
not too big a problem at the moment as I only have half a dozen beans
defined, but for larger projects a more helpful error message would be
nice. Is this actually a Struts 2 issue, a Spring issue or a product
of my development environment?

Regards
Roger

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


Re: [S2] Inappropriate Error Message

Posted by Martin Gainty <mg...@hotmail.com>.
I would suggest taking a Look at the XML and make sure there are no null's 
cr's lf's tabs or other whitespace characters in the Input XML before
<?xml version="1.0" encoding="ISO-8859-1"? version="1.0">

The encoding attribute is specific to the version of browser
http://www.w3schools.com/xml/xml_encoding.asp

whereas version can either be "1.1" or "1.0"
http://www.w3.org/TR/2004/REC-xml11-20040204/#sec-version-info
be mindful that version="1.1" doc may invoke 1.0 external entities
but the reverse is not true..at least from I see in the doc available

HTH/
M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Roger Varley" <ro...@googlemail.com>
To: <us...@struts.apache.org>
Sent: Wednesday, May 23, 2007 9:07 AM
Subject: [S2] Inappropriate Error Message


> I'm developing using Struts 2 with the Spring plugin within Netbeans
> 5.5 using the embedded Tomcat as the servlet engine. If I screw up my
> Spring applicationContext.xml by incorrectly specifying the path to
> the class in a bean element, then when I try to deploy the project I
> get the error message in the Tomcat start up logs.
>
> SEVERE: Parse Fatal Error at line 1 column 1: Content is not allowed in 
> prolog.
> org.xml.sax.SAXParseException: Content is not allowed in prolog.
>
> rather than a more helpful "can't find class foo.bar.baz.class" It's
> not too big a problem at the moment as I only have half a dozen beans
> defined, but for larger projects a more helpful error message would be
> nice. Is this actually a Struts 2 issue, a Spring issue or a product
> of my development environment?
>
> Regards
> Roger
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> 


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


Re: [S2] Inappropriate Error Message

Posted by Roger Varley <ro...@googlemail.com>.
>
> Usually this means that there is something other than the BOM before
> your <?xml processing instruction. Are you sure you don't have anything
> before the beginning of your XML, or is this easily repeatable by simply
> using a bogus class name?
>

This is repeatable by using a bogus class name, so that suggests that
Struts/Spring is the root cause.

Regards
Roger

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


Re: [S2] Inappropriate Error Message

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Roger,

Roger Varley wrote:
> SEVERE: Parse Fatal Error at line 1 column 1: Content is not allowed in
> prolog.
> org.xml.sax.SAXParseException: Content is not allowed in prolog.

Usually this means that there is something other than the BOM before
your <?xml processing instruction. Are you sure you don't have anything
before the beginning of your XML, or is this easily repeatable by simply
using a bogus class name?

Since this is a SAXException, I'm inclined to agree with Musachy that
this is likely to be an XML problem /before/ Struts gets involved
(loading classes, etc.).

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGVERY9CaO5/Lv0PARAoxKAJ9Hdkn7HCjN8BRn4zzxljCDBtvWugCaA2Gx
hPZY0KkDzNHbxRNP31HW3QY=
=UdmJ
-----END PGP SIGNATURE-----

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


Re: [S2] Inappropriate Error Message

Posted by Musachy Barroso <mu...@gmail.com>.
That's a generic SAX exception, and I think in this case is coming from
Spring, right?

musachy

On 5/23/07, Roger Varley <ro...@googlemail.com> wrote:
>
> I'm developing using Struts 2 with the Spring plugin within Netbeans
> 5.5 using the embedded Tomcat as the servlet engine. If I screw up my
> Spring applicationContext.xml by incorrectly specifying the path to
> the class in a bean element, then when I try to deploy the project I
> get the error message in the Tomcat start up logs.
>
> SEVERE: Parse Fatal Error at line 1 column 1: Content is not allowed in
> prolog.
> org.xml.sax.SAXParseException: Content is not allowed in prolog.
>
> rather than a more helpful "can't find class foo.bar.baz.class" It's
> not too big a problem at the moment as I only have half a dozen beans
> defined, but for larger projects a more helpful error message would be
> nice. Is this actually a Struts 2 issue, a Spring issue or a product
> of my development environment?
>
> Regards
> Roger
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd