打印界面,有时出现异常,急,在线等待。

594king 2004-11-23 09:11:00
我打印界面,程序有时运行正常,有时一点打印按钮,程序就推出,并产生一个错误日志。请高手们一定帮忙,散分100。

相关程序代码如下:
Toolkit kit = Toolkit.getDefaultToolkit();
Properties props = new Properties();
props.put("awt.print.printer", "hp_printer");
props.put("awt.print.numCopies", "1");
props.put("awt.print.orientation", "landscape");//横向

if (kit != null) {
PrintJob printJob = kit.getPrintJob(this, "", props);
if (printJob != null) {
Graphics pg = printJob.getGraphics();
pg.setClip(0, 30, 842, 450);
if (pg != null) {
try {
this.printAll(pg);
}
finally {
pg.dispose();
}
}
printJob.end();
}
else
System.out.println("");
}



产生的错误日志内容如下:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x77F67152
Function=GdiPrinterThunk+0x965
Library=C:\WINNT\system32\GDI32.DLL

Current Java thread:
at sun.awt.windows.WPrinterJob.endDoc(Native Method)
at sun.print.PrintJob2D.end(PrintJob2D.java:441)
at dmis.AccidentBriefing.printFrameAction(AccidentBriefing.java:438)
at dmis.AccidentBriefing.jButton5_actionPerformed(AccidentBriefing.java:415)
at dmis.AccidentBriefing_jButton5_actionAdapter.actionPerformed(AccidentBriefing.java:617)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

Dynamic libraries:
0x00400000 - 0x00407000 C:\JBuilderX\jdk1.4\bin\javaw.exe
0x77F80000 - 0x77FFD000 C:\WINNT\system32\ntdll.dll
0x796D0000 - 0x79732000 C:\WINNT\system32\ADVAPI32.dll
0x77E60000 - 0x77F32000 C:\WINNT\system32\KERNEL32.DLL
0x786F0000 - 0x78761000 C:\WINNT\system32\RPCRT4.DLL
0x77DF0000 - 0x77E55000 C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7B000 C:\WINNT\system32\GDI32.DLL
0x78000000 - 0x78045000 C:\WINNT\system32\MSVCRT.dll
0x75E00000 - 0x75E1A000 C:\WINNT\system32\IMM32.DLL
0x6C330000 - 0x6C338000 C:\WINNT\system32\LPK.DLL
0x65D20000 - 0x65D74000 C:\WINNT\system32\USP10.dll
0x08000000 - 0x08136000 C:\JBuilderX\jdk1.4\jre\bin\client\jvm.dll
0x77530000 - 0x77560000 C:\WINNT\system32\WINMM.dll
0x10000000 - 0x10007000 C:\JBuilderX\jdk1.4\jre\bin\hpi.dll
0x007F0000 - 0x007FE000 C:\JBuilderX\jdk1.4\jre\bin\verify.dll
0x00800000 - 0x00818000 C:\JBuilderX\jdk1.4\jre\bin\java.dll
0x00820000 - 0x0082D000 C:\JBuilderX\jdk1.4\jre\bin\zip.dll
0x18470000 - 0x1857F000 C:\JBuilderX\jdk1.4\jre\bin\awt.dll
0x777C0000 - 0x777DE000 C:\WINNT\system32\WINSPOOL.DRV
0x79B20000 - 0x79B30000 C:\WINNT\system32\MPR.DLL
0x77A30000 - 0x77B1F000 C:\WINNT\system32\ole32.dll
0x18580000 - 0x185D0000 C:\JBuilderX\jdk1.4\jre\bin\fontmanager.dll
0x51000000 - 0x5104D000 C:\WINNT\system32\ddraw.dll
0x72800000 - 0x72806000 C:\WINNT\system32\DCIMAN32.dll
0x5C000000 - 0x5C0C8000 C:\WINNT\system32\D3DIM700.DLL
0x1A810000 - 0x1A81D000 C:\Program Files\MsnOK\MSNHOOK.dll
0x687E0000 - 0x687EB000 C:\WINNT\system32\PSAPI.DLL
0x60000000 - 0x6004B000 C:\WINNT\system32\MSCTF.dll
0x1A890000 - 0x1A8AD000 C:\WINNT\DOWNLO~1\BDPlugin.dll
0x77990000 - 0x77A2B000 C:\WINNT\system32\OLEAUT32.dll
0x777E0000 - 0x777E7000 C:\WINNT\system32\VERSION.dll
0x75950000 - 0x75956000 C:\WINNT\system32\LZ32.DLL
0x73800000 - 0x73824000 C:\WINNT\system32\winabc.ime
0x78F90000 - 0x791D5000 C:\WINNT\system32\SHELL32.dll
0x63180000 - 0x631E4000 C:\WINNT\system32\SHLWAPI.dll
0x71780000 - 0x7180A000 C:\WINNT\system32\COMCTL32.dll
0x1B260000 - 0x1B26F000 C:\JBuilderX\jdk1.4\jre\bin\net.dll
0x74FB0000 - 0x74FC4000 C:\WINNT\system32\WS2_32.dll
0x74FA0000 - 0x74FA8000 C:\WINNT\system32\WS2HELP.DLL
0x1B270000 - 0x1B285000 C:\WINNT\system32\ws2_64.dll
0x70200000 - 0x70294000 C:\WINNT\system32\WININET.dll
0x79C40000 - 0x79CC7000 C:\WINNT\system32\CRYPT32.dll
0x773F0000 - 0x77400000 C:\WINNT\system32\MSASN1.DLL
0x74F50000 - 0x74F6E000 C:\WINNT\system32\msafd.dll
0x74F90000 - 0x74F97000 C:\WINNT\System32\wshtcpip.dll
0x1B2D0000 - 0x1B2D3000 C:\WINNT\mui\fallback\0804\msctf.dll.mui
0x76AF0000 - 0x76B2E000 C:\WINNT\system32\COMDLG32.DLL
0x76840000 - 0x76873000 C:\WINNT\system32\spool\DRIVERS\W32X86\3\UNIDRVUI.DLL
0x72C50000 - 0x72CE0000 C:\WINNT\system32\CLBCATQ.DLL
0x69B10000 - 0x69C32000 C:\WINNT\system32\msxml3.dll
0x76080000 - 0x760D0000 C:\WINNT\system32\WINHTTP.dll
0x1BED0000 - 0x1BF48000 C:\WINNT\system32\urlmon.dll
0x70440000 - 0x704CF000 C:\WINNT\system32\mlang.dll
0x1BF60000 - 0x1BF6B000 C:\Program Files\Common Files\Microsoft Shared\OFFICE11\MSOXMLMF.DLL
0x76880000 - 0x768BE000 C:\WINNT\system32\spool\DRIVERS\W32X86\3\UNIDRV.DLL
0x50000000 - 0x50032000 C:\WINNT\system32\spool\DRIVERS\W32X86\3\hpcrd05.dll
0x4F480000 - 0x4F55D000 C:\WINNT\system32\spool\DRIVERS\W32X86\3\hpcstr05.dll
0x77900000 - 0x77923000 C:\WINNT\system32\imagehlp.dll
0x72960000 - 0x7298D000 C:\WINNT\system32\DBGHELP.dll

Heap at VM Abort:
Heap
def new generation total 1472K, used 863K [0x10010000, 0x101a0000, 0x104f0000)
eden space 1344K, 64% used [0x10010000, 0x100e7bb0, 0x10160000)
from space 128K, 0% used [0x10160000, 0x10160080, 0x10180000)
to space 128K, 0% used [0x10180000, 0x10180000, 0x101a0000)
tenured generation total 18448K, used 11066K [0x104f0000, 0x116f4000, 0x14010000)
the space 18448K, 59% used [0x104f0000, 0x10fbeb38, 0x10fbec00, 0x116f4000)
compacting perm gen total 10752K, used 10539K [0x14010000, 0x14a90000, 0x18010000)
the space 10752K, 98% used [0x14010000, 0x14a5ae80, 0x14a5b000, 0x14a90000)

Local Time = Mon Nov 22 23:38:35 2004
Elapsed Time = 61
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_01-b06 mixed mode)
#

各位英雄,一定要帮帮我
...全文
85 点赞 收藏 7
写回复
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
jFresH_MaN 2004-11-23
我觉得跟代码无关
硬件或者驱动的问题
回复
594king 2004-11-23
to funcreal(new PLMM[Integer.MAX_VALUE]):
能否具体一点,我报错的语句是下面这句:
printJob.end();
回复
tom2005 2004-11-23
帮你UP
回复
funcreal 2004-11-23
这个大概不是java的事情,使外部模块出现问题。多数情况是你的问题。
回复
594king 2004-11-23
谢谢,我也怀疑是jre的问题,我现在用的是1.4.2,1.5我用不了,有其他问题,难道要换1.3吗?
回复
j2nix 2004-11-23
更换JAVA虚拟机试试。
回复
594king 2004-11-23
谢谢各位,都是热心人,我换了一个高版本的jre,没问题了,我现在就散分。但是还想知道为什么高版本对低版本兼容得不太好呢?
回复
发动态
发帖子
Java SE
创建于2007-09-28

6.1w+

社区成员

Java 2 Standard Edition
申请成为版主
社区公告
暂无公告