Click here to Skip to main content
15,889,216 members
Home / Discussions / Java
   

Java

 
QuestionProb in MultiTextures Pin
002comp11-Mar-10 0:05
002comp11-Mar-10 0:05 
QuestionAllow applet access to printer - once and for all Pin
Klazen10-Mar-10 11:19
Klazen10-Mar-10 11:19 
AnswerRe: Allow applet access to printer - once and for all Pin
Richard MacCutchan11-Mar-10 1:46
mveRichard MacCutchan11-Mar-10 1:46 
GeneralRe: Allow applet access to printer - once and for all Pin
Klazen12-Mar-10 13:29
Klazen12-Mar-10 13:29 
GeneralRe: Allow applet access to printer - once and for all Pin
Richard MacCutchan12-Mar-10 21:53
mveRichard MacCutchan12-Mar-10 21:53 
QuestionRe: Allow applet access to printer - once and for all Pin
RB Chowdary23-Feb-11 19:51
RB Chowdary23-Feb-11 19:51 
AnswerRe: Allow applet access to printer - once and for all Pin
Andrew Thommo23-Feb-11 23:24
Andrew Thommo23-Feb-11 23:24 
GeneralRe: Allow applet access to printer - once and for all Pin
Marc Schabb4-Jan-12 7:14
Marc Schabb4-Jan-12 7:14 
We tried this fix and it seems to be causing further problems. Our implementation is:

try {
    final Doc doc = new SimpleDoc (docBytes, javax.print.DocFlavor.BYTE_ARRAY.AUTOSENSE, null);
            AccessController.doPrivileged(new PrivilegedExceptionAction() {
                public Object run() throws PrintException {
            DocPrintJob printerJob = selectedPrinter.getPrintService().createPrintJob();;
            PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
            printerJob.print(doc, aset);
            result.setStatus("SUCCESS");
            return null;
                }
            });
    }
    catch (Exception e) {
        e.printStackTrace();
        result.setStatus("FAILED");
    }



We're using the doPrivileged call with PrivilegedExceptionAction so that we can report the failure to the server to be reported. The problem is we are now seeing in the production logs that a small percentage of the print jobs fail with PrivilegedActionException, which we never saw before. We have not been able to reproduce this in our test environments, so in fact we don't really know whether the previous versions were failing or not - maybe we're just seeing the exceptions in the logs now, but they were always there.
Questionprevent multiple instances of same server over the network Pin
A-MEN10-Mar-10 6:40
A-MEN10-Mar-10 6:40 
AnswerCross-post Pin
Kristian Sixhøj10-Mar-10 7:01
Kristian Sixhøj10-Mar-10 7:01 
Questionprintf() help?? Pin
AmbiguousName9-Mar-10 7:49
AmbiguousName9-Mar-10 7:49 
AnswerRe: printf() help?? Pin
Richard MacCutchan9-Mar-10 9:02
mveRichard MacCutchan9-Mar-10 9:02 
AnswerRe: printf() help?? Pin
fuzzix12-Mar-10 7:31
fuzzix12-Mar-10 7:31 
GeneralRe: printf() help?? [modified] Pin
AmbiguousName12-Mar-10 20:20
AmbiguousName12-Mar-10 20:20 
GeneralRe: printf() help?? Pin
Richard MacCutchan12-Mar-10 22:18
mveRichard MacCutchan12-Mar-10 22:18 
GeneralRe: printf() help?? Pin
AmbiguousName12-Mar-10 22:35
AmbiguousName12-Mar-10 22:35 
GeneralRe: printf() help?? Pin
Richard MacCutchan13-Mar-10 0:10
mveRichard MacCutchan13-Mar-10 0:10 
QuestionHow do i catch the exception when it throws OutOfMemory Exception? Pin
Ram Bonala9-Mar-10 0:23
Ram Bonala9-Mar-10 0:23 
AnswerRe: How do i catch the exception when it throws OutOfMemory Exception? Pin
KarstenK9-Mar-10 1:11
mveKarstenK9-Mar-10 1:11 
AnswerRe: How do i catch the exception when it throws OutOfMemory Exception? Pin
Richard MacCutchan9-Mar-10 1:16
mveRichard MacCutchan9-Mar-10 1:16 
GeneralRe: How do i catch the exception when it throws OutOfMemory Exception? Pin
David Skelly9-Mar-10 1:38
David Skelly9-Mar-10 1:38 
GeneralRe: How do i catch the exception when it throws OutOfMemory Exception? Pin
Richard MacCutchan9-Mar-10 2:12
mveRichard MacCutchan9-Mar-10 2:12 
QuestionDiff between j3d and jgl? Pin
002comp8-Mar-10 20:30
002comp8-Mar-10 20:30 
QuestionCustom Design Surface (Hosting a Designer) possible Pin
akamper8-Mar-10 4:10
akamper8-Mar-10 4:10 
AnswerRe: Custom Design Surface (Hosting a Designer) possible Pin
Richard MacCutchan8-Mar-10 21:42
mveRichard MacCutchan8-Mar-10 21:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.