You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Arunkumar Soundararajan <so...@lightsurf.com> on 2005/09/13 07:42:23 UTC

Re: Wierd problem while unmarshalling

Hi

Any updates on this?

Now a days Im getting this error

SAXException: Parsing Error : Content is not allowed in prolog

According to the documentation it says

That's a parser error, not a JDOM error.  Either your content is
malformed (you didn't send it in so we can't know) or your parser is
broken.

Any more updates on this??

On Fri, 2005-09-09 at 17:29, Arunkumar Soundararajan wrote:
> Hi
> 
> Im using castor(0.9.5.3) in my project. A small flow is like this
> Receive feeds in teh form of XML. Use castor to form the object. Get the
> object after unmarshalling.
> 95% of the times the XML parses succesfully, rest 5% it throws me the
> below
> 
> org.xml.sax.SAXException: Parsing Error : Premature end of file.
> Line : -1
> Column : -1
>                                                                                                                              
>         at
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1197)
>         at
> org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:605)
>         at
> org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:513)
>         at
> com.lightsurf.alertscore.channelqueue.vch.VCHFeedParser.createDTOFromXML(VCHFeedParser.java:144)
>         at
> com.lightsurf.alertscore.channelqueue.vch.VCHFeedParser.parseFeedSource(VCHFeedParser.java:262)
>         at
> com.lightsurf.alertscore.channelqueue.vch.VCHChannelProtocolAdapter.processFeed(VCHChannelProtocolAdapter.java:57)        at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
>         at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:163)
>         at $Proxy5.processFeed(Unknown Source)
>         at
> com.lightsurf.alertscore.channelqueue.vch.VCHChannelAdapterServlet.service(VCHChannelAdapterServlet.java:167)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:90)
>         at
> com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:99)
>                                                                                                                              
> The XML is fine when placed in the browser. Can you please tell me why
> this happens. Also line number 144 in the (VCHFeedParser.java:144)
> corresponds to unmarshalling(like below) 
> 
> objList = (ContentList) objUnmarshaller.unmarshal(reader);
> 
> Can you please tell me where the problem is? Im struggling to find it
> out as everything looks OK.
> 
> Attached are the mapping files for your reference. Also the value
> objects are attached, so you can get upto something.
> 
> Regards
> 
> Arunkumar.S
> 
> 


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


Re: Wierd problem while unmarshalling

Posted by Arunkumar Soundararajan <so...@lightsurf.com>.
Hi all

This was meant for some other forum. Sorry 

Arun

On Tue, 2005-09-13 at 19:11, Jacob Kjome wrote:
> What exactly does this have to do with Log4j?  What was the log4j-user list cc'd
> on something that seems totally inconsequential to Log4j?
> 
> Jake
> 
> Quoting Arunkumar Soundararajan <so...@lightsurf.com>:
> 
> > Hi
> >
> > Any updates on this?
> >
> > Now a days Im getting this error
> >
> > SAXException: Parsing Error : Content is not allowed in prolog
> >
> > According to the documentation it says
> >
> > That's a parser error, not a JDOM error.  Either your content is
> > malformed (you didn't send it in so we can't know) or your parser is
> > broken.
> >
> > Any more updates on this??
> >
> > On Fri, 2005-09-09 at 17:29, Arunkumar Soundararajan wrote:
> > > Hi
> > >
> > > Im using castor(0.9.5.3) in my project. A small flow is like this
> > > Receive feeds in teh form of XML. Use castor to form the object. Get the
> > > object after unmarshalling.
> > > 95% of the times the XML parses succesfully, rest 5% it throws me the
> > > below
> > >
> > > org.xml.sax.SAXException: Parsing Error : Premature end of file.
> > > Line : -1
> > > Column : -1
> > >
> > >         at
> > >
> > org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1197)
> > >         at
> > > org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:605)
> > >         at
> > > org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:513)
> > >         at
> > >
> >
> com.lightsurf.alertscore.channelqueue.vch.VCHFeedParser.createDTOFromXML(VCHFeedParser.java:144)
> > >         at
> > >
> >
> com.lightsurf.alertscore.channelqueue.vch.VCHFeedParser.parseFeedSource(VCHFeedParser.java:262)
> > >         at
> > >
> >
> com.lightsurf.alertscore.channelqueue.vch.VCHChannelProtocolAdapter.processFeed(VCHChannelProtocolAdapter.java:57)
> >        at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
> > >         at
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > >         at java.lang.reflect.Method.invoke(Method.java:324)
> > >         at
> > >
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
> > >         at
> > >
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:163)
> > >         at $Proxy5.processFeed(Unknown Source)
> > >         at
> > >
> >
> com.lightsurf.alertscore.channelqueue.vch.VCHChannelAdapterServlet.service(VCHChannelAdapterServlet.java:167)
> > >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:90)
> > >         at
> > >
> >
> com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:99)
> > >
> > > The XML is fine when placed in the browser. Can you please tell me why
> > > this happens. Also line number 144 in the (VCHFeedParser.java:144)
> > > corresponds to unmarshalling(like below)
> > >
> > > objList = (ContentList) objUnmarshaller.unmarshal(reader);
> > >
> > > Can you please tell me where the problem is? Im struggling to find it
> > > out as everything looks OK.
> > >
> > > Attached are the mapping files for your reference. Also the value
> > > objects are attached, so you can get upto something.
> > >
> > > Regards
> > >
> > > Arunkumar.S
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org


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


Re: Wierd problem while unmarshalling

Posted by Jacob Kjome <ho...@visi.com>.
What exactly does this have to do with Log4j?  What was the log4j-user list cc'd
on something that seems totally inconsequential to Log4j?

Jake

Quoting Arunkumar Soundararajan <so...@lightsurf.com>:

> Hi
>
> Any updates on this?
>
> Now a days Im getting this error
>
> SAXException: Parsing Error : Content is not allowed in prolog
>
> According to the documentation it says
>
> That's a parser error, not a JDOM error.  Either your content is
> malformed (you didn't send it in so we can't know) or your parser is
> broken.
>
> Any more updates on this??
>
> On Fri, 2005-09-09 at 17:29, Arunkumar Soundararajan wrote:
> > Hi
> >
> > Im using castor(0.9.5.3) in my project. A small flow is like this
> > Receive feeds in teh form of XML. Use castor to form the object. Get the
> > object after unmarshalling.
> > 95% of the times the XML parses succesfully, rest 5% it throws me the
> > below
> >
> > org.xml.sax.SAXException: Parsing Error : Premature end of file.
> > Line : -1
> > Column : -1
> >
> >         at
> >
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1197)
> >         at
> > org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:605)
> >         at
> > org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:513)
> >         at
> >
>
com.lightsurf.alertscore.channelqueue.vch.VCHFeedParser.createDTOFromXML(VCHFeedParser.java:144)
> >         at
> >
>
com.lightsurf.alertscore.channelqueue.vch.VCHFeedParser.parseFeedSource(VCHFeedParser.java:262)
> >         at
> >
>
com.lightsurf.alertscore.channelqueue.vch.VCHChannelProtocolAdapter.processFeed(VCHChannelProtocolAdapter.java:57)
>        at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
> >         at
> >
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >         at java.lang.reflect.Method.invoke(Method.java:324)
> >         at
> >
>
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
> >         at
> >
>
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:163)
> >         at $Proxy5.processFeed(Unknown Source)
> >         at
> >
>
com.lightsurf.alertscore.channelqueue.vch.VCHChannelAdapterServlet.service(VCHChannelAdapterServlet.java:167)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:90)
> >         at
> >
>
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:99)
> >
> > The XML is fine when placed in the browser. Can you please tell me why
> > this happens. Also line number 144 in the (VCHFeedParser.java:144)
> > corresponds to unmarshalling(like below)
> >
> > objList = (ContentList) objUnmarshaller.unmarshal(reader);
> >
> > Can you please tell me where the problem is? Im struggling to find it
> > out as everything looks OK.
> >
> > Attached are the mapping files for your reference. Also the value
> > objects are attached, so you can get upto something.
> >
> > Regards
> >
> > Arunkumar.S
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>




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


Re: Wierd problem while unmarshalling

Posted by Adam Hiatt <gm...@multideals.com>.
Arunkumar Soundararajan <soundararajan.arun <at> lightsurf.com> writes:
> 
> Hi
> 
> Any updates on this?
> 
> Now a days Im getting this error
> 
> SAXException: Parsing Error : Content is not allowed in prolog
> 
> According to the documentation it says
> 
> That's a parser error, not a JDOM error.  Either your content is
> malformed (you didn't send it in so we can't know) or your parser is
> broken.
> 
> Any more updates on this??
> 
> On Fri, 2005-09-09 at 17:29, Arunkumar Soundararajan wrote:
> > Hi
> > 
> > Im using castor(0.9.5.3) in my project. A small flow is like this
> > Receive feeds in teh form of XML. Use castor to form the object. Get the
> > object after unmarshalling.
> > 95% of the times the XML parses succesfully, rest 5% it throws me the
> > below
> > 
> > org.xml.sax.SAXException: Parsing Error : Premature end of file.
> > Line : -1
> > Column : -1
> 
>                                                                              
                                                
> >         at
> > org.apache.xerces.parsers.AbstractSAXParser.parse
(AbstractSAXParser.java:1197)
> >         at
> > org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:605)
> >         at
> > org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:513)
> >         at
> > com.lightsurf.alertscore.channelqueue.vch.VCHFeedParser.createDTOFromXML
(VCHFeedParser.java:144)
> >         at
> > com.lightsurf.alertscore.channelqueue.vch.VCHFeedParser.parseFeedSource
(VCHFeedParser.java:262)
> >         at
> >
> 
com.lightsurf.alertscore.channelqueue.vch.VCHChannelProtocolAdapter.processFeed
(VCHChannelProtocolAdapter.java:57)
>        at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
> >         at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
> >         at java.lang.reflect.Method.invoke(Method.java:324)
> >         at
> > org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection
(AopUtils.java:288)
> >         at
> > org.springframework.aop.framework.JdkDynamicAopProxy.invoke
(JdkDynamicAopProxy.java:163)
> >         at $Proxy5.processFeed(Unknown Source)
> >         at
> > com.lightsurf.alertscore.channelqueue.vch.VCHChannelAdapterServlet.service
(VCHChannelAdapterServlet.java:167)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:90)
> >         at
> > com.caucho.server.dispatch.ServletFilterChain.doFilter
(ServletFilterChain.java:99)
> 
>                                                                              
                                                
> > The XML is fine when placed in the browser. Can you please tell me why
> > this happens. Also line number 144 in the (VCHFeedParser.java:144)
> > corresponds to unmarshalling(like below) 
> > 
> > objList = (ContentList) objUnmarshaller.unmarshal(reader);
> > 
> > Can you please tell me where the problem is? Im struggling to find it
> > out as everything looks OK.
> > 
> > Attached are the mapping files for your reference. Also the value
> > objects are attached, so you can get upto something.
> > 
> > Regards
> > 
> > Arunkumar.S

I think it might have something to do with Castor's ability to deal with 
streams.  Or more specifically, the Xerces' parser's ability to do this.

See: http://xml.apache.org/xerces-j/faq-write.html#faq-11

and
http://forum.java.sun.com/thread.jspa?threadID=295125&messageID=1164796
("the root element is required" error problem).  The solution is: "upgrade 
your xerces parser" according to this article.

If you figure out more info. let me know as I am getting the same error as you 
are!  I think I have to do something differently with the buffered stream or 
something?
-- Adam






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