idea 12 parse some chinese character error

hi,all:
     Today, I download idea 12,then I install and run it. When i run junit test on my existent project, i got below error:
Caused by: org.dom4j.DocumentException: Invalid byte 1 of 1-byte UTF-8 sequence. Nested exception: Invalid byte 1 of 1-byte UTF-8 sequence.
 at org.dom4j.io.SAXReader.read(SAXReader.java:484)
 at org.dom4j.io.SAXReader.read(SAXReader.java:343)
 at com.taobao.ad.enginenotify.NotifyFacadeImpl.loadNotifyConfig(NotifyFacadeImpl.java:101)
 at com.taobao.ad.enginenotify.NotifyFacadeImpl.afterPropertiesSet(NotifyFacadeImpl.java:37)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
 ... 95 more


Some exception stack infomation is ignored. These exceptions make me puzzled, because I don't change any code,and that code run correctly before. So I run idea 11, and run the same test case, it pass.....
  After some time debug, I find  the chinese charactor "牌"--- utf-8 code is "E7 89 8C" make this exception.
Can somebody fix it? Thank you, forgive my poor english.:)
26 comments
Comment actions Permalink

Hello.

Please, check Settings / File encodings: IDE Encoding and Project Default Encoding. Do they match the actual encoding of the file in question?

Regards,
Alexander.

0
Comment actions Permalink

it happened to me too.

I set Settings / File encodings to utf-8. xml file encoding also is utf-8. xml' content starting with "<?xml version="1.0" encoding="UTF-8"?>".

when build project, IDEA generate source file happened errors. some chinese character is chaos.
but after change xml file encoding attritue from UTF-8 to gbk, xml file encoding not change, building project,  IDEA generate source file is correct.

when use IDEA11, everything well done.

ps:My project is maven project.

0
Comment actions Permalink

> IDEA generate source file
Do you mean you run some Maven goal generating sources?

Regards,
Alexander.

0
Comment actions Permalink

I got this error too ,it's back to normal when I delete all chinese character in xml file . My project is a maven project too.

ERROR in ch.qos.logback.core.joran.event.SaxEventRecorder@1fef80a - I/O error occurred while parsing xml file com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 3 of 3-byte UTF-8 sequence.

0
Comment actions Permalink

No.I use "Build Project" button.

0
Comment actions Permalink

Please create corresponding ticket at the IJ tracker with a sample project attached to it.

Denis

0
Comment actions Permalink

Thanks Denis. I got it. Maven filter caught this problem. when remove Maven filter, all passed. IDEA maven bug?

          <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*.*</include>
                </includes>
            </resource>
        </resources>

0
Comment actions Permalink

thanks backkom, that work.

0
Comment actions Permalink

I'm afraid I don't quite understand what exactly happened - do you say that maven filtering plugin inserted chinese characters in incorrect encoding during the processing?

Denis

0
Comment actions Permalink

I think it is the problem . idea 11 is normal.

0
Comment actions Permalink

Denis, hope attach will help you.



Attachment(s):
test.rar.zip
0
Comment actions Permalink

Sorry for disappear some days.
backkom sun  provide the solution works!!!! I remove the <filtering>true</filtering> ,then run test case , everything is ok!!!
I guess it is a IDEA maven plugin's bug.

0
Comment actions Permalink

Sorry but the project you attached contains just an xml file with chinese character. It's also not clear what do you do to see the problem. Please provide exact information on what should be done in order to reproduce it locally.

Denis

0
Comment actions Permalink

the zip file is a simple maven project,just a Test.java class,a xml file contain a chinese charactor “牌”. Run the main method, you will
see the error.Then you can delete pom.xml 23 line:<filtering>true</filtering> , run main method, it pass....



Attachment(s):
idea.zip
0
Comment actions Permalink

Still unable to reproduce that.

How do you run the Test class? Via 'Run Test.main()' context menu action? Provide a screenshot of your run configuration - is there some action at 'before make' section?

Denis

0
Comment actions Permalink

I run Test.class by right hit mouse, select the 'Run 'Test.main()'' in the popup menu.
btw, my maven version is 2.2.1

0
Comment actions Permalink

Please provide screenshot of a run configuration that is auto-created when you do right click -> 'Run Test.main()'. Provide a screenshot of your compiler settings as well - Project Settings | Compiler. The last question is if the problem reproduced under IJ 11?

Denis

0
Comment actions Permalink

I've reproduced the problem eventually. Feel free to track this ticket's progess - IDEA-97558.

Denis

0
Comment actions Permalink

thank you very much. idea 11 does not have this problem.

0
Comment actions Permalink

Denis Zhdanov , I see in the IDEA-97558 you provide a picture that you set project default encoding is utf-32. But I see that setting in my idea,  it is blank. Could you tell me why? Thanks.
idea bug.jpg

0
Comment actions Permalink

I manually configured the project to use encoding over than utf-8 in order to reproduce the problem.

Denis

0
Comment actions Permalink

The problem has been introduced to the 'out-of-process' compiler. You can switch to the 'in-process' compiler as a temporary solution.

Denis

0
Comment actions Permalink

then as my idea, the blank encoding mean which encoding? System default?

0
Comment actions Permalink

How can I switch to 'in-process' setting  compiler  in IDEA 12?

0
Comment actions Permalink

Its managed via 'Use external build' checkbox at the compiler settings.

Denis

0

Please sign in to leave a comment.