Hi

I am getting the CharConversionException parsing the attached XML document.
If u see the xml, the encoding is not "UTF-8", instead it is "iso-8859-1" I
found a special character in the xml. Please let me know how to overcome
this exception

Also is there anyway of changing the encoding from UTF-8 to any other
encoding when doing the unmarshalling.

Here is the text that contains the special character
*In addition, one-on-one coaching, called "Techspert Time,” is
available for more than 20 hours each week.<BR><BR>*

Thanks
Madhu
Error parsing document (line 5, col 1)
com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 start byte 0x94 (at char #2144, 
byte #127)
        at com.ctc.wstx.sr.StreamScanner.throwFromIOE(StreamScanner.java:683)
        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1086)
        at 
org.jibx.runtime.impl.StAXReaderWrapper.next(StAXReaderWrapper.java:201)
        at 
org.jibx.runtime.impl.UnmarshallingContext.toTag(UnmarshallingContext.java:577)
        at 
org.jibx.runtime.impl.UnmarshallingContext.matchStart(UnmarshallingContext.java:711)
        at 
org.jibx.runtime.impl.UnmarshallingContext.parseToStartTag(UnmarshallingContext.java:734)
        at 
com.travelocity.cruise.dto.VesselDTO.JiBX_Binding_CruiseReviews_unmarshal_1_1(VesselDTO.java)
        at 
com.travelocity.cruise.dto.JiBX_Binding_CruiseReviewsVesselDTO_access2.unmarshal()
        at 
org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2773)
        at 
org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2916)
        at 
com.travelocity.commons.util.xml.JibxXMLUtil.unmarshallObject(JibxXMLUtil.java:259)
        at 
com.travelocity.util.CruiseCriticFeedReader.parseXmlToObject(CruiseCriticFeedReader.java:28)
        at 
com.travelocity.util.CruiseCriticFeedReaderTest.testParseXmlToObject(CruiseCriticFeedReaderTest.java:13)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:210)
        at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:135)
        at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:122)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225)
        at 
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)
Caused by: java.io.CharConversionException: Invalid UTF-8 start byte 0x94 (at 
char #2144, byte #127)
        at com.ctc.wstx.io.UTF8Reader.reportInvalidInitial(UTF8Reader.java:299)
        at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:185)
        at com.ctc.wstx.io.MergedReader.read(MergedReader.java:101)
        at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:84)
        at 
com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57)
        at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:967)
        at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:1009)
        at com.ctc.wstx.sr.StreamScanner.getNextChar(StreamScanner.java:769)
        at 
com.ctc.wstx.sr.BasicStreamReader.parseNormalizedAttrValue(BasicStreamReader.java:1900)
        at 
com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:3035)
        at 
com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2934)
        at 
com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2846)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.797 sec <<< 
FAILURE!
        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
        ... 37 more
\
<?xml version="1.0" encoding="iso-8859-1"?>
<VesselReviewFeed>
<Vessels>

<Vessel LineName="Holland America Line" ReviewStage="3" ShipID="283" VesselName="Oosterdam">

<Ratings>
<Dining Rating="4.00"/>
<Entertainment Rating="3.00"/>
<Family Rating="2.00"/>
<Rates Rating="4.00"/>
<Ribbons Rating="3.50"/>
</Ratings>

<Statistics>
<Tonnage Value="82,000"/>
<Passengers Value="1,824"/>
<Crew Value="800"/>
<LaunchYear Value="2003"/>
<Decks Value="11"/>
<Registry Value="The Netherlands"/>
<CDCScore Value="99"/>
</Statistics>

<Content>



<Section Header="Entertainment" Value="Oosterdam's entertainment is varied: from big production features to individual performers ranging from comics to illusionists. We loved the usual Crew Show, with its Indonesian performers.  &lt;BR>&lt;BR>  Disco night and country line dancing is offered in Northern Lights and movies -- complete with freshly made popcorn -- are shown each evening after dinner in the Queen's Lounge. &lt;BR>&lt;BR>  A video arcade and intimate piano bar are additional entertainment venues.BR>&lt;BR>  Daily programs list cooking and dance classes, the ever-present bingo and art auctions, Ping-Pong, team trivia, volleyball and basketball, aerobics, and spa and salon demonstrations. Shore excursion and port-shopping talks are offered live and in-cabin. &lt;BR>&lt;BR>  Wine tasting and cooking courses are popular.&lt;BR>&lt;BR>  The ship has a state-of-the-art Internet facility. The rate is 75 cents per minute and various plans are available (such as 100 minutes for $55). There is a $3.95 start-up fee. Oosterdam even has a wireless program; Wi-Fi is $10 per day plus per minute charges. Laptops can be rented.&lt;BR>&lt;BR>  New to Oosterdam in 2008 is the Microsoft Digital Workshops program, comprised of complimentary classes led by Microsoft-trained &quot;techsperts.&quot; Passengers can learn to use computers to enhance photos (Windows Live Photo Gallery), produce and publish videos onto a DVD (Windows Movie Maker) and create personal webpages or blogs (Windows Live Services and Windows Live Writer). In addition, one-on-one coaching, called &quot;Techspert Time,” is available for more than 20 hours each week.&lt;BR>&lt;BR>" lastupdated="2009-07-23 13:26:00.0"/>





</Content>

</Vessel>

</Vessels>
</VesselReviewFeed>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to