Results 1 to 4 of 4
  1. #1
    JohnST is offline Member
    Join Date
    Dec 2009
    Posts
    20
    Rep Power
    0

    Question Errors running app in linux but not in Windows

    I made an app that works when I run it in Windows, but in Ubuntu the JTables are empty and I get the following errors:

    Java Code:
    com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 4-byte UTF-8 sequence.
            at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:687)
            at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:473)
            at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1719)
            at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipChar(XMLEntityScanner.java:1393)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2760)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:624)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:486)
            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:810)
            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:740)
            at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:110)
            at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:228)
            at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:286)
            at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
            at getMusic.parse(getMusic.java:151)
            at getMusic.<init>(getMusic.java:138)
            at getMusic.main(getMusic.java:1630)
    Here is what is on line 687

    Java Code:
    table.getSelectionModel().addListSelectionListener(new AlbumListener());
    Any ideas? I would like to get this app to work in Linux.

  2. #2
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    952
    Rep Power
    5

    Default

    It looks like a character encoding issue. What does

    Java Code:
    [username@hostname ~] echo $LANG
    ...give you in your Linux shell?

    -Gary-

  3. #3
    FON
    FON is offline Senior Member
    Join Date
    Dec 2009
    Location
    Belgrade, Serbia
    Posts
    366
    Rep Power
    6

    Default

    Here is Javadoc for your problematic class:

    Java > Open Source Codes > com > sun > org > apache > xerces > internal > impl > io > UTF8Reader _ Java API By Example, From Geeks To Geeks.

    As you can see problem is in when you try to
    UTF8Reader.read() a single character
    but whatever is that you are trying to read
    it is not UTF-8 encoded I guess.

    Maybe it's was iso-8859-1 because it was Windows or cp-1252.

  4. #4
    JohnST is offline Member
    Join Date
    Dec 2009
    Posts
    20
    Rep Power
    0

    Default

    Thanks for the help, both of you. I'll have to look into it more when I get the chance.

Similar Threads

  1. Replies: 3
    Last Post: 01-21-2010, 02:51 AM
  2. Running Linux
    By selva.bics in forum AWT / Swing
    Replies: 1
    Last Post: 08-31-2009, 08:01 PM
  3. Replies: 6
    Last Post: 04-08-2009, 05:05 AM
  4. Character encoding in Java (Linux to Windows)
    By BeholdMyGlory in forum New To Java
    Replies: 2
    Last Post: 01-16-2009, 07:24 PM
  5. Access Linux shared folder from Windows OS
    By nitinpjairaj in forum Networking
    Replies: 3
    Last Post: 08-26-2008, 07:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •