Ticket #8354

JRE1.5 で印刷できない
Open Date: 2006-05-01 10:00 Last Update: 2006-08-28 10:32

Reporter:
Owner:
Type:
Status:
Closed
Component:
(None)
MileStone:
(None)
Priority:
2
Severity:
5 - Medium
Resolution:
Fixed
File:
None

Details

JRE1.5 で印刷できない.

現象としては,プレビューまでは普通に進むがその後 Print
ボタンを押すと,MainWindow は書いたグラフが消えてプリン
タは反応しない.

Ticket History (3/12 Histories)

2006-05-16 08:50 Updated by: orrisroot
  • Resolution Update from None to Fixed
Comment
Logged In: YES
user_id=8064

JRE1.5 では印刷時に ClassCastException を吐いていた.
印刷 API を変更することで修正.
2006-08-24 23:03 Updated by: orrisroot
  • Ticket Close date is changed to 2006-08-24 23:03
  • Status Update from Open to Closed
Comment
Logged In: YES
user_id=8064

修正を反映したバージョン 1.0.6 のリリースに伴いクローズします.
2006-08-24 23:42 Updated by: (del#13001)
Comment
Logged In: YES
user_id=13001

1.0.6リリースご苦労さまです。
今、手元のVine Linux 3.2に入れて、JRE1.5ととともに試した処、
下記のように出て、同じ症状になります。私には意味が良く分かり
ませんので、報告のみでreopenしません。

[irino@localhost samurai-graph-bin-1.0.6]$
/usr/java/jre1.5.0_06/bin/java -jar s amurai-graph.jar
[SunJDK14ConditionalEventPump] Exception occurred during
event dispatching:
java.lang.IndexOutOfBoundsException
at java.io.BufferedInputStream.read(Unknown Source)
at sun.net.www.MeteredStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at
sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unkn
own Source)
at java.io.DataInputStream.read(Unknown Source)
at sun.print.IPPPrintService.readIPPResponse(Unknown
Source)
at sun.print.IPPPrintService.opGetAttributes(Unknown
Source)
at sun.print.IPPPrintService.initAttributes(Unknown
Source)
at
sun.print.IPPPrintService.getSupportedDocFlavors(Unknown Source)
at
sun.print.IPPPrintService.isDocFlavorSupported(Unknown Source)
at
sun.print.RasterPrinterJob.getPrintService(Unknown Source)
at sun.print.RasterPrinterJob.defaultPage(Unknown
Source)
at sun.print.RasterPrinterJob.setPrintable(Unknown
Source)
at
jp.riken.brain.ni.samuraigraph.application.SGImageExportManager.print
(Unknown Source)
at
jp.riken.brain.ni.samuraigraph.base.SGDrawingWindow.toImage(Unknown
S ource)
at
jp.riken.brain.ni.samuraigraph.base.SGDrawingWindow.printImage(Unknow
n Source)
at
jp.riken.brain.ni.samuraigraph.application.SGMainFunctions$WindowMana
ger.actionPerformed(Unknown Source)
at
jp.riken.brain.ni.samuraigraph.base.SGDrawingWindow.notifyToListener(
Unknown Source)
at
jp.riken.brain.ni.samuraigraph.base.SGDrawingWindow.actionPerformed(U
nknown Source)
at
jp.riken.brain.ni.samuraigraph.base.SGMenuBar.actionPerformed(Unknown
Source)
at
javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at
javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
at
javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown
Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at
javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown
Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
Source)
at
java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at
java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown
Source)
at java.awt.EventDispatchThread.run(Unknown Source)
2006-08-25 01:00 Updated by: orrisroot
  • Status Update from Closed to Open
Comment
Logged In: YES
user_id=8064

報告していただいたので reopen します.

少し調べてみました.

Windows では特に問題が無いのですが,Linux の場合環境変数
LANG が悪さし,印刷 Job 自体を受け付けないことがあるようです.

手元の Fedora Core 5 (JRE 1.5.0_08, CUPS 1.2.2) で試したところ,
$ LANG=C ~/jdk1.5.0_08/jre/bin/java -jar samurai-graph.jar
で起動しないと印刷できませんでした.

エラーを見るとこの現象と違うようですが,一度試していただけま
せんでしょうか?

もし的をはずしているとすれば,描画されたグラフ依存の問題で
しょうか…
2006-08-25 07:09 Updated by: (del#13001)
Comment
Logged In: YES
user_id=13001

LANG=C /usr/java/jre1.5.0_06/bin/java -jar samurai-graph.jar
して、exmple1からscalar-xyプロットをひとつ作ってから、プリン
トしようとしたところ、同じ症状が出た上で、以下のメッセージが
でました。

[SunJDK14ConditionalEventPump] Exception occurred during
event dispatching:
java.lang.IndexOutOfBoundsException
at java.io.BufferedInputStream.read(Unknown Source)
at sun.net.www.MeteredStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at
sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown
Source)
at java.io.DataInputStream.read(Unknown Source)
at sun.print.IPPPrintService.readIPPResponse(Unknown
Source)
at sun.print.IPPPrintService.opGetAttributes(Unknown
Source)
at sun.print.IPPPrintService.initAttributes(Unknown
Source)
at
sun.print.IPPPrintService.getSupportedDocFlavors(Unknown Source)
at
sun.print.IPPPrintService.isDocFlavorSupported(Unknown Source)
at
sun.print.RasterPrinterJob.getPrintService(Unknown Source)
at sun.print.RasterPrinterJob.defaultPage(Unknown
Source)
at sun.print.RasterPrinterJob.setPrintable(Unknown
Source)
at
jp.riken.brain.ni.samuraigraph.application.SGImageExportManager.print(Unknown
Source)
at
jp.riken.brain.ni.samuraigraph.base.SGDrawingWindow.toImage(Unknown
Source)
at
jp.riken.brain.ni.samuraigraph.base.SGDrawingWindow.printImage(Unknown
Source)
at
jp.riken.brain.ni.samuraigraph.application.SGMainFunctions$WindowManager.actionPerformed(Unknown
Source)
at
jp.riken.brain.ni.samuraigraph.base.SGDrawingWindow.notifyToListener(Unknown
Source)
at
jp.riken.brain.ni.samuraigraph.base.SGDrawingWindow.actionPerformed(Unknown
Source)
at
jp.riken.brain.ni.samuraigraph.base.SGMenuBar.actionPerformed(Unknown
Source)
at
javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at
javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
at
javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown
Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at
javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown
Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
Source)
at
java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at
java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown
Source)
at java.awt.EventDispatchThread.run(Unknown Source)


2006-08-25 13:44 Updated by: orrisroot
Comment
Logged In: YES
user_id=8064

やはり別の問題でしたか…
メッセージを見ると Java 印刷APIの中でプリンタとハンドシェイ
クを行う部分でおこっている例外のようです.

ちなみに,他の Java アプリケーション以外のソフトウェアからの
印刷は問題ありませんでしょうか?
2006-08-25 14:24 Updated by: (del#13001)
Comment
Logged In: YES
user_id=13001

ぎく。
現象も同じではなかったですね。
今、ImageJをダウンロードして試したら、同じようなエラーが出て
プリントできませんでした。私の環境が悪いのでした。
お騒がせして申し訳ありません。
2006-08-25 15:03 Updated by: orrisroot
Comment
Logged In: YES
user_id=8064

そうですか..ImageJ も同じでしたか..

同じ種類のエラーは他の Java アプリでもいくつか報告されている
みたいですね.

あと疑う点としては,
・私のテスト環境が sun jre 1.5.0_08 (Fedora Core 5) である点.
・CUPS がきちんと設定され動作している点.
ぐらいか思います.
2006-08-25 16:52 Updated by: (del#13001)
Comment
Logged In: YES
user_id=13001

samurai-graphの問題と関係なくなって来ているのに、御助言感謝
します。
sun jre1.5.0_08にしましたが、問題解決しませんでした。
cupsは、他の(java以外の)アプリケーションからの印刷に問題な
いので、ちゃんと設定されていると思うのですが...
ともあれ、自分の環境を反省してみます。
2006-08-25 19:31 Updated by: orrisroot
  • Priority Update from 8 to 2
Comment
Logged In: YES
user_id=8064

どうやら Java 側の IPP 対応状況のバグかもしれません.

http://www.cups.org/str.php?L1431
あたりを見ると,cupsd.conf の DefaultLanguage や
DefaultCharset の設定が関係してくるようです.
この値を調節してみていただけますでしょうか?
もしかするとうまく動作するかもしれません.

ちなみに,
http://www.cs.duke.edu/csed/java/source1.5/src/solaris/classes/sun/print/IPPPrintService.java

jre のソースコードと見比べてみると,CUPS からの応答がバッ
ファ長を超えているために出ているエラーのようです.

ここまで調べてなんとなく原因は分かったのですが,アプリケー
ション側ではエラーを捕まえることはできても,根本的解決はでき
ないみたいです.

このバグに関しては,重要度をさげて open のまま残しておきたい
と思います.
2006-08-26 10:34 Updated by: (del#13001)
Comment
Logged In: YES
user_id=13001

私のVine Linux 3.2の設定では、/etc/cups/cupsd.confにおいて
DefaultCharset notused
になっていました。そこで、
DefaultCharset EUC-JP
としてみました(一応VineのLANG環境がja_JP.eucJPなので)。
その結果、あっさりプリントできるようになりました。
日本語のラベル書き込んでもちゃんと出力されます。
個別環境のことにも関わらず、御教授頂き、本当に感謝です。
2006-08-28 10:32 Updated by: orrisroot
  • Ticket Close date is changed to 2006-08-28 10:32
  • Status Update from Open to Closed
Comment
Logged In: YES
user_id=8064

問題が解決したようですので再び close させていただきます.

Attachment File List

No attachments

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login