[jbpm]解決JBPM圖形流程設計器的gpd.xml文件的中文亂碼問題2008-05-31 20:51JBPM圖形流程設計器是eclipse插件,最近我的電腦上用它設計出的流程只要是中文,那么就會在gpd.xml是顯示是亂碼。
經過檢驗與搜索,確認此問題為設計器的問題。
環境:eclipse 3.3.2 jee版的,字符集設置成utf-8,設計器jpdl_3.1.0.SP1。
解決辦法:org.jbpm.gd.jpdl_3.1.0.SP1里面有個文件ui.jar,反編譯類org.jbpm.gd.common.editor.AbstractContentProvider.class,修改兩個地方。
1、
找到:new ByteArrayInputStream(toNotationInfoXml(rootContainer).getBytes()), true, true, null);,
改成:new ByteArrayInputStream(toNotationInfoXml(rootContainer).getBytes("UTF-8")), true, true, null);
2、
找到:InputStreamReader inputstreamreader = new InputStreamReader(ifile.getContents());
Element notationInfo = new SAXReader().read(reader).getRootElement();,
改成InputStreamReader inputstreamreader = new InputStreamReader(ifile.getContents(),"UTF-8");
Element notationInfo = new SAXReader().read(reader).getRootElement();
重新編譯再打入ui.jar包就OK了,說白了就是設置編碼UTF-8就OK了。
說明:些類需引入很多eclipse的.jar,仔細在eclipse里找,比較麻煩,哈哈。另,如果你還沒解決,留下你的Email,我有時間就會發改后的ui.jar包給你。
再補充一下,每一點都有兩個地方要改,也就是說一共要改4個地方。
修改方法:
使用eclipse,新建一個工程。。然后將相關依賴包加入到工程的類路徑中(如果不確定是哪個包,就將eclipse的plugins目錄下的所有jar加入到工程的類路徑下)
提供一個已經修改編譯好的ui.jar包下載
posted on 2008-10-13 19:15
想飛的魚 閱讀(2220)
評論(1) 編輯 收藏 所屬分類:
jbpm