You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Xavier Lawrence <xa...@epfl.ch> on 2004/10/06 10:40:46 UTC

SAXParseException and maven

Well, I continued getting these 'org.xml.sax.SAXParseException: Content is not
allowed in prolog' this morning :(

However, I might have spotted something:
I took the struts-demo application which is working fine. The war file for this 
application was created by using 'maven quickstart' and is the one deployed 
into JetSpeed. 
I then went into the root directory of the struts-demo application and deleted 
the target directory. I then typed 'maven war' and replaced the original file 
deployed into jetspeed by this one (after correctly undeploying it). Guess 
what ?  

I started getting 'org.xml.sax.SAXParseException: Content is not
allowed in prolog' when Jetspeed tried to re-deploy it. I looked at the 2 war 
files and they were not of the same size (difference of 2.79 MB and 2.80 MB).

So my question is: Would all the problem be actually linked to an incorrect 
encoding or creation of the war files by maven ?  All the exceptions I was 
getting were due to portlet.xml files created with the simple 'maven war' 
command...

Xavier



----- Message retransmis par Xavier Lawrence <xa...@epfl.ch> -----
Date: Tue, 05 Oct 2004 14:57:14 +0200 (MEST)
From: Xavier Lawrence <xa...@epfl.ch>
Reply-To: Struts Developers List <de...@struts.apache.org>
Subject: SAXParseException
To: dev@struts.apache.org

Hi,

I am getting these stange org.xml.sax.SAXParseException: Content is not
allowed in prolog and I don't understand why...

Anybody would have a clue where I shoul start looking ? (I see nothing wrong in

my config XML files...)

I am trying to make a simple struts-portlet work...

Thanks in advance

Xavier


INFO: Loading portlet application from web archive C:\Tomcat5\webapps\jetspeed\
WEB-INF\deploy\FirstStrutsPortlet-demo.war
 INFO: Preparing to (re) deploy portlet app "FirstStrutsPortlet-demo"
 INFO: Deploying portlet applicaion WAR FirstStrutsPortlet-demo.war
 INFO: Portlet application deployment target directory is
C:\Tomcat5\webapps\jet
speed/..//FirstStrutsPortlet-demo
Writing out infused web.xml for FirstStrutsPortlet-demo
org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.commons.digester.Digester.parse(Digester.java:1586)
        at
org.apache.jetspeed.util.descriptor.PortletApplicationDescriptor.crea
tePortletApplication(PortletApplicationDescriptor.java:148)
        at
org.apache.jetspeed.util.descriptor.PortletApplicationWar.createPortl
etApp(PortletApplicationWar.java:208)
        at
org.apache.jetspeed.tools.pamanager.FileSystemPAM.registerApplication
(FileSystemPAM.java:355)
        at
org.apache.jetspeed.tools.pamanager.FileSystemPAM.sysDeploy(FileSyste
mPAM.java:304)
        at
org.apache.jetspeed.tools.pamanager.FileSystemPAM.deploy(FileSystemPA
M.java:120)
        at
org.apache.jetspeed.tools.pamanager.ApplicationServerPAM.deploy(Appli
cationServerPAM.java:81)
        at
org.apache.jetspeed.deployment.impl.DeployPortletAppEventListener.doD
eploy(DeployPortletAppEventListener.java:262)
        at
org.apache.jetspeed.deployment.impl.DeployPortletAppEventListener.inv
okeDeploy(DeployPortletAppEventListener.java:165)
        at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager.dispatc
h(StandardDeploymentManager.java:305)
        at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager.fireDep
loymentEvent(StandardDeploymentManager.java:196)
        at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager$FileSys
temScanner.run(StandardDeploymentManager.java:459)
ERROR: Unable to register portlet application, FirstStrutsPortlet-demo, through
the portlet registry:
org.apache.jetspeed.tools.pamanager.PortletApplicationExce
ption: Could not unmarshal portlet.xml. org.xml.sax.SAXParseException: Content
i
s not allowed in prolog.
org.apache.jetspeed.tools.pamanager.PortletApplicationException: Could not
unmar
shal portlet.xml. org.xml.sax.SAXParseException: Content is not allowed in
prolo
g.
        at
org.apache.jetspeed.util.descriptor.PortletApplicationDescriptor.crea
tePortletApplication(PortletApplicationDescriptor.java:178)
        at
org.apache.jetspeed.util.descriptor.PortletApplicationWar.createPortl
etApp(PortletApplicationWar.java:208)
        at
org.apache.jetspeed.tools.pamanager.FileSystemPAM.registerApplication
(FileSystemPAM.java:355)
        at
org.apache.jetspeed.tools.pamanager.FileSystemPAM.sysDeploy(FileSyste
mPAM.java:304)
        at
org.apache.jetspeed.tools.pamanager.FileSystemPAM.deploy(FileSystemPA
M.java:120)
        at
org.apache.jetspeed.tools.pamanager.ApplicationServerPAM.deploy(Appli
cationServerPAM.java:81)
        at
org.apache.jetspeed.deployment.impl.DeployPortletAppEventListener.doD
eploy(DeployPortletAppEventListener.java:262)
        at
org.apache.jetspeed.deployment.impl.DeployPortletAppEventListener.inv
okeDeploy(DeployPortletAppEventListener.java:165)
        at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager.dispatc
h(StandardDeploymentManager.java:305)
        at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager.fireDep
loymentEvent(StandardDeploymentManager.java:196)
        at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager$FileSys
temScanner.run(StandardDeploymentManager.java:459)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.commons.digester.Digester.parse(Digester.java:1586)
        at
org.apache.jetspeed.util.descriptor.PortletApplicationDescriptor.crea
tePortletApplication(PortletApplicationDescriptor.java:148)
        ... 10 more
ERROR: Unexpected exception deploying portlet application:
org.apache.jetspeed.e
xception.RegistryException: Unable to register portlet application,
FirstStrutsP
ortlet-demo, through the portlet registry:
org.apache.jetspeed.tools.pamanager.P
ortletApplicationException: Could not unmarshal portlet.xml.
org.xml.sax.SAXPars
eException: Content is not allowed in prolog. attempting rollback...
org.apache.jetspeed.exception.RegistryException: Unable to register portlet
appl
ication, FirstStrutsPortlet-demo, through the portlet registry:
org.apache.jetsp
eed.tools.pamanager.PortletApplicationException: Could not unmarshal
portlet.xml
. org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at
org.apache.jetspeed.tools.pamanager.FileSystemPAM.registerApplication
(FileSystemPAM.java:394)
        at
org.apache.jetspeed.tools.pamanager.FileSystemPAM.sysDeploy(FileSyste
mPAM.java:304)
        at
org.apache.jetspeed.tools.pamanager.FileSystemPAM.deploy(FileSystemPA
M.java:120)
        at
org.apache.jetspeed.tools.pamanager.ApplicationServerPAM.deploy(Appli
cationServerPAM.java:81)
        at
org.apache.jetspeed.deployment.impl.DeployPortletAppEventListener.doD
eploy(DeployPortletAppEventListener.java:262)
        at
org.apache.jetspeed.deployment.impl.DeployPortletAppEventListener.inv
okeDeploy(DeployPortletAppEventListener.java:165)
        at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager.dispatc
h(StandardDeploymentManager.java:305)
        at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager.fireDep
loymentEvent(StandardDeploymentManager.java:196)
        at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager$FileSys
temScanner.run(StandardDeploymentManager.java:459)
Caused by: org.apache.jetspeed.tools.pamanager.PortletApplicationException:
Coul
d not unmarshal portlet.xml. org.xml.sax.SAXParseException: Content is not
allow
ed in prolog.
        at
org.apache.jetspeed.util.descriptor.PortletApplicationDescriptor.crea
tePortletApplication(PortletApplicationDescriptor.java:178)
        at
org.apache.jetspeed.util.descriptor.PortletApplicationWar.createPortl
etApp(PortletApplicationWar.java:208)
        at
org.apache.jetspeed.tools.pamanager.FileSystemPAM.registerApplication
(FileSystemPAM.java:355)
        ... 8 more
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.commons.digester.Digester.parse(Digester.java:1586)
        at
org.apache.jetspeed.util.descriptor.PortletApplicationDescriptor.crea
tePortletApplication(PortletApplicationDescriptor.java:148)
        ... 10 more
 INFO: Exception in deploy. Rollback of application deployment...
 INFO: Rollback: Remove C:\Tomcat5\webapps\jetspeed/..//FirstStrutsPortlet-demo
and all sub-directories.
ERROR: org.apache.jetspeed.deployment.DeploymentException: Error (re)deploying
p
ortlet app: org.apache.jetspeed.tools.pamanager.PortletApplicationException:
org
.apache.jetspeed.exception.RegistryException: Unable to register portlet
applica
tion, FirstStrutsPortlet-demo, through the portlet registry:
org.apache.jetspeed
.tools.pamanager.PortletApplicationException: Could not unmarshal portlet.xml.
o
rg.xml.sax.SAXParseException: Content is not allowed in prolog.
org.apache.jetspeed.deployment.DeploymentException: Error (re)deploying portlet
app: org.apache.jetspeed.tools.pamanager.PortletApplicationException:
org.apache
.jetspeed.exception.RegistryException: Unable to register portlet application,
F
irstStrutsPortlet-demo, through the portlet registry:
org.apache.jetspeed.tools.
pamanager.PortletApplicationException: Could not unmarshal portlet.xml.
org.xml.
sax.SAXParseException: Content is not allowed in prolog.
        at
org.apache.jetspeed.deployment.impl.DeployPortletAppEventListener.doD
eploy(DeployPortletAppEventListener.java:302)
        at
org.apache.jetspeed.deployment.impl.DeployPortletAppEventListener.inv
okeDeploy(DeployPortletAppEventListener.java:165)
        at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager.dispatc
h(StandardDeploymentManager.java:305)
        at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager.fireDep
loymentEvent(StandardDeploymentManager.java:196)
        at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager$FileSys
temScanner.run(StandardDeploymentManager.java:459)
Caused by: org.apache.jetspeed.tools.pamanager.PortletApplicationException:
org.
apache.jetspeed.exception.RegistryException: Unable to register portlet
applicat
ion, FirstStrutsPortlet-demo, through the portlet registry:
org.apache.jetspeed.
tools.pamanager.PortletApplicationException: Could not unmarshal portlet.xml.
or
g.xml.sax.SAXParseException: Content is not allowed in prolog.
        at
org.apache.jetspeed.tools.pamanager.FileSystemPAM.sysDeploy(FileSyste
mPAM.java:327)
        at
org.apache.jetspeed.tools.pamanager.FileSystemPAM.deploy(FileSystemPA
M.java:120)
        at
org.apache.jetspeed.tools.pamanager.ApplicationServerPAM.deploy(Appli
cationServerPAM.java:81)
        at
org.apache.jetspeed.deployment.impl.DeployPortletAppEventListener.doD
eploy(DeployPortletAppEventListener.java:262)
        ... 4 more
Caused by: org.apache.jetspeed.exception.RegistryException: Unable to register
p
ortlet application, FirstStrutsPortlet-demo, through the portlet registry:
org.a
pache.jetspeed.tools.pamanager.PortletApplicationException: Could not unmarshal
portlet.xml. org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at
org.apache.jetspeed.tools.pamanager.FileSystemPAM.registerApplication
(FileSystemPAM.java:394)
        at
org.apache.jetspeed.tools.pamanager.FileSystemPAM.sysDeploy(FileSyste
mPAM.java:304)
        ... 7 more
Caused by: org.apache.jetspeed.tools.pamanager.PortletApplicationException:
Coul
d not unmarshal portlet.xml. org.xml.sax.SAXParseException: Content is not
allow
ed in prolog.
        at
org.apache.jetspeed.util.descriptor.PortletApplicationDescriptor.crea
tePortletApplication(PortletApplicationDescriptor.java:178)
        at
org.apache.jetspeed.util.descriptor.PortletApplicationWar.createPortl
etApp(PortletApplicationWar.java:208)
        at
org.apache.jetspeed.tools.pamanager.FileSystemPAM.registerApplication
(FileSystemPAM.java:355)
        ... 8 more
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.commons.digester.Digester.parse(Digester.java:1586)
        at
org.apache.jetspeed.util.descriptor.PortletApplicationDescriptor.crea
tePortletApplication(PortletApplicationDescriptor.java:148)
        ... 10 more
ERROR: Error deploying
C:\Tomcat5\webapps\jetspeed\WEB-INF\deploy\FirstStrutsPor
tlet-demo.war


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


----- Fin de message retransmis -----


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Re: SAXParseException and maven

Posted by Xavier Lawrence <xa...@epfl.ch>.
Ok, so I solved my problem.

The problem was actually Ultra-Edit adding BOM headers to all UTF-8 files 
automatically. This was nasty as this configuration is the default one...
The header was 2 characters placed before <?xml...?>


En réponse à Jaq Marit <ic...@slu.edu.ph>:

> I had a similar experience.  Being a sax exception, there must be
> something
> wrong with one of the xml files (mostly config files).  My observation
> is that
> jetspeed tries to process and possibly write to config files causing the
> xml
> files to be modified.  At some point, my apps server did crash or did
> not exit
> gracefully and I encountered 'Content is not allowed in prolog' errors. 
> So I
> had to look at the xml files, and I saw an empty xml (config) file. 
> Your
> problem may not be similar to mine but you could consider checking each
> xml
> file again.
> 
> Quoting Xavier Lawrence <xa...@epfl.ch>:
> 
> > Well, I continued getting these 'org.xml.sax.SAXParseException:
> Content is
> > not
> > allowed in prolog' this morning :(
> > 
> > However, I might have spotted something:
> > I took the struts-demo application which is working fine. The war file
> for
> > this 
> > application was created by using 'maven quickstart' and is the one
> deployed 
> > into JetSpeed. 
> > I then went into the root directory of the struts-demo application
> and
> > deleted 
> > the target directory. I then typed 'maven war' and replaced the
> original file
> > 
> > deployed into jetspeed by this one (after correctly undeploying it).
> Guess 
> > what ?  
> 
> 
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Re: SAXParseException and maven

Posted by Jaq Marit <ic...@slu.edu.ph>.
I had a similar experience.  Being a sax exception, there must be something
wrong with one of the xml files (mostly config files).  My observation is that
jetspeed tries to process and possibly write to config files causing the xml
files to be modified.  At some point, my apps server did crash or did not exit
gracefully and I encountered 'Content is not allowed in prolog' errors.  So I
had to look at the xml files, and I saw an empty xml (config) file.  Your
problem may not be similar to mine but you could consider checking each xml
file again.

Quoting Xavier Lawrence <xa...@epfl.ch>:

> Well, I continued getting these 'org.xml.sax.SAXParseException: Content is
> not
> allowed in prolog' this morning :(
> 
> However, I might have spotted something:
> I took the struts-demo application which is working fine. The war file for
> this 
> application was created by using 'maven quickstart' and is the one deployed 
> into JetSpeed. 
> I then went into the root directory of the struts-demo application and
> deleted 
> the target directory. I then typed 'maven war' and replaced the original file
> 
> deployed into jetspeed by this one (after correctly undeploying it). Guess 
> what ?  


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org