This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
NB: 5.5 daily 0919 OS: Windows XP(Japanese), Linux (ja_JP.UTF-8 locale) Locale: ja AS: AS82 PE ml, AS9 PE ml JDK: 1.5.0_07 See screenshot. Japanese characters are garbled in Output window. It was working at Beta2, but not working now. I checked 0818 Q-build, it was not working. Bundled Tomcat is OK. 5.0: OK 5.5 Beta2: OK 5.5 0818: garbled 5.5 0919: garbled Step: 1. Install ml version of AS82 or AS9 2. Start NB in Japanese locale 3. Register the AS 4. Start the server 5. See output window
Created attachment 34163 [details] screenshot
We switch to RandomFileAccess for the viewer. similar to old tomcat bug http://www.netbeans.org/issues/show_bug.cgi?id=20331 The fix applied there was to use FileReader: boolean takeFocus; String prefix,suffix; File logFile; - RandomAccessFile raf; + FileReader fileReader; LogThread(String logFilePath, String prefix, String suffix, boolean takeFocus){ this.logFilePath=logFilePath; this.prefix=prefix; @@ -1001,28 +1001,24 @@ long size = logFile.length(); if (size==offset) continue; try { - RandomAccessFile ra = getRandomAccessFile(logFile); - ra.seek(offset); - String line=null; - while ((line=ra.readLine())!=null) { - writer.write(line+'\n'); //NOI18N + try { + fileReader = new FileReader(logFile); + fileReader.skip(offset); + int b; + while ((b=fileReader.read())!=-1) writer.write(b); + } finally { + if (fileReader!=null) fileReader.close(); } wasWritten=true; if (takeFocus) inOut.select(); - }catch (IOException ex){} + }catch (IOException ex){ + TopManager.getDefault ().getErrorManager ().notify (ErrorManager.WARNING, ex); + } offset=size; } } tasks.remove(prefix); writer.close(); - if (raf!=null) try {raf.close();}catch (IOException ex){} - - } - private RandomAccessFile getRandomAccessFile(File file) throws IOException{ - if (raf==null) { - raf = new RandomAccessFile(file,"r"); //NOI18N - } - return raf; We need to apply the same one ...
Fix almost ready and tested on my *japanese* system... One more thing to do is to stop the thread and close the log file reader when the server is stopped via the IDE to release the lock. this way, we will have same behaviour as before.
Created attachment 34477 [details] startserver
Created attachment 34478 [details] viewer
Created attachment 34479 [details] viewlog action
Ludo, can you commit the fix in release55_dev. Masaki, can you verify this fix in next build from release55_dev. Thanks
Still not ready, not for the japan chars, but when the log file rotates. Working more with pcw on that as well...
Created attachment 34618 [details] review code
I will commit in dev so that the filer can verify the bug. I did install japanese local on my system to also verify.
Created attachment 34652 [details] Updated ViewLogAction.java after review.
I reviewed the patch, ok to commit to release55_dev for wider testing.
Edit -- description of modified review file above is incorrect -- I meant to say LogViewerSupport.java. The attachment is the correct file.
Checking in LogViewerSupport.java; /cvs/serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/LogViewerSupport.java,v <-- LogViewerSupport.java new revision: 1.1.16.3.2.5.2.2; previous revision: 1.1.16.3.2.5.2.1 done Checking in StartSunServer.java; /cvs/serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/StartSunServer.java,v <-- StartSunServer.java new revision: 1.4.4.6.2.19.2.3; previous revision: 1.4.4.6.2.19.2.2 done Checking in runtime/actions/ViewLogAction.java; /cvs/serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/runtime/actions/ViewLogAction.java,v <-- ViewLogAction.java new revision: 1.1.16.1.2.3.2.2; previous revision: 1.1.16.1.2.3.2.1 done
masaki, can you verify fix in release55_dev build? Thanks
v. in dev branch
OK, I will try on my Japanese systems.
Verified on 5.5_dev 0929. It works fine on Windows, Linux and Solaris SPARC & x86 in Japanese locales.
release55 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/runtime/actions/ViewLogAction.java?r1=1.1.16.1.2.4&r2=1.1.16.1.2.5 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/LogViewerSupport.java?r1=1.1.16.3.2.6&r2=1.1.16.3.2.7 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/StartSunServer.java?r1=1.4.4.6.2.20&r2=1.4.4.6.2.21
*** Issue 86232 has been marked as a duplicate of this issue. ***
v