HashPrintRequestAttributeSet will not serialize correctly

It seems that HashPrintRequestAttributeSet (or something else) doesn't serialize correctly.
This only works for a certain high end printer with (multi-purpose tray selected). Note that loading from file right after saving works fine (loading from scratch doesn't work).
Output:
Loading print attributes...
Could not load print properties: java.io.InvalidObjectException: Integer value = 12 not in valid range 0..5for class class sun.print.Win32MediaTray
     at javax.print.attribute.EnumSyntax.readResolve(Unknown Source)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at java.io.ObjectStreamClass.invokeReadResolve(Unknown Source)
     at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
     at java.io.ObjectInputStream.readObject0(Unknown Source)
     at java.io.ObjectInputStream.readObject(Unknown Source)
     at javax.print.attribute.HashAttributeSet.readObject(Unknown Source)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
     at java.io.ObjectInputStream.readSerialData(Unknown Source)
     at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
     at java.io.ObjectInputStream.readObject0(Unknown Source)
     at java.io.ObjectInputStream.readObject(Unknown Source)
     at PrintObject.loadAttributes(PrintObject.java:245)
     at PrintObject.sendPrintJob(PrintObject.java:285)
     at printPngApplet.init(printPngApplet.java:81)
     at sun.applet.AppletPanel.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
Sending print job...
Saving print attributes...
Done.
Done.
Loading print attributes...
Done.I have the following class:
class PrintObject implements Printable
     private String propertyFile = "printer.properties";
     private HashPrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
     private Properties properties = new Properties();
     public int print (Graphics g, PageFormat f, int pageIndex)
     private void saveAttributes()
          System.out.println("Saving print attributes...");
          try
               // open property file for writing
               ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(propertyFile));
               // save printer selection
               properties.setProperty("Printer", job.getPrintService().getName());
               // write properties object
               out.writeObject(properties);
               // write attributes object
               out.writeObject(attributes);
               // close property file
               out.close();
               System.out.println("Done.");
          catch (Exception e)
               System.out.print("Could not save print properties: ");
               e.printStackTrace();
     private void loadAttributes()
          System.out.println("Loading print attributes...");
          try
               // open a property file
               ObjectInputStream in = new ObjectInputStream(new FileInputStream(propertyFile));
               // read in the properties object
               properties = (Properties)in.readObject();
               // restore printer selection
               PrintService[] services = PrinterJob.lookupPrintServices();
               for(int i = 0; i < services.length; i++)
                    if( services.getName().toString().compareTo(properties.getProperty("Printer", "").toString()) == 0)
                         try {
                              job.setPrintService(services[i]);
                         } catch (PrinterException e)
                              // Couldn't select a service, sorry
                         break;
               // restore attributes
               attributes = (HashPrintRequestAttributeSet)in.readObject();
               // close property file
               in.close();
               System.out.println("Done.");
          catch (Exception e)
               System.out.print("Could not load print properties: ");
               e.printStackTrace();
     public void sendPrintJob()
          if(job == null)
               System.out.println("No printers were detected");
          else
               // tell the job to use this object to request print pages
               job.setPrintable(this);
               job.setJobName("Site Panel Print Job");
               loadAttributes(); // this fails
               // display print dialog
               if (job.printDialog(attributes))
                    // user pressed OK
                    System.out.println("Sending print job...");
                    saveAttributes();
                    // try printing
                    try { job.print(attributes); }
                    catch (Exception e) { System.out.println(e); }
                    System.out.println("Done.");
                    loadAttributes(); // this works fine
Thanks for any help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Squeek_14 wrote:
HI,
I am facing the same problem with the serialization of the HashPrintRequestAttributeSet object. Just wondering if there have been any updates or resolutions to this problem?Hi,
Please don't resurrect old threads. I'm locking this one.
Create a new thread with a specific question, and a good description of what you are trying to do.
Kaj

Similar Messages

  • Adobe Illustrator file will not display correctly when logged in as a user

    I am working with an Adobe Illustrator CS2 file that will open and display correctly if I log in as Administrator, but will not display correctly if I am logged on as a user. The error message is that there is not enough memory to display the file correctly and I am forced into preview mode. The user Home folder is on a server. Other than this, I have made certain that the criteria for opening the file match under both interfaces. I have opened the AI CS2 file on other Macs and it opens fine. I conclude that the problem is with the user Home folder, but beyond that, I'm stumped. Any help will be appreciated.

    After I filed a bug-report an Apple engineer contacted me, and asked me to try running java in headless mode: http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/
    That solved the problem!

  • Components will not resize correctly in Catalyst

    Download PSD: http://dl.dropbox.com/u/814249/campusariel.psd
    Download FXP: http://dl.dropbox.com/u/814249/campusariel.fxp
    I am completely new to Flash Catalyst (any and all versions). I am currently using Photoshop CS5.5 to design and Catalyst 5.5 to import and translate into a flash project. I recently picked up a job creating an interactive application for a college campus. I have attached my two project files for anyone who can help to view to see what is wrong. I have also attached inline screenies for those who cannot/will not download.
    Here is my problem: I created the attached PSD in Photoshop with what I thought were the correct layers and groups/folders. I am hoping to achieve the following effect: when a user rolls over the purple buttons, multiple similar copies of that button that are initially hidden beneath the visible one popup in sequence above the rolled over purple button.
    Ex. State 1:
    Animation/Action Sequence to the following:
    The purple popup objects will have their own text content and will be buttons themselves that a user clicks to change to a different state with more specific information.
    Not only am I unsure of how to create such animation/action sequence, my purple components (whether I actually convert them to components in Catalyst or not) will not resize correctly. NOTE: I did click the resizable option when importing the PSD into Catalyst. The following effect occurs both ways. I add constraints to all objects by selecting all, right clicking, and choosing add constraints to all; the following occurs when stretched inwards using the resize test handle:
    and this when stretched out:
    When viewed using CTRL+Enter, the application is nowhere near resized in the browser window. I must be missing something, especially being new to Catalyst. I tried flattening the image in Photoshop, which obviously allowed the image to be easily resizable in Catalyst and the test browser window. However, I cannot use my separate elements when flattened; flattening defeats the purpose of Catalyst if I'm not mistaken.
    Any guidance?
    Message was edited by: joshlev

    Hi Martin - Those are really good questions! I did check and the image is uploaded. I assume I can see the image in my one browser because of the cache  since I could not see it on several computers that I had never pulled the site up on before.
    And actually I have it working now. Nancy had a good idea to check to see if I saved it as CMYK instead of RGB. When I went to go open the file on my computer Photoshop and Fireworks had an error in opening it. They had a problem opening the one I downloaded from the ftp too. It just looks like somehow the file became corrupted! Not sure how, but that seems like what the problem was since I have a new image up there now and it's working fine again.
    Thanks for all your help!
    Liz

  • HT1349 itune will not install correctly on my PC  Error message reads "service 'apple mobile device' failed to start

    itune will not install correctly on my PC  Error message reads "service 'apple mobile device' failed to start

    Hello cynthialane,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    How to restart the Apple Mobile Device Service (AMDS) on Windows
    http://support.apple.com/kb/ts1567
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Best of luck,
    Mario

  • ITunes will not install correctly on my PC with Windows 8.  Any hints?

    iTunes will not install correctly on my PC with Windows 8.  Any hints?
    The error message reads:
    iTunes.exe - Entry Point Not Found
    The procedure entry point ADiAdlD_AcquireMatchSlotIfNecessary could not be located in ghe dynamic link library C:\Program Filess(x86)\iTunes\iTunes.dll.

    See this User Tip by turingtest2
    Troubleshooting issues with iTunes for Windows updates

  • I downloaded the new iphoto and the upgrade and now iphoto will not open correctly anymore. please help

    I downloaded the new iphoto and the upgrade and now iphoto will not open correctly anymore. it stays on the opening screen and the message
    shows up that I must update the mediathek. If I click on update the program shuts down. How can I fix this?

    I downloaded the new iphoto and the upgrade
    Does that mean, you are running iPhoto 9.6 on MacOS X 10.10.1 Yosemite? Or are you using an older MacOS X? "New" iPhoto is relative and depends on your system.
    If I click on update the program shuts down. How can I fix this?
    Does "shut down" mean it crashes?  Then post please the error log from the error panel here - copy and paste the report into your next answer (the first 50 lines should suffice)
    Where is your iPhoto Library (Mediathek) stored? Have you moved it to an external drive, or is it still in your Pictures folder (the order "Bilder")?

  • My numbers tables will not open correctly on screen, the preview shows but when I open the table it only shows blank. When I print a copy it prints ok any solutions?

    my numbers tables will not open correctly on screen, the preview shows but when I open the table it only shows blank. When I print a copy it prints ok any solutions?

    Rebooted computer works now ok

  • Webpages will not load correctly on any browser

    Hey all,
    About 3 weeks ago I took the leap and upgraded my works PC from Windows 8 to 8.1 (as a test before doing the rest). Unfortunately since this time I've been continually encountering a major issue.
    This issue is that webpages will not load correctly (about half the time). Since the day I upgraded I've had issues with this, across all browsers. Sometime a webpage will load, sometimes it'll partially load and sometimes it seems to have loaded but actually
    hasn't (I.e. none of the links/inputs work). If I have an issue on a page, the only way I can get it to load is to click the stop button, navigate away from the page and then navigate back.
    I've tries assessing the problem with Firebug and it seems that the HTTP transfer is being cut-off at a certain point (which is non-consistent). The webpage is then stuck in a state of 'Transferring data' and will never finish loading.
    I've been looking around for answers and have come across some suggested solutions like running the All In One fix from tweaking.com, or flushing the DNS cache every few hours, but nothing is working.
    Has anyone any suggestions for how I could fix (or even further troubleshoot) this problem?
    Thanks
    David

    Please try a clean boot. 
    http://support.microsoft.com/kb/929135
    Arnav Sharma | http://arnavsharma.net/ Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading
    the thread.

  • My iphoto will not open correctly.  All I get is the little wheel going around and around.  What do I need to do to open my iphoto?

    My iphoto will not open correctly.  All I get is the little wheel going around and around.  What do I need to do to fix this?  I would like to be able to see my photos again.

    There are 9 different versions of iPhoto and they run on 9 different versions of the Operating System. The tricks and tips for dealing with issues vary depending on the version of iPhoto and the version of the OS. So to get help you need to give as much information as you can. Include things like:
    - What version of iPhoto.
    - What version of the Operating System.
    - Details. As full a description of the problem as you can. For example, if you have a problem with exporting, then explain by describing how you are trying to export, and so on.
    - History: Is this going on long? Has anything been installed or deleted? - Are there error messages?
    - What steps have you tried already to solve the issue.
    - Anything unusual about your set up? Or how you use iPhoto?
    Anything else you can think of that might help someone understand the problem you have.

  • Photos from the Internet will not load correctly. I get white boxes with blue question marks inside. This has only been happening for the past 3 weeks so I'm not sure why it is happening.

    Photos from the Internet will not load correctly. I get white boxes with blue question marks inside. This has only been happening for the past 3 weeks so I'm not sure why it is happening.

    Yes - email &amp; text work fine but when I use something like Google Images or search a blog with imbedded photos I get the empty white boxes with question marks.  If I click the question mark it opens the photo but I can't possibly do that for EVERY image on EVERY page I search!?!?!  I've rebooted the iPad &amp; my wireless card several times but neither action helped.  Have any clue what I should do now?

  • I am using a Application in c dll calling from jni jar by java applet in firefox version 19.0 , the problem is click event message box will not working correct

    I am using a Application in c dll calling from jni jar by java applet in firefox version 19.0 , the problem is button click event message box or popup window will not working correctly. Please any one suggest me the steps to overcome this not responding or slowness in the responding problem of Button click event.

    Hello,
    In Firefox 23, as part of an effort to simplify the Firefox options set and protect users from unintentially damaging their Firefox, the option to disable JavaScript was removed from the Firefox Options window.
    However, the option to disable JavaScript was not removed from Firefox entirely. You can still access it from about:config or by installing an add-on.
    '''about:config'''
    # In the address bar, type "about:config" (with no quotes), and press Enter.
    # Click "I'll be careful, I promise"
    # In the search bar, search for "javascript.enabled" (with no quotes).
    # Right click the result named "javascript.enabled" and click "Toggle". JavaScript is now disabled.
    To Re-enable JavaScript, repeat these steps.
    '''Add-ons'''
    You can alternatively install an add-on that lets you disable JavaScript, such as
    *[https://addons.mozilla.org/firefox/addon/noscript/ No-Script] (to disable JavaScript on a per page basis, as required)
    *[https://addons.mozilla.org/firefox/addon/quickjava/ QuickJava] (to easily disable and enable JavaScript, automatic loading of images, and other content)
    Thank you and I hope this helps!

  • "Non rectangular objects will not appear correctly when exported using CSS."

    I am using Ind CC 2014 exporting a document to a reflowable epub.  The document contains an .ai image.  The image exports correctly in some parts of the.epub but not others, where it is distorted. There is a warning on export :"Non rectangular objects will not appear correctly when exported using CSS."  Any suggestions appreciated.

    Thanks!
    >
          "Non rectangular objects will not appear correctly when exported
          using CSS."
    created by pooja2087 <https://forums.adobe.com/people/pooja2087> in
    /InDesign EPUB/ - View the full discussion
    <https://forums.adobe.com/message/6886892#6886892>

  • Canon mg3200 will not align correctly prints is blurred

    Canon mg3200 will not align correctly prints is blurred. I have used the canon print head alignment several times. It will print some of the picture correctly and the rest is out.

    Hello,
    Please try the procedures outlined in the link below:
    http://kbsupport.cusa.canon.com/system/selfservice.controller?CONFIGURATION=1011&PARTITION_ID=1&secu...
    If the issue persists at that point, the best thing to do would be to get in touch with our technical support team at http://bit.ly/Phone_Support for further assistance.
    Thanks!
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • I recently updated my operating system to Yosemite and now my HP printer will not print correctly.

    I recently updated my MacBook Pro to Yosemite.  Now my HP printer will not print correctly.  It takes forever to print and then it will not print the document in it's entirety.  I have tried to update the printer driver but there does not seen to be an update for 10.10.2.

    Printers not behaving? Reset them and start from scratch | MacIssues
    OS X- Printer and scanner software available for download
    Mac OS X- How to reset the printing system

  • Cintiq tablet will not work correctly with windows

    I am using photoshop CS6 on a 64 bit windows system and my Cintiq 12 will not function with the pressure sensitivity. any suggestions to correct this?

    Hi. You’ve posted your question in a forum that is for beginners trying to learn the basics of Photoshop.  I'm moving your question to the Photoshop General Discussion forum for specialized attention to your situation.

Maybe you are looking for

  • I'm buying a 4s tomorrow, can i use my old 3gs as an itouch with wifi for my kid?

    I'm buying a 4s tomorrow, but i was wondering if i can use my old 3gs as an itouch with wifi for my son to use?

  • Capturing the JVM heap usage information to a log

    When using weblogic 6.1sp3 the console under monitoring/performance a graph is displayed with the historical JVM heap usage information. Is there any way to capture this information to a log?

  • Debugging a slow firefox

    Lately I have noticed my web connection is really slow. I always use firefox and had assumed the problem to be with my router or ISP. However I just started doing some stuff in parallels, and realised the response of the firefox browser from within w

  • CS6 No file preview?!

    Hey everyone, there is no preview in CS6 when you open a file! I´m talking about the thumbnail preview when you are selecting a file in the "open file"- menu tab. Where is it??

  • Crazy iPhone 5 Keyboard Glitch- Bright Colored Keyboard?

    So I have had my iPhone 5 for several weeks now and ever since I got it I have noticed this glitch. Everytime I am asked to enter my Apple ID or password it happens. It only happens when I hit the numerical keyboeard. It is fine with the normal qwert