Printing in Sandbox

Jessica Finley jfinley at tech4learning.com
Mon Mar 25 15:33:26 PDT 2013


It seems that this issue is caused by bug 7175692, judging from the crash log.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7175692

Is there any hope of this bug being fixed in the near future?  
Has anyone else encountered this problem printing?  If so, what is your work-around, if any?

Thanks!
-Jess



Crash log of the print issue:
-----------------------------------------------
Process:         JavaAppLauncher [4987]
Path:            /Users/jfinley/T4L/./Print Violation Checker 1.8.app/Contents/MacOS/JavaAppLauncher
Load Address:    0x10003c000
Identifier:      com.tech4learning.Pixie
Version:         4.0 (4.0)
Code Type:       x86_64 (Native)
Parent Process:  JavaAppLauncher [4985]

Date/Time:       2013-03-25 13:50:22.941 -0600
OS Version:      Mac OS X 10.8.3 (12D78)
Report Version:  8

Thread 0:
0   libsystem_kernel.dylib        	0x00007fff926bb02a __open_nocancel + 10
1   libjava.dylib                 	0x0000000100f06d50 Java_java_lang_UNIXProcess_forkAndExec + 1369
2                                 	0x0000000101755734
3                                 	0x00000001017491d4
4                                 	0x0000000101749058
5                                 	0x0000000101749233
6                                 	0x0000000101749233
7                                 	0x0000000101749233
8                                 	0x0000000101749233
9                                 	0x00000001017434f7
10  libjvm.dylib                  	0x00000001004d8a8c JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) + 1710
11  libjvm.dylib                  	0x00000001005120ab JVM_DoPrivileged + 568

Binary Images:
       0x100235000 -        0x10094dfe7  libjvm.dylib (0) <C47DCAE3-3E9D-3E08-B0CD-A3F0020363FA> /Users/jfinley/T4L/Print Violation Checker 1.8.app/Contents/PlugIns/1.7.0.jre/Contents/Home/jre//lib/server/libjvm.dylib
       0x100efe000 -        0x100f20fff  libjava.dylib (1) <A16C4AAB-A459-34DB-93E0-DAAB3259D12D> /Users/jfinley/T4L/Print Violation Checker 1.8.app/Contents/PlugIns/1.7.0.jre/Contents/Home/jre/lib/libjava.dylib
    0x7fff926a9000 -     0x7fff926c4ff7  libsystem_kernel.dylib (2050.22.13) <5A961E2A-CFB8-362B-BC43-122704AEB047> /usr/lib/system/libsystem_kernel.dylib

On Mar 20, 2013, at 2:30 PM, Jessica Finley <jfinley at tech4learning.com> wrote:

> Hiya,
> 
> It appears that trying to print, even using the standard native dialog, causes a sandbox violation - in both JDK 7 and JDK 8.  Below is a sample class which needs to be bundled into a sandboxed app to show the problem (kudos to Abhinay as this is just a slight modification of his print code submitted a few days ago).
> 
> The violation occurs after you dismiss the native print dialog by pressing its Print button.
> 
> I've also noticed that if you then let the app run untouched while, for example, you type up an email, it continues to throw sandbox violations of the same nature.
> 
> Is there something I'm missing?  I do have the com.apple.security.print entitlement set to true…  This seems like a nasty bug…
> 
> -Jess
> 
> import java.awt.FlowLayout;
> import java.awt.event.ActionEvent;
> import java.awt.event.ActionListener;
> import java.awt.print.PrinterException;
> import java.awt.print.PrinterJob;
> 
> import javax.print.attribute.HashPrintRequestAttributeSet;
> import javax.print.attribute.PrintRequestAttributeSet;
> import javax.print.attribute.standard.DialogTypeSelection;
> import javax.swing.JButton;
> import javax.swing.JFrame;
> import javax.swing.SwingUtilities;
> 
> public class PrintDialogTestCase extends JFrame {
> 	public PrintDialogTestCase() {
> 		this.setTitle("Example");
> 		this.setSize(200, 100);
> 		this.setLocationRelativeTo(null);
> 		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
> 
> 		this.setLayout(new FlowLayout());
> 
> 		JButton printDialogButton = new JButton("Print Dialog");
> 		printDialogButton.addActionListener(new ActionListener() {
> 			public void actionPerformed(ActionEvent event) {
> 				PrinterJob printJob = PrinterJob.getPrinterJob();
> 				if(printJob.printDialog())
> 				{
> 					//don't even need to actually print,
> 					//try {
> 						//printJob.print();
> 					//} catch (PrinterException pe) {
> 					//}
> 				}
> 
> 			}
> 		});
> 		this.add(printDialogButton);
> 
> 		JButton exitButton = new JButton("Exit");
> 		exitButton.addActionListener(new ActionListener() {
> 			public void actionPerformed(ActionEvent event) {
> 				System.exit(0);
> 			}
> 		});
> 		this.add(exitButton);
> 	}
> 	public static void main(String[] args) {
> 		SwingUtilities.invokeLater(new Runnable() {
> 			public void run() {
> 				PrintDialogTestCase window = new PrintDialogTestCase();
> 				window.setVisible(true);
> 			}
> 		});
> 	}
> }
> 
> 




More information about the macosx-port-dev mailing list