Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 49
Registered: ‎08-25-2009
My Device: Not Specified

org.xml.sax.SAXParseException: Undefined entity reference 'nbsp'.

[ Edited ]

Hi all,

 

I am getting the exception "org.xml.sax.SAXParseException: Undefined entity reference 'nbsp' " on Curve 8310 device. I am using the DOM parser for parsing the xml response. the code is working fine on the simulator and also on BOLD and STORM devices but not on curve.

 

please help me out of this I have no clue about this exception.

 

 

Thanks,

Shashank

Developer
Posts: 49
Registered: ‎08-25-2009
My Device: Not Specified

Re: org.xml.sax.SAXParseException: Undefined entity reference 'nbsp'.

Hey, help me out of this...

is that a problem with coding or its device specific problem.

what should I do for that??

 

please respond as soon as possible..................

 

Thanks

Shashank 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: org.xml.sax.SAXParseException: Undefined entity reference 'nbsp'.

I suspect your parser has hit a " ".

 

I am leaping to a conclusion here based on something that has happened to me, so perhaps this is completely wrong.  But I suspect that the data you are receiving on the Curve is not the same as the data you are sending. 

 

Unfortunately you are going to have to dump out the data you receive on the Curve and compare it with what you sent, or what the other devices receive.

 

Can you also tell us what networks and connection methods are involved - which networks/connections work and which do not.

Developer
Posts: 49
Registered: ‎08-25-2009
My Device: Not Specified

Re: org.xml.sax.SAXParseException: Undefined entity reference 'nbsp'.

can you tell me how can I escape the " " while parsing?

 

and I am hitting the same webservice from every device. So, may be the response I am getting is the same in every Device and do network connections and connection methods effects the response?

I don't have any Idea on it. So, please let me know...

 

 

Thanks alot for your reply

Shashank

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: org.xml.sax.SAXParseException: Undefined entity reference 'nbsp'.

"do network connections and connection methods effects the response?"

 

Unfortunately yes they do, and my first thought is that you have hit one of these differences. 

 

But as noted, I am leaping to a conclusion here that might not be correct.  So I'm not guaranteeing this will help.  It is just what I would do next.

 

Can you tell us what carrier and what connection method is in use on the failing device and compare that with the devices that is not having a problem?

 

But the best way to determine whether or not this is a problem is to dump out the data that you receive.  On the device, the easiest approach is to use the Event Logger, and then the user has to do the "ALT-L-G-L-G" to display the log and then find your entry, then they can copy/paste and email to you.  Alternatively you can save the response in some working storage and then have a way that the user can display it, and copy/paste to email it to you.  These options assume the user/device is remote from you.  If you have access to the device then you can probably debug on the device itself.

Developer
Posts: 49
Registered: ‎08-25-2009
My Device: Not Specified

Re: org.xml.sax.SAXParseException: Undefined entity reference 'nbsp'.

[ Edited ]

Sorry for the late reply,

 

actually I am not aware what carrier and connection method is involved, the error is coming to the client and I am not in contact with him.

 

 lets assume that I am hitting the nbsp so what can I do to avoid it in any condition?

how can I escape it during parsing...?

 

Thanks

Shashank

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: org.xml.sax.SAXParseException: Undefined entity reference 'nbsp'.

In my opinion, attempting to work around the problem is not an appropriate way to proceed.  If something is putting these in your data, then it is likely that they are putting other incompatible HTML tags in there too.  

 

If you are going to change your program, I suggest you change it so that when it gets this exception, it will trap it and then email you with all the data you need, like the URL, connection suffix, headers sent, headers received, and most importantly, the data received.

 

Any other approach is just like putting a band-aid on the infection, rather than fighting the infection.

Developer
Posts: 445
Registered: ‎10-14-2008
My Device: Blackberry Bold 9000
My Carrier: SingTel

Re: org.xml.sax.SAXParseException: Undefined entity reference 'nbsp'.

i m getting the same nbsp parsing problem...

 

any one get the solution for this..

 

i am using the saxparser...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks & Regards
Zahid Naqvi | Senior Software Engineer