Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4766839

WPrinterJob.setNativePrintService() throws EXCEPTION_ACCESS_VIOLATION on Win2K

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.4.0, 1.4.1
    • client-libs
    • 2d
    • x86
    • windows_2000



      Name: rmT116609 Date: 10/22/2002


      FULL PRODUCT VERSION :
      java version "1.4.1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
      Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)


      FULL OPERATING SYSTEM VERSION :

      Microsoft Windows 2000 [Version 5.00.2195] Service Pack 3

      A DESCRIPTION OF THE PROBLEM :
      When trying to create a prinjob and print, I get this error:

      An unexpected exception has been detected in native code
      outside the VM.
      Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at
      PC=0x6D0844C6
      Function=Java_sun_awt_windows_WPrinterJob_setNativePrintService+0x19D
      Library=C:\Program Files\Java\j2re1.4.1\bin\awt.dll

      Current Java thread:
              at
      sun.awt.windows.WPrinterJob.setNativePrintService(Native Method)
              at
      sun.awt.windows.WPrinterJob.setPrintService(WPrinterJob.java:384)
              at NewPackslip.<init>(NewPackslip.java:340)
              at Jprintmain.createpackslip(Jprintmain.java:391)
              at Jprintmain.processReprint(Jprintmain.java:162)
              at Jprintmain.run(Jprintmain.java:106)

      Dynamic libraries:
      0x00400000 - 0x00406000 C:\WINNT\system32\java.exe
      0x77F80000 - 0x77FFB000 C:\WINNT\System32\ntdll.dll
      0x77DB0000 - 0x77E0D000 C:\WINNT\system32\ADVAPI32.dll
      0x77E80000 - 0x77F36000 C:\WINNT\system32\KERNEL32.DLL
      0x77D30000 - 0x77DA1000 C:\WINNT\system32\RPCRT4.DLL
      0x78000000 - 0x78046000 C:\WINNT\system32\MSVCRT.dll
      0x6D330000 - 0x6D45C000 C:\Program
      Files\Java\j2re1.4.1\bin\client\jvm.d
      ll
      0x77E10000 - 0x77E75000 C:\WINNT\system32\USER32.dll
      0x77F40000 - 0x77F7C000 C:\WINNT\system32\GDI32.DLL
      0x77570000 - 0x775A0000 C:\WINNT\system32\WINMM.dll
      0x6D1D0000 - 0x6D1D7000 C:\Program
      Files\Java\j2re1.4.1\bin\hpi.dll
      0x6D300000 - 0x6D30D000 C:\Program
      Files\Java\j2re1.4.1\bin\verify.dll
      0x6D210000 - 0x6D229000 C:\Program
      Files\Java\j2re1.4.1\bin\java.dll
      0x6D320000 - 0x6D32D000 C:\Program
      Files\Java\j2re1.4.1\bin\zip.dll
      0x6D000000 - 0x6D0FA000 C:\Program
      Files\Java\j2re1.4.1\bin\awt.dll
      0x77800000 - 0x7781E000 C:\WINNT\system32\WINSPOOL.DRV
      0x76620000 - 0x76630000 C:\WINNT\system32\MPR.DLL
      0x75E60000 - 0x75E7A000 C:\WINNT\system32\IMM32.dll
      0x77A50000 - 0x77B45000 C:\WINNT\system32\ole32.dll
      0x6D180000 - 0x6D1D0000 C:\Program
      Files\Java\j2re1.4.1\bin\fontmanager.
      dll
      0x1C000000 - 0x1C007000 D:\Program
      Files\AIM95\idlemon.dll
      0x6D2D0000 - 0x6D2DE000 C:\Program
      Files\Java\j2re1.4.1\bin\net.dll
      0x75050000 - 0x75058000 C:\WINNT\system32\WSOCK32.dll
      0x75030000 - 0x75043000 C:\WINNT\system32\WS2_32.DLL
      0x75020000 - 0x75028000 C:\WINNT\system32\WS2HELP.DLL
      0x74FD0000 - 0x74FED000 C:\WINNT\system32\msafd.dll
      0x75010000 - 0x75017000 C:\WINNT\System32\wshtcpip.dll
      0x10000000 - 0x1000F000
      C:\WINNT\System32\spool\DRIVERS\W32X86\3\lxbhUI5
      C.DLL
      0x782F0000 - 0x78536000 C:\WINNT\system32\SHELL32.dll
      0x70BD0000 - 0x70C1C000 C:\WINNT\system32\SHLWAPI.DLL
      0x71700000 - 0x7178A000 C:\WINNT\system32\COMCTL32.DLL
      0x6B770000 - 0x6B783000 C:\WINNT\System32\mscms.dll
      0x0B460000 - 0x0B52E000
      C:\WINNT\System32\spool\DRIVERS\W32X86\3\LXBHSTR
      N.DLL
      0x0B530000 - 0x0B547000
      C:\WINNT\System32\spool\DRIVERS\W32X86\3\lxbhDR5
      C.DLL
      0x0B550000 - 0x0B5A3000
      C:\WINNT\System32\spool\DRIVERS\W32X86\3\LXBHICU
      R.dll
      0x0B5B0000 - 0x0B5D0000
      C:\WINNT\System32\spool\DRIVERS\W32X86\3\lxbhfc5
      c.dll
      0x10040000 - 0x10046000
      C:\WINNT\System32\spool\DRIVERS\W32X86\3\HPBF014
      E.DLL
      0x0BEF0000 - 0x0BF64000
      C:\WINNT\System32\spool\DRIVERS\W32X86\3\HPBF014
      K.dll
      0x780A0000 - 0x780B2000 C:\WINNT\system32\MSVCIRT.dll
      0x0BF70000 - 0x0C081000
      C:\WINNT\System32\spool\DRIVERS\W32X86\3\HPBF014
      H.DLL
      0x10020000 - 0x1003E000
      C:\WINNT\System32\spool\DRIVERS\W32X86\3\HPBF014
      F.DLL
      0x77820000 - 0x77827000 C:\WINNT\system32\VERSION.dll
      0x759B0000 - 0x759B6000 C:\WINNT\system32\LZ32.DLL
      0x73280000 - 0x732B7000 C:\WINNT\system32\COMPSTUI.dll
      0x6B2C0000 - 0x6B2C5000 C:\WINNT\system32\MSIMG32.dll
      0x0C090000 - 0x0C09F000
      C:\WINNT\System32\spool\DRIVERS\W32X86\3\HPBAFD3
      2.DLL
      0x0C4A0000 - 0x0C602000
      C:\WINNT\System32\spool\DRIVERS\W32X86\3\HPBF014
      G.DLL
      0x775A0000 - 0x775B4000
      C:\WINNT\System32\spool\DRIVERS\W32X86\2\RASDDUI
      .DLL
      0x6FF40000 - 0x6FF64000
      C:\WINNT\System32\spool\DRIVERS\W32X86\3\FAXUI.D
      LL
      0x77530000 - 0x77552000 C:\WINNT\system32\TAPI32.dll
      0x70090000 - 0x70097000
      C:\WINNT\System32\spool\DRIVERS\W32X86\3\FAXDRV.
      DLL
      0x77920000 - 0x77943000 C:\WINNT\system32\imagehlp.dll
      0x72A00000 - 0x72A2D000 C:\WINNT\system32\DBGHELP.dll
      0x690A0000 - 0x690AB000 C:\WINNT\system32\PSAPI.DLL

      Local Time = Mon Oct 21 11:04:21 2002
      Elapsed Time = 389
      #
      # The exception above was detected in native code outside the VM
      #
      # Java VM: Java HotSpot(TM) Client VM (1.4.1-b21 mixed mode)
      #
      # An error report file has been saved as hs_err_pid1476.log.
      # Please refer to the file for further information.
      #


      I am using an HP8100N Pcl6 printer.

      Printer driver name and it's version: HP LaserJet 8100 PCL 6 Printer Driver version: 4.3.2.201

      DirectX version: DirectX 7.0 (4.07.00.0700)

      Video Card : ATI Technologies Inc 3D Rage Pro AGP 2X

      My program works just fine under winnt sp6. I can create the error at work and at home. Please help!

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      I was expecting the printer to print out my document.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Graphics;
      import java.awt.Graphics2D;
      import java.awt.Point;
      import java.util.Vector;
      import java.text.NumberFormat;
      import java.util.StringTokenizer;
      import java.awt.print.*;
      import java.awt.print.PrinterJob;
      import java.awt.print.PageFormat;
      import java.awt.image.ImageObserver;
      import java.io.File;
      import java.awt.*;
      import java.awt.image.*;
      import java.awt.print.*;
      import javax.swing.JOptionPane;
      import javax.swing.JFrame;
      import javax.print.*;
      import javax.print.attribute.*;
      import javax.print.attribute.standard.*;
      //
      public class testprint implements Printable
      {
        PrinterJob printJob;
        PageFormat pf = new PageFormat();
        PrintService[] services;
        PrintRequestAttributeSet aset;
        String printdest= "\\\\MIN\\hp8100packslip2";
        int ppos=0;
        public testprint()
        {
          aset = new HashPrintRequestAttributeSet();
          aset.add(OrientationRequested.PORTRAIT);
          aset.add(PrintQuality.DRAFT);
          aset.add(new JobName("testprint", null));
          services = PrinterJob.lookupPrintServices();
          
          for (int j =0; j < services.length;j++)
          {
            if (services[j].getName().startsWith(printdest))
            {
              System.out.println("found at " + j + " " + services[j].getName());
              ppos = j;
            }
          }
          try
          {
            PrinterJob printJob = PrinterJob.getPrinterJob();
            printJob.setJobName("test");
            printJob.setPrintable(this,pf);
            Paper p = pf.getPaper();
            p.setImageableArea(10.0,10.0,600.0,750.0); //H WAS 648.0 W WAS 468.0
            pf.setPaper(p);
            if (services.length > 0)
            {
              printJob.setPrintService(services[ppos]);
                //System.out.println("before print()");
              printJob.print(aset);
               //System.out.println("after print()");
            }
          }
          catch (PrinterException pe)
          {
            System.out.println("Printer Exception! " + pe.toString());
            pe.printStackTrace();
          }
          catch (Exception nullp)
          {
            System.out.println("General Exception! " + nullp.toString());
            nullp.printStackTrace();
          }
        }
        public int print(Graphics g, PageFormat pf,int pageIndex)
        {
          if(pageIndex > 0)
          {
            return Printable.NO_SUCH_PAGE;
          }
          g.setFont(new Font("Verdana",Font.PLAIN,11));
          Graphics2D g2d = (Graphics2D)g;

          g2d.translate(pf.getImageableX(),pf.getImageableY());
          g2d.drawString("Howard, this is a test.....please throw away.",130,28);
          return Printable.PAGE_EXISTS;
        }
        public static void main(String[] args)
        {
          testprint w = new testprint();
        }
      }
      ---------- END SOURCE ----------

      (Review ID: 166047)
      ======================================================================

            jgodinez Jennifer Godinez (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: