You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Thomas Manson <de...@gmail.com> on 2009/11/10 16:38:07 UTC

random SAXParseException : The declaration for the entity "ContentType" must end with '>'.

Hi,

  I've build a framework, and then, I expose it's method via webservice
using CXF (2.2.2).

  On this project, i've one error that happen quite randomly on project
start, which complains about a missing > on entity ContentType on line 81,
when parsing our spring applicationContext.xml.

  The problem is that our applicationContext.xml has only 48 lines...
without the CXF part, I never have the problem.

  If I restart the project right after, it start correctly. If I wait some
time, I get it again....

  Does it ring a bell to anyone ?

Thomas.


2009-11-10 16:08:20,869 DEBUG
fr.rs2i.swFramework.ws.jms.bw.SpringInitializator : BeanFactory init with
applicationContextFile : '/conf/applicationContext-rs2i.xml'
2009-11-10 16:08:20,963 INFO
org.springframework.context.support.ClassPathXmlApplicationContext :
Refreshing
org.springframework.context.support.ClassPathXmlApplicationContext@12b6651:
display name
[org.springframework.context.support.ClassPathXmlApplicationContext@12b6651];
startup date [Tue Nov 10 16:08:20 CET 2009]; root of context hierarchy
2009-11-10 16:08:21,041 INFO
org.springframework.beans.factory.xml.XmlBeanDefinitionReader : Loading XML
bean definitions from class path resource
[/conf/applicationContext-rs2i.xml]
Exception in thread "main"
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
81 in XML document from class path resource
[/conf/applicationContext-rs2i.xml] *is invalid; nested exception is
org.xml.sax.SAXParseException: The declaration for the entity "ContentType"
must end with '>'.*
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:109)
at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:197)
at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:172)
at
fr.rs2i.swFramework.ws.jms.bw.SpringInitializator.<init>(SpringInitializator.java:48)
at
fr.rs2i.swFramework.ws.jms.bw.SpringInitializator.main(SpringInitializator.java:65)
*Caused by: org.xml.sax.SAXParseException: The declaration for the entity
"ContentType" must end with '>'.*
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanEntityDecl(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDExternalSubset(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchema(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.resolveSchema(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown
Source)
at
org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
... 12 more

Re: random SAXParseException : The declaration for the entity "ContentType" must end with '>'.

Posted by Thomas Manson <de...@gmail.com>.
Still the same error... :(

On Thu, Nov 12, 2009 at 11:18, Thomas Manson <de...@gmail.com>wrote:

> Thanks Daniel,
>
> I'll try that.
>
> Thomas.
>
>
> On Tue, Nov 10, 2009 at 20:10, Daniel Kulp <dk...@apache.org> wrote:
>
>>
>> That may be the issue, it should be:
>>
>> http://cxf.apache.org/schemas/configuration/soap.xsd
>>
>>
>> Dan
>>
>>
>> On Tue November 10 2009 1:09:48 pm Thomas Manson wrote:
>> > Hi Daniel,
>> >
>> >   When we deploy our application on the server, the server is
>> disconnected
>> > from internet, so we already use the spring.schemas with the following
>> xsd
>> >
>> >
>> > http\://
>> schemas.xmlsoap.org/wsdl/2003-02-11.xsd=META-INF/xsd/2003-02-11.xsd
>> >
>> > and this file do not contains ContentType string.
>> >
>> > And the project currently start correctly without internet.
>> >
>> > I've checked each XSD declared in my applicationContext.xml and
>> ContentType
>> > do not appears in these XSD.
>> >
>> > But I've this declaration
>> >
>> > "http://cxf.apache.org/bindings/soap
>> > http://cxf.apache.org/schema/bindings/soap.xsd"
>> > where
>> >  http://cxf.apache.org/schema/bindings/soap.xsd
>> >
>> > ends with a 404 error.
>> >
>> > Thomas.
>> >
>> > On Tue, Nov 10, 2009 at 18:43, Daniel Kulp <dk...@apache.org> wrote:
>> > > If you look at the stack trace, it's occurring while trying to load
>> some
>> > > schemas.  My suggestion would be to run wireshark or similar to
>> capture
>> > > all the traffic going in/out of your computer during startup.   My
>> "gut
>> > > feeling"
>> > > is that it's trying to hit the internet for a schema of some sort and
>> > > that server is returning an invalid xml doc or some error page or
>> > > something like that occasional.  (maybe overloaded?)      If you can
>> > > figure out what it's grabbing, you can copy it locally into your app
>> and
>> > > add a META-
>> > > INF/spring.schemas file to remap it to the local version.
>> > >
>> > > Dan
>> > >
>> > > On Tue November 10 2009 10:38:07 am Thomas Manson wrote:
>> > > > Hi,
>> > > >
>> > > >   I've build a framework, and then, I expose it's method via
>> webservice
>> > > > using CXF (2.2.2).
>> > > >
>> > > >   On this project, i've one error that happen quite randomly on
>> project
>> > > > start, which complains about a missing > on entity ContentType on
>> line
>> > >
>> > > 81,
>> > >
>> > > > when parsing our spring applicationContext.xml.
>> > > >
>> > > >   The problem is that our applicationContext.xml has only 48
>> lines...
>> > > > without the CXF part, I never have the problem.
>> > > >
>> > > >   If I restart the project right after, it start correctly. If I
>> wait
>> > >
>> > > some
>> > >
>> > > > time, I get it again....
>> > > >
>> > > >   Does it ring a bell to anyone ?
>> > > >
>> > > > Thomas.
>> > > >
>> > > >
>> > > > 2009-11-10 16:08:20,869 DEBUG
>> > > > fr.rs2i.swFramework.ws.jms.bw.SpringInitializator : BeanFactory init
>> > > > with applicationContextFile : '/conf/applicationContext-rs2i.xml'
>> > > > 2009-11-10 16:08:20,963 INFO
>> > > > org.springframework.context.support.ClassPathXmlApplicationContext :
>> > > > Refreshing
>> > >
>> > >
>> org.springframework.context.support.ClassPathXmlApplicationContext@12b665
>> > >1
>> > >
>> > > > display name
>> > >
>> > >
>> [org.springframework.context.support.ClassPathXmlApplicationContext@12b66
>> > >51
>> > >
>> > > > ]; startup date [Tue Nov 10 16:08:20 CET 2009]; root of context
>> > > > hierarchy 2009-11-10 16:08:21,041 INFO
>> > > > org.springframework.beans.factory.xml.XmlBeanDefinitionReader :
>> Loading
>> > >
>> > > XML
>> > >
>> > > > bean definitions from class path resource
>> > > > [/conf/applicationContext-rs2i.xml]
>> > > > Exception in thread "main"
>> > > >
>> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
>> > >
>> > > Line
>> > >
>> > > > 81 in XML document from class path resource
>> > > > [/conf/applicationContext-rs2i.xml] *is invalid; nested exception is
>> > > > org.xml.sax.SAXParseException: The declaration for the entity
>> > >
>> > > "ContentType"
>> > >
>> > > > must end with '>'.*
>> > > > at
>> > >
>> > >
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanD
>> > >ef
>> > >
>> > > > initions(XmlBeanDefinitionReader.java:404) at
>> > >
>> > >
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDef
>> > >in
>> > >
>> > > > itions(XmlBeanDefinitionReader.java:342) at
>> > >
>> > >
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDef
>> > >in
>> > >
>> > > > itions(XmlBeanDefinitionReader.java:310) at
>> > >
>> > >
>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.lo
>> > >ad
>> > >
>> > > > BeanDefinitions(AbstractBeanDefinitionReader.java:143) at
>> > >
>> > >
>> org.springframework.context.support.AbstractXmlApplicationContext.loadBea
>> > >nD
>> > >
>> > > > efinitions(AbstractXmlApplicationContext.java:109) at
>> > >
>> > >
>> org.springframework.context.support.AbstractXmlApplicationContext.loadBea
>> > >nD
>> > >
>> > > > efinitions(AbstractXmlApplicationContext.java:80) at
>> > >
>> > >
>> org.springframework.context.support.AbstractRefreshableApplicationContext
>> > >.r
>> > >
>> > > > efreshBeanFactory(AbstractRefreshableApplicationContext.java:123) at
>> > >
>> > >
>> org.springframework.context.support.AbstractApplicationContext.obtainFres
>> > >hB
>> > >
>> > > > eanFactory(AbstractApplicationContext.java:422) at
>> > >
>> > >
>> org.springframework.context.support.AbstractApplicationContext.refresh(Ab
>> > >st
>> > >
>> > > > ractApplicationContext.java:352) at
>> > >
>> > >
>> org.springframework.context.support.ClassPathXmlApplicationContext.<init>
>> > >(C
>> > >
>> > > > lassPathXmlApplicationContext.java:197) at
>> > >
>> > >
>> org.springframework.context.support.ClassPathXmlApplicationContext.<init>
>> > >(C
>> > >
>> > > > lassPathXmlApplicationContext.java:172) at
>> > >
>> > >
>> fr.rs2i.swFramework.ws.jms.bw.SpringInitializator.<init>(SpringInitializa
>> > >to
>> > >
>> > > > r.java:48) at
>> > >
>> > >
>> fr.rs2i.swFramework.ws.jms.bw.SpringInitializator.main(SpringInitializato
>> > >r.
>> > >
>> > > > java:65) *Caused by: org.xml.sax.SAXParseException: The declaration
>> for
>> > >
>> > > the
>> > >
>> > > >  entity "ContentType" must end with '>'.*
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXPars
>> > >eE
>> > >
>> > > > xception(Unknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Un
>> > >kn
>> > >
>> > > > own Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unkn
>> > >ow
>> > >
>> > > > n Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unkn
>> > >ow
>> > >
>> > > > n Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unkno
>> > >wn
>> > >
>> > > > Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanEntityDecl(
>> > >Un
>> > >
>> > > > known Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(Unkno
>> > >wn
>> > >
>> > > > Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDExternal
>> > >Su
>> > >
>> > > > bset(Unknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatc
>> > >he
>> > >
>> > > > r.dispatch(Unknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.sc
>> > >an
>> > >
>> > > > Document(Unknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse
>> > >(U
>> > >
>> > > > nknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse
>> > >(U
>> > >
>> > > > nknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchem
>> > >a(
>> > >
>> > > > Unknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.resolveS
>> > >ch
>> > >
>> > > > ema(Unknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.construc
>> > >tT
>> > >
>> > > > rees(Unknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.construc
>> > >tT
>> > >
>> > > > rees(Unknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSch
>> > >em
>> > >
>> > > > a(Unknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(Unk
>> > >no
>> > >
>> > > > wn Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaG
>> > >ra
>> > >
>> > > > mmar(Unknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStart
>> > >El
>> > >
>> > > > ement(Unknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElemen
>> > >t(
>> > >
>> > > > Unknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStar
>> > >tE
>> > >
>> > > > lement(Unknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$Fr
>> > >ag
>> > >
>> > > > mentContentDispatcher.dispatch(Unknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.sc
>> > >an
>> > >
>> > > > Document(Unknown Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkno
>> > >wn
>> > >
>> > > > Source)
>> > > > at
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkno
>> > >wn
>> > >
>> > > > Source)
>> > > > at
>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
>> > > > Source)
>> > > > at
>> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown
>> > > > Source)
>> > > > at
>> > >
>> > >
>> > >
>> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown
>> > >
>> > > >  Source)
>> > > > at
>> > >
>> > >
>> org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(
>> > >De
>> > >
>> > > > faultDocumentLoader.java:75) at
>> > >
>> > >
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanD
>> > >ef
>> > >
>> > > > initions(XmlBeanDefinitionReader.java:396) ... 12 more
>> > >
>> > > --
>> > > Daniel Kulp
>> > > dkulp@apache.org
>> > > http://www.dankulp.com/blog
>> >
>>
>> --
>> Daniel Kulp
>> dkulp@apache.org
>> http://www.dankulp.com/blog
>>
>
>

Re: random SAXParseException : The declaration for the entity "ContentType" must end with '>'.

Posted by Thomas Manson <de...@gmail.com>.
Thanks Daniel,

I'll try that.

Thomas.

On Tue, Nov 10, 2009 at 20:10, Daniel Kulp <dk...@apache.org> wrote:

>
> That may be the issue, it should be:
>
> http://cxf.apache.org/schemas/configuration/soap.xsd
>
>
> Dan
>
>
> On Tue November 10 2009 1:09:48 pm Thomas Manson wrote:
> > Hi Daniel,
> >
> >   When we deploy our application on the server, the server is
> disconnected
> > from internet, so we already use the spring.schemas with the following
> xsd
> >
> >
> > http\://
> schemas.xmlsoap.org/wsdl/2003-02-11.xsd=META-INF/xsd/2003-02-11.xsd
> >
> > and this file do not contains ContentType string.
> >
> > And the project currently start correctly without internet.
> >
> > I've checked each XSD declared in my applicationContext.xml and
> ContentType
> > do not appears in these XSD.
> >
> > But I've this declaration
> >
> > "http://cxf.apache.org/bindings/soap
> > http://cxf.apache.org/schema/bindings/soap.xsd"
> > where
> >  http://cxf.apache.org/schema/bindings/soap.xsd
> >
> > ends with a 404 error.
> >
> > Thomas.
> >
> > On Tue, Nov 10, 2009 at 18:43, Daniel Kulp <dk...@apache.org> wrote:
> > > If you look at the stack trace, it's occurring while trying to load
> some
> > > schemas.  My suggestion would be to run wireshark or similar to capture
> > > all the traffic going in/out of your computer during startup.   My "gut
> > > feeling"
> > > is that it's trying to hit the internet for a schema of some sort and
> > > that server is returning an invalid xml doc or some error page or
> > > something like that occasional.  (maybe overloaded?)      If you can
> > > figure out what it's grabbing, you can copy it locally into your app
> and
> > > add a META-
> > > INF/spring.schemas file to remap it to the local version.
> > >
> > > Dan
> > >
> > > On Tue November 10 2009 10:38:07 am Thomas Manson wrote:
> > > > Hi,
> > > >
> > > >   I've build a framework, and then, I expose it's method via
> webservice
> > > > using CXF (2.2.2).
> > > >
> > > >   On this project, i've one error that happen quite randomly on
> project
> > > > start, which complains about a missing > on entity ContentType on
> line
> > >
> > > 81,
> > >
> > > > when parsing our spring applicationContext.xml.
> > > >
> > > >   The problem is that our applicationContext.xml has only 48 lines...
> > > > without the CXF part, I never have the problem.
> > > >
> > > >   If I restart the project right after, it start correctly. If I wait
> > >
> > > some
> > >
> > > > time, I get it again....
> > > >
> > > >   Does it ring a bell to anyone ?
> > > >
> > > > Thomas.
> > > >
> > > >
> > > > 2009-11-10 16:08:20,869 DEBUG
> > > > fr.rs2i.swFramework.ws.jms.bw.SpringInitializator : BeanFactory init
> > > > with applicationContextFile : '/conf/applicationContext-rs2i.xml'
> > > > 2009-11-10 16:08:20,963 INFO
> > > > org.springframework.context.support.ClassPathXmlApplicationContext :
> > > > Refreshing
> > >
> > >
> org.springframework.context.support.ClassPathXmlApplicationContext@12b665
> > >1
> > >
> > > > display name
> > >
> > >
> [org.springframework.context.support.ClassPathXmlApplicationContext@12b66
> > >51
> > >
> > > > ]; startup date [Tue Nov 10 16:08:20 CET 2009]; root of context
> > > > hierarchy 2009-11-10 16:08:21,041 INFO
> > > > org.springframework.beans.factory.xml.XmlBeanDefinitionReader :
> Loading
> > >
> > > XML
> > >
> > > > bean definitions from class path resource
> > > > [/conf/applicationContext-rs2i.xml]
> > > > Exception in thread "main"
> > > >
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
> > >
> > > Line
> > >
> > > > 81 in XML document from class path resource
> > > > [/conf/applicationContext-rs2i.xml] *is invalid; nested exception is
> > > > org.xml.sax.SAXParseException: The declaration for the entity
> > >
> > > "ContentType"
> > >
> > > > must end with '>'.*
> > > > at
> > >
> > >
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanD
> > >ef
> > >
> > > > initions(XmlBeanDefinitionReader.java:404) at
> > >
> > >
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDef
> > >in
> > >
> > > > itions(XmlBeanDefinitionReader.java:342) at
> > >
> > >
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDef
> > >in
> > >
> > > > itions(XmlBeanDefinitionReader.java:310) at
> > >
> > >
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.lo
> > >ad
> > >
> > > > BeanDefinitions(AbstractBeanDefinitionReader.java:143) at
> > >
> > >
> org.springframework.context.support.AbstractXmlApplicationContext.loadBea
> > >nD
> > >
> > > > efinitions(AbstractXmlApplicationContext.java:109) at
> > >
> > >
> org.springframework.context.support.AbstractXmlApplicationContext.loadBea
> > >nD
> > >
> > > > efinitions(AbstractXmlApplicationContext.java:80) at
> > >
> > >
> org.springframework.context.support.AbstractRefreshableApplicationContext
> > >.r
> > >
> > > > efreshBeanFactory(AbstractRefreshableApplicationContext.java:123) at
> > >
> > >
> org.springframework.context.support.AbstractApplicationContext.obtainFres
> > >hB
> > >
> > > > eanFactory(AbstractApplicationContext.java:422) at
> > >
> > >
> org.springframework.context.support.AbstractApplicationContext.refresh(Ab
> > >st
> > >
> > > > ractApplicationContext.java:352) at
> > >
> > >
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>
> > >(C
> > >
> > > > lassPathXmlApplicationContext.java:197) at
> > >
> > >
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>
> > >(C
> > >
> > > > lassPathXmlApplicationContext.java:172) at
> > >
> > >
> fr.rs2i.swFramework.ws.jms.bw.SpringInitializator.<init>(SpringInitializa
> > >to
> > >
> > > > r.java:48) at
> > >
> > >
> fr.rs2i.swFramework.ws.jms.bw.SpringInitializator.main(SpringInitializato
> > >r.
> > >
> > > > java:65) *Caused by: org.xml.sax.SAXParseException: The declaration
> for
> > >
> > > the
> > >
> > > >  entity "ContentType" must end with '>'.*
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXPars
> > >eE
> > >
> > > > xception(Unknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Un
> > >kn
> > >
> > > > own Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unkn
> > >ow
> > >
> > > > n Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unkn
> > >ow
> > >
> > > > n Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unkno
> > >wn
> > >
> > > > Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanEntityDecl(
> > >Un
> > >
> > > > known Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(Unkno
> > >wn
> > >
> > > > Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDExternal
> > >Su
> > >
> > > > bset(Unknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatc
> > >he
> > >
> > > > r.dispatch(Unknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.sc
> > >an
> > >
> > > > Document(Unknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse
> > >(U
> > >
> > > > nknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse
> > >(U
> > >
> > > > nknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchem
> > >a(
> > >
> > > > Unknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.resolveS
> > >ch
> > >
> > > > ema(Unknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.construc
> > >tT
> > >
> > > > rees(Unknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.construc
> > >tT
> > >
> > > > rees(Unknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSch
> > >em
> > >
> > > > a(Unknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(Unk
> > >no
> > >
> > > > wn Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaG
> > >ra
> > >
> > > > mmar(Unknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStart
> > >El
> > >
> > > > ement(Unknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElemen
> > >t(
> > >
> > > > Unknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStar
> > >tE
> > >
> > > > lement(Unknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$Fr
> > >ag
> > >
> > > > mentContentDispatcher.dispatch(Unknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.sc
> > >an
> > >
> > > > Document(Unknown Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkno
> > >wn
> > >
> > > > Source)
> > > > at
> > >
> > >
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkno
> > >wn
> > >
> > > > Source)
> > > > at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
> > > > Source)
> > > > at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown
> > > > Source)
> > > > at
> > >
> > >
> > >
> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown
> > >
> > > >  Source)
> > > > at
> > >
> > >
> org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(
> > >De
> > >
> > > > faultDocumentLoader.java:75) at
> > >
> > >
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanD
> > >ef
> > >
> > > > initions(XmlBeanDefinitionReader.java:396) ... 12 more
> > >
> > > --
> > > Daniel Kulp
> > > dkulp@apache.org
> > > http://www.dankulp.com/blog
> >
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>

Re: random SAXParseException : The declaration for the entity "ContentType" must end with '>'.

Posted by Daniel Kulp <dk...@apache.org>.
That may be the issue, it should be:

http://cxf.apache.org/schemas/configuration/soap.xsd


Dan


On Tue November 10 2009 1:09:48 pm Thomas Manson wrote:
> Hi Daniel,
> 
>   When we deploy our application on the server, the server is disconnected
> from internet, so we already use the spring.schemas with the following xsd
> 
> 
> http\://schemas.xmlsoap.org/wsdl/2003-02-11.xsd=META-INF/xsd/2003-02-11.xsd
> 
> and this file do not contains ContentType string.
> 
> And the project currently start correctly without internet.
> 
> I've checked each XSD declared in my applicationContext.xml and ContentType
> do not appears in these XSD.
> 
> But I've this declaration
> 
> "http://cxf.apache.org/bindings/soap
> http://cxf.apache.org/schema/bindings/soap.xsd"
> where
>  http://cxf.apache.org/schema/bindings/soap.xsd
> 
> ends with a 404 error.
> 
> Thomas.
> 
> On Tue, Nov 10, 2009 at 18:43, Daniel Kulp <dk...@apache.org> wrote:
> > If you look at the stack trace, it's occurring while trying to load some
> > schemas.  My suggestion would be to run wireshark or similar to capture
> > all the traffic going in/out of your computer during startup.   My "gut
> > feeling"
> > is that it's trying to hit the internet for a schema of some sort and
> > that server is returning an invalid xml doc or some error page or
> > something like that occasional.  (maybe overloaded?)      If you can
> > figure out what it's grabbing, you can copy it locally into your app and
> > add a META-
> > INF/spring.schemas file to remap it to the local version.
> >
> > Dan
> >
> > On Tue November 10 2009 10:38:07 am Thomas Manson wrote:
> > > Hi,
> > >
> > >   I've build a framework, and then, I expose it's method via webservice
> > > using CXF (2.2.2).
> > >
> > >   On this project, i've one error that happen quite randomly on project
> > > start, which complains about a missing > on entity ContentType on line
> >
> > 81,
> >
> > > when parsing our spring applicationContext.xml.
> > >
> > >   The problem is that our applicationContext.xml has only 48 lines...
> > > without the CXF part, I never have the problem.
> > >
> > >   If I restart the project right after, it start correctly. If I wait
> >
> > some
> >
> > > time, I get it again....
> > >
> > >   Does it ring a bell to anyone ?
> > >
> > > Thomas.
> > >
> > >
> > > 2009-11-10 16:08:20,869 DEBUG
> > > fr.rs2i.swFramework.ws.jms.bw.SpringInitializator : BeanFactory init
> > > with applicationContextFile : '/conf/applicationContext-rs2i.xml'
> > > 2009-11-10 16:08:20,963 INFO
> > > org.springframework.context.support.ClassPathXmlApplicationContext :
> > > Refreshing
> >
> > org.springframework.context.support.ClassPathXmlApplicationContext@12b665
> >1
> >
> > > display name
> >
> > [org.springframework.context.support.ClassPathXmlApplicationContext@12b66
> >51
> >
> > > ]; startup date [Tue Nov 10 16:08:20 CET 2009]; root of context
> > > hierarchy 2009-11-10 16:08:21,041 INFO
> > > org.springframework.beans.factory.xml.XmlBeanDefinitionReader : Loading
> >
> > XML
> >
> > > bean definitions from class path resource
> > > [/conf/applicationContext-rs2i.xml]
> > > Exception in thread "main"
> > > org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
> >
> > Line
> >
> > > 81 in XML document from class path resource
> > > [/conf/applicationContext-rs2i.xml] *is invalid; nested exception is
> > > org.xml.sax.SAXParseException: The declaration for the entity
> >
> > "ContentType"
> >
> > > must end with '>'.*
> > > at
> >
> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanD
> >ef
> >
> > > initions(XmlBeanDefinitionReader.java:404) at
> >
> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDef
> >in
> >
> > > itions(XmlBeanDefinitionReader.java:342) at
> >
> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDef
> >in
> >
> > > itions(XmlBeanDefinitionReader.java:310) at
> >
> > org.springframework.beans.factory.support.AbstractBeanDefinitionReader.lo
> >ad
> >
> > > BeanDefinitions(AbstractBeanDefinitionReader.java:143) at
> >
> > org.springframework.context.support.AbstractXmlApplicationContext.loadBea
> >nD
> >
> > > efinitions(AbstractXmlApplicationContext.java:109) at
> >
> > org.springframework.context.support.AbstractXmlApplicationContext.loadBea
> >nD
> >
> > > efinitions(AbstractXmlApplicationContext.java:80) at
> >
> > org.springframework.context.support.AbstractRefreshableApplicationContext
> >.r
> >
> > > efreshBeanFactory(AbstractRefreshableApplicationContext.java:123) at
> >
> > org.springframework.context.support.AbstractApplicationContext.obtainFres
> >hB
> >
> > > eanFactory(AbstractApplicationContext.java:422) at
> >
> > org.springframework.context.support.AbstractApplicationContext.refresh(Ab
> >st
> >
> > > ractApplicationContext.java:352) at
> >
> > org.springframework.context.support.ClassPathXmlApplicationContext.<init>
> >(C
> >
> > > lassPathXmlApplicationContext.java:197) at
> >
> > org.springframework.context.support.ClassPathXmlApplicationContext.<init>
> >(C
> >
> > > lassPathXmlApplicationContext.java:172) at
> >
> > fr.rs2i.swFramework.ws.jms.bw.SpringInitializator.<init>(SpringInitializa
> >to
> >
> > > r.java:48) at
> >
> > fr.rs2i.swFramework.ws.jms.bw.SpringInitializator.main(SpringInitializato
> >r.
> >
> > > java:65) *Caused by: org.xml.sax.SAXParseException: The declaration for
> >
> > the
> >
> > >  entity "ContentType" must end with '>'.*
> > > at
> >
> > com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXPars
> >eE
> >
> > > xception(Unknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Un
> >kn
> >
> > > own Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unkn
> >ow
> >
> > > n Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unkn
> >ow
> >
> > > n Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unkno
> >wn
> >
> > > Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanEntityDecl(
> >Un
> >
> > > known Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(Unkno
> >wn
> >
> > > Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDExternal
> >Su
> >
> > > bset(Unknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatc
> >he
> >
> > > r.dispatch(Unknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.sc
> >an
> >
> > > Document(Unknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse
> >(U
> >
> > > nknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse
> >(U
> >
> > > nknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchem
> >a(
> >
> > > Unknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.resolveS
> >ch
> >
> > > ema(Unknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.construc
> >tT
> >
> > > rees(Unknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.construc
> >tT
> >
> > > rees(Unknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSch
> >em
> >
> > > a(Unknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(Unk
> >no
> >
> > > wn Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaG
> >ra
> >
> > > mmar(Unknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStart
> >El
> >
> > > ement(Unknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElemen
> >t(
> >
> > > Unknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStar
> >tE
> >
> > > lement(Unknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$Fr
> >ag
> >
> > > mentContentDispatcher.dispatch(Unknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.sc
> >an
> >
> > > Document(Unknown Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkno
> >wn
> >
> > > Source)
> > > at
> >
> > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkno
> >wn
> >
> > > Source)
> > > at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
> > > Source)
> > > at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown
> > > Source)
> > > at
> >
> > 
> > com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown
> >
> > >  Source)
> > > at
> >
> > org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(
> >De
> >
> > > faultDocumentLoader.java:75) at
> >
> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanD
> >ef
> >
> > > initions(XmlBeanDefinitionReader.java:396) ... 12 more
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: random SAXParseException : The declaration for the entity "ContentType" must end with '>'.

Posted by Thomas Manson <de...@gmail.com>.
Hi Daniel,

  When we deploy our application on the server, the server is disconnected
from internet, so we already use the spring.schemas with the following xsd
:

http\://schemas.xmlsoap.org/wsdl/2003-02-11.xsd=META-INF/xsd/2003-02-11.xsd

and this file do not contains ContentType string.

And the project currently start correctly without internet.

I've checked each XSD declared in my applicationContext.xml and ContentType
do not appears in these XSD.

But I've this declaration

"http://cxf.apache.org/bindings/soap
http://cxf.apache.org/schema/bindings/soap.xsd"
where
 http://cxf.apache.org/schema/bindings/soap.xsd

ends with a 404 error.

Thomas.
On Tue, Nov 10, 2009 at 18:43, Daniel Kulp <dk...@apache.org> wrote:

>
> If you look at the stack trace, it's occurring while trying to load some
> schemas.  My suggestion would be to run wireshark or similar to capture all
> the traffic going in/out of your computer during startup.   My "gut
> feeling"
> is that it's trying to hit the internet for a schema of some sort and that
> server is returning an invalid xml doc or some error page or something like
> that occasional.  (maybe overloaded?)      If you can figure out what it's
> grabbing, you can copy it locally into your app and add a META-
> INF/spring.schemas file to remap it to the local version.
>
> Dan
>
> On Tue November 10 2009 10:38:07 am Thomas Manson wrote:
> > Hi,
> >
> >   I've build a framework, and then, I expose it's method via webservice
> > using CXF (2.2.2).
> >
> >   On this project, i've one error that happen quite randomly on project
> > start, which complains about a missing > on entity ContentType on line
> 81,
> > when parsing our spring applicationContext.xml.
> >
> >   The problem is that our applicationContext.xml has only 48 lines...
> > without the CXF part, I never have the problem.
> >
> >   If I restart the project right after, it start correctly. If I wait
> some
> > time, I get it again....
> >
> >   Does it ring a bell to anyone ?
> >
> > Thomas.
> >
> >
> > 2009-11-10 16:08:20,869 DEBUG
> > fr.rs2i.swFramework.ws.jms.bw.SpringInitializator : BeanFactory init with
> > applicationContextFile : '/conf/applicationContext-rs2i.xml'
> > 2009-11-10 16:08:20,963 INFO
> > org.springframework.context.support.ClassPathXmlApplicationContext :
> > Refreshing
> >
> org.springframework.context.support.ClassPathXmlApplicationContext@12b6651
> :
> > display name
> >
> [org.springframework.context.support.ClassPathXmlApplicationContext@12b6651
> > ]; startup date [Tue Nov 10 16:08:20 CET 2009]; root of context hierarchy
> >  2009-11-10 16:08:21,041 INFO
> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader : Loading
> XML
> > bean definitions from class path resource
> > [/conf/applicationContext-rs2i.xml]
> > Exception in thread "main"
> > org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
> Line
> > 81 in XML document from class path resource
> > [/conf/applicationContext-rs2i.xml] *is invalid; nested exception is
> > org.xml.sax.SAXParseException: The declaration for the entity
> "ContentType"
> > must end with '>'.*
> > at
> >
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDef
> > initions(XmlBeanDefinitionReader.java:404) at
> >
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefin
> > itions(XmlBeanDefinitionReader.java:342) at
> >
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefin
> > itions(XmlBeanDefinitionReader.java:310) at
> >
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.load
> > BeanDefinitions(AbstractBeanDefinitionReader.java:143) at
> >
> org.springframework.context.support.AbstractXmlApplicationContext.loadBeanD
> > efinitions(AbstractXmlApplicationContext.java:109) at
> >
> org.springframework.context.support.AbstractXmlApplicationContext.loadBeanD
> > efinitions(AbstractXmlApplicationContext.java:80) at
> >
> org.springframework.context.support.AbstractRefreshableApplicationContext.r
> > efreshBeanFactory(AbstractRefreshableApplicationContext.java:123) at
> >
> org.springframework.context.support.AbstractApplicationContext.obtainFreshB
> > eanFactory(AbstractApplicationContext.java:422) at
> >
> org.springframework.context.support.AbstractApplicationContext.refresh(Abst
> > ractApplicationContext.java:352) at
> >
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(C
> > lassPathXmlApplicationContext.java:197) at
> >
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(C
> > lassPathXmlApplicationContext.java:172) at
> >
> fr.rs2i.swFramework.ws.jms.bw.SpringInitializator.<init>(SpringInitializato
> > r.java:48) at
> >
> fr.rs2i.swFramework.ws.jms.bw.SpringInitializator.main(SpringInitializator.
> > java:65) *Caused by: org.xml.sax.SAXParseException: The declaration for
> the
> >  entity "ContentType" must end with '>'.*
> > at
> >
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseE
> > xception(Unknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unkn
> > own Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknow
> > n Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknow
> > n Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown
> > Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanEntityDecl(Un
> > known Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(Unknown
> > Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDExternalSu
> > bset(Unknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatche
> > r.dispatch(Unknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scan
> > Document(Unknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(U
> > nknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(U
> > nknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchema(
> > Unknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.resolveSch
> > ema(Unknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructT
> > rees(Unknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructT
> > rees(Unknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchem
> > a(Unknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(Unkno
> > wn Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGra
> > mmar(Unknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartEl
> > ement(Unknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(
> > Unknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartE
> > lement(Unknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$Frag
> > mentContentDispatcher.dispatch(Unknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scan
> > Document(Unknown Source)
> > at
> >
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> > Source)
> > at
> >
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> > Source)
> > at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
> > Source)
> > at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown
> > Source)
> > at
> >
>  com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown
> >  Source)
> > at
> >
> org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(De
> > faultDocumentLoader.java:75) at
> >
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDef
> > initions(XmlBeanDefinitionReader.java:396) ... 12 more
> >
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>

Re: random SAXParseException : The declaration for the entity "ContentType" must end with '>'.

Posted by Daniel Kulp <dk...@apache.org>.
If you look at the stack trace, it's occurring while trying to load some 
schemas.  My suggestion would be to run wireshark or similar to capture all 
the traffic going in/out of your computer during startup.   My "gut feeling" 
is that it's trying to hit the internet for a schema of some sort and that 
server is returning an invalid xml doc or some error page or something like 
that occasional.  (maybe overloaded?)      If you can figure out what it's 
grabbing, you can copy it locally into your app and add a META-
INF/spring.schemas file to remap it to the local version.

Dan

On Tue November 10 2009 10:38:07 am Thomas Manson wrote:
> Hi,
> 
>   I've build a framework, and then, I expose it's method via webservice
> using CXF (2.2.2).
> 
>   On this project, i've one error that happen quite randomly on project
> start, which complains about a missing > on entity ContentType on line 81,
> when parsing our spring applicationContext.xml.
> 
>   The problem is that our applicationContext.xml has only 48 lines...
> without the CXF part, I never have the problem.
> 
>   If I restart the project right after, it start correctly. If I wait some
> time, I get it again....
> 
>   Does it ring a bell to anyone ?
> 
> Thomas.
> 
> 
> 2009-11-10 16:08:20,869 DEBUG
> fr.rs2i.swFramework.ws.jms.bw.SpringInitializator : BeanFactory init with
> applicationContextFile : '/conf/applicationContext-rs2i.xml'
> 2009-11-10 16:08:20,963 INFO
> org.springframework.context.support.ClassPathXmlApplicationContext :
> Refreshing
> org.springframework.context.support.ClassPathXmlApplicationContext@12b6651:
> display name
> [org.springframework.context.support.ClassPathXmlApplicationContext@12b6651
> ]; startup date [Tue Nov 10 16:08:20 CET 2009]; root of context hierarchy
>  2009-11-10 16:08:21,041 INFO
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader : Loading XML
> bean definitions from class path resource
> [/conf/applicationContext-rs2i.xml]
> Exception in thread "main"
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 81 in XML document from class path resource
> [/conf/applicationContext-rs2i.xml] *is invalid; nested exception is
> org.xml.sax.SAXParseException: The declaration for the entity "ContentType"
> must end with '>'.*
> at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDef
> initions(XmlBeanDefinitionReader.java:404) at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefin
> itions(XmlBeanDefinitionReader.java:342) at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefin
> itions(XmlBeanDefinitionReader.java:310) at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.load
> BeanDefinitions(AbstractBeanDefinitionReader.java:143) at
> org.springframework.context.support.AbstractXmlApplicationContext.loadBeanD
> efinitions(AbstractXmlApplicationContext.java:109) at
> org.springframework.context.support.AbstractXmlApplicationContext.loadBeanD
> efinitions(AbstractXmlApplicationContext.java:80) at
> org.springframework.context.support.AbstractRefreshableApplicationContext.r
> efreshBeanFactory(AbstractRefreshableApplicationContext.java:123) at
> org.springframework.context.support.AbstractApplicationContext.obtainFreshB
> eanFactory(AbstractApplicationContext.java:422) at
> org.springframework.context.support.AbstractApplicationContext.refresh(Abst
> ractApplicationContext.java:352) at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(C
> lassPathXmlApplicationContext.java:197) at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(C
> lassPathXmlApplicationContext.java:172) at
> fr.rs2i.swFramework.ws.jms.bw.SpringInitializator.<init>(SpringInitializato
> r.java:48) at
> fr.rs2i.swFramework.ws.jms.bw.SpringInitializator.main(SpringInitializator.
> java:65) *Caused by: org.xml.sax.SAXParseException: The declaration for the
>  entity "ContentType" must end with '>'.*
> at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseE
> xception(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unkn
> own Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknow
> n Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknow
> n Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanEntityDecl(Un
> known Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDExternalSu
> bset(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatche
> r.dispatch(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scan
> Document(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(U
> nknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(U
> nknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchema(
> Unknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.resolveSch
> ema(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructT
> rees(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructT
> rees(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchem
> a(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(Unkno
> wn Source)
> at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGra
> mmar(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartEl
> ement(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(
> Unknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartE
> lement(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$Frag
> mentContentDispatcher.dispatch(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scan
> Document(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown
> Source)
> at
>  com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown
>  Source)
> at
> org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(De
> faultDocumentLoader.java:75) at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDef
> initions(XmlBeanDefinitionReader.java:396) ... 12 more
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog