<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261520</link>
    <title>MATLAB Central Newsreader - Java Exception on Printing?</title>
    <description>Feed for thread: Java Exception on Printing?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 24 Sep 2009 02:09:19 -0400</pubDate>
      <title>Java Exception on Printing?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261520#682224</link>
      <author>Rebecca </author>
      <description>I'm trying to print out my code, and pressing the print button in the Editor or choosing File/Print seems to cause a Java exception to be thrown. How do I fix this so I can print from MatLab?&lt;br&gt;
&lt;br&gt;
I'm running 2009a Student Version on Mac OS X 10.6.1&lt;br&gt;
&lt;br&gt;
This is the specific error message that is displayed in the cmd window:&lt;br&gt;
&lt;br&gt;
Exception in thread &quot;AWT-EventQueue-0&quot; java.lang.NullPointerException&lt;br&gt;
	at com.mathworks.widgets.text.print.PrintSettings.getLastPrintRequestAttributes(PrintSettings.java:280)&lt;br&gt;
	at com.mathworks.widgets.SyntaxTextPaneBase.printDocument(SyntaxTextPaneBase.java:2031)&lt;br&gt;
	at com.mathworks.widgets.SyntaxTextPaneMultiView.printDocument(SyntaxTextPaneMultiView.java:750)&lt;br&gt;
	at com.mathworks.mde.editor.EditorView.doPrint(EditorView.java:1284)&lt;br&gt;
	at com.mathworks.mde.editor.EditorView.access$2300(EditorView.java:92)&lt;br&gt;
	at com.mathworks.mde.editor.EditorView$8.update(EditorView.java:775)&lt;br&gt;
	at com.mathworks.mde.editor.EditorAction$ObservableAction.actionPerformed(EditorAction.java:52)&lt;br&gt;
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)&lt;br&gt;
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)&lt;br&gt;
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)&lt;br&gt;
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)&lt;br&gt;
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)&lt;br&gt;
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)&lt;br&gt;
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)&lt;br&gt;
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)&lt;br&gt;
	at java.awt.Component.processMouseEvent(Component.java:6348)&lt;br&gt;
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)&lt;br&gt;
	at com.mathworks.mwswing.MJButton.processMouseEvent(MJButton.java:294)&lt;br&gt;
	at java.awt.Component.processEvent(Component.java:6113)&lt;br&gt;
	at java.awt.Container.processEvent(Container.java:2085)&lt;br&gt;
	at java.awt.Component.dispatchEventImpl(Component.java:4714)&lt;br&gt;
	at java.awt.Container.dispatchEventImpl(Container.java:2143)&lt;br&gt;
	at java.awt.Component.dispatchEvent(Component.java:4544)&lt;br&gt;
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4618)&lt;br&gt;
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)&lt;br&gt;
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)&lt;br&gt;
	at java.awt.Container.dispatchEventImpl(Container.java:2129)&lt;br&gt;
	at java.awt.Window.dispatchEventImpl(Window.java:2475)&lt;br&gt;
	at java.awt.Component.dispatchEvent(Component.java:4544)&lt;br&gt;
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)&lt;br&gt;
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)&lt;br&gt;
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)&lt;br&gt;
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)&lt;br&gt;
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)&lt;br&gt;
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)&lt;br&gt;
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)</description>
    </item>
    <item>
      <pubDate>Thu, 24 Sep 2009 02:21:57 -0400</pubDate>
      <title>Re: Java Exception on Printing?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261520#682227</link>
      <author>Richard Quist</author>
      <description>Rebecca wrote:&lt;br&gt;
&amp;gt; I'm trying to print out my code, and pressing the print button in the Editor or choosing File/Print seems to cause a Java exception to be thrown. How do I fix this so I can print from MatLab?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I'm running 2009a Student Version on Mac OS X 10.6.1&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; This is the specific error message that is displayed in the cmd window:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Exception in thread &quot;AWT-EventQueue-0&quot; java.lang.NullPointerException&lt;br&gt;
&amp;gt; 	at com.mathworks.widgets.text.print.PrintSettings.getLastPrintRequestAttributes(PrintSettings.java:280)&lt;br&gt;
&amp;gt; 	at com.mathworks.widgets.SyntaxTextPaneBase.printDocument(SyntaxTextPaneBase.java:2031)&lt;br&gt;
&amp;gt; 	at com.mathworks.widgets.SyntaxTextPaneMultiView.printDocument(SyntaxTextPaneMultiView.java:750)&lt;br&gt;
&amp;gt; 	at com.mathworks.mde.editor.EditorView.doPrint(EditorView.java:1284)&lt;br&gt;
&amp;gt; 	at com.mathworks.mde.editor.EditorView.access$2300(EditorView.java:92)&lt;br&gt;
&amp;gt; 	at com.mathworks.mde.editor.EditorView$8.update(EditorView.java:775)&lt;br&gt;
&amp;gt; 	at com.mathworks.mde.editor.EditorAction$ObservableAction.actionPerformed(EditorAction.java:52)&lt;br&gt;
&amp;gt; 	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)&lt;br&gt;
&amp;gt; 	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)&lt;br&gt;
&amp;gt; 	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)&lt;br&gt;
&amp;gt; 	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)&lt;br&gt;
&amp;gt; 	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)&lt;br&gt;
&amp;gt; 	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)&lt;br&gt;
&amp;gt; 	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)&lt;br&gt;
&amp;gt; 	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)&lt;br&gt;
&amp;gt; 	at java.awt.Component.processMouseEvent(Component.java:6348)&lt;br&gt;
&amp;gt; 	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)&lt;br&gt;
&amp;gt; 	at com.mathworks.mwswing.MJButton.processMouseEvent(MJButton.java:294)&lt;br&gt;
&amp;gt; 	at java.awt.Component.processEvent(Component.java:6113)&lt;br&gt;
&amp;gt; 	at java.awt.Container.processEvent(Container.java:2085)&lt;br&gt;
&amp;gt; 	at java.awt.Component.dispatchEventImpl(Component.java:4714)&lt;br&gt;
&amp;gt; 	at java.awt.Container.dispatchEventImpl(Container.java:2143)&lt;br&gt;
&amp;gt; 	at java.awt.Component.dispatchEvent(Component.java:4544)&lt;br&gt;
&amp;gt; 	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4618)&lt;br&gt;
&amp;gt; 	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)&lt;br&gt;
&amp;gt; 	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)&lt;br&gt;
&amp;gt; 	at java.awt.Container.dispatchEventImpl(Container.java:2129)&lt;br&gt;
&amp;gt; 	at java.awt.Window.dispatchEventImpl(Window.java:2475)&lt;br&gt;
&amp;gt; 	at java.awt.Component.dispatchEvent(Component.java:4544)&lt;br&gt;
&amp;gt; 	at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)&lt;br&gt;
&amp;gt; 	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)&lt;br&gt;
&amp;gt; 	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)&lt;br&gt;
&amp;gt; 	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)&lt;br&gt;
&amp;gt; 	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)&lt;br&gt;
&amp;gt; 	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)&lt;br&gt;
&amp;gt; 	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)&lt;br&gt;
That sounds like this issue: &lt;a href=&quot;http://www.mathworks.com/support/bugreports/337376&quot;&gt;http://www.mathworks.com/support/bugreports/337376&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
There's a possible workaround mentioned near the bottom of that page&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
&lt;br&gt;
Richard Quist&lt;br&gt;
Software Developer&lt;br&gt;
The MathWorks, Inc.</description>
    </item>
    <item>
      <pubDate>Sun, 04 Oct 2009 15:36:01 -0400</pubDate>
      <title>Re: Java Exception on Printing?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261520#684550</link>
      <author>Mehmet </author>
      <description>Richard Quist &amp;lt;rquist_nospam@mathworks.com&amp;gt; wrote in message &lt;br&gt;
&lt;br&gt;
&amp;gt; That sounds like this issue: &lt;a href=&quot;http://www.mathworks.com/support/bugreports/337376&quot;&gt;http://www.mathworks.com/support/bugreports/337376&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; There's a possible workaround mentioned near the bottom of that page&lt;br&gt;
&lt;br&gt;
I don't think it's the same issue. I don't have any network printers, and I get the same message as Rebecca, not the one mentioned in the bug report. I also have the same version as Rebecca, and also on snow leopard.</description>
    </item>
    <item>
      <pubDate>Thu, 08 Oct 2009 19:52:02 -0400</pubDate>
      <title>Re: Java Exception on Printing?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261520#685776</link>
      <author>Rebecca </author>
      <description>Richard Quist &amp;lt;rquist_nospam@mathworks.com&amp;gt; wrote in message &amp;lt;h9el45$gbg$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Rebecca wrote:&lt;br&gt;
&amp;lt;....&amp;gt;&lt;br&gt;
&amp;gt; That sounds like this issue: &lt;a href=&quot;http://www.mathworks.com/support/bugreports/337376&quot;&gt;http://www.mathworks.com/support/bugreports/337376&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; There's a possible workaround mentioned near the bottom of that page&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Richard Quist&lt;br&gt;
&amp;gt; Software Developer&lt;br&gt;
&amp;gt; The MathWorks, Inc.&lt;br&gt;
&lt;br&gt;
Thanks Richard, but I don't think that's it. I'm trying to print to a printer plugged into my computer via USB. It's not a network printer at all.&lt;br&gt;
&lt;br&gt;
I've also tried the various other suggestions for dealing with (what seem to me to be) random Java exceptions - I changed the Java preferences to favour the 32-bit Java VM. I'm at a loss of what to do next though.&lt;br&gt;
&lt;br&gt;
-R</description>
    </item>
    <item>
      <pubDate>Fri, 09 Oct 2009 11:48:49 -0400</pubDate>
      <title>Re: Java Exception on Printing?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261520#685928</link>
      <author>Richard Quist</author>
      <description>Rebecca wrote:&lt;br&gt;
&amp;gt; Richard Quist &amp;lt;rquist_nospam@mathworks.com&amp;gt; wrote in message &amp;lt;h9el45$gbg$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; Rebecca wrote:&lt;br&gt;
&amp;gt; &amp;lt;....&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; That sounds like this issue: &lt;a href=&quot;http://www.mathworks.com/support/bugreports/337376&quot;&gt;http://www.mathworks.com/support/bugreports/337376&lt;/a&gt;&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; There's a possible workaround mentioned near the bottom of that page&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; -- &lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Richard Quist&lt;br&gt;
&amp;gt;&amp;gt; Software Developer&lt;br&gt;
&amp;gt;&amp;gt; The MathWorks, Inc.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks Richard, but I don't think that's it. I'm trying to print to a printer plugged into my computer via USB. It's not a network printer at all.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I've also tried the various other suggestions for dealing with (what seem to me to be) random Java exceptions - I changed the Java preferences to favour the 32-bit Java VM. I'm at a loss of what to do next though.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -R&lt;br&gt;
I suggest you contact Customer Support. Sometimes the version of Java in use &lt;br&gt;
and the version of CUPS (Common Unix Printing Service) that supports printing &lt;br&gt;
on OS X. They may be able to help identify what's going on.&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
&lt;br&gt;
Richard Quist&lt;br&gt;
Software Developer&lt;br&gt;
The MathWorks, Inc.</description>
    </item>
    <item>
      <pubDate>Mon, 19 Oct 2009 20:57:01 -0400</pubDate>
      <title>Re: Java Exception on Printing?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261520#688215</link>
      <author>Eric </author>
      <description>&quot;Rebecca &quot; &amp;lt;rbemros@siue.edu&amp;gt; wrote in message &amp;lt;h9ekcf$gf8$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I'm trying to print out my code, and pressing the print button in the Editor or choosing File/Print seems to cause a Java exception to be thrown. How do I fix this so I can print from MatLab?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I'm running 2009a Student Version on Mac OS X 10.6.1&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
I have the same configuration and problem.  It's not a fix, but if you need to get the stuff printed, you can use the Publish feature to get printable HTML or PDF output.</description>
    </item>
    <item>
      <pubDate>Thu, 26 Aug 2010 21:33:22 -0400</pubDate>
      <title>Re: Java Exception on Printing? (snow leopard)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261520#774764</link>
      <author>Eduard </author>
      <description>&quot;Rebecca &quot; &amp;lt;rbemros@siue.edu&amp;gt; wrote in message &amp;lt;h9ekcf$gf8$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I'm trying to print out my code, and pressing the print button in the Editor or choosing File/Print seems to cause a Java exception to be thrown. How do I fix this so I can print from MatLab?&lt;br&gt;
&lt;br&gt;
First create a Postscript printer:&lt;br&gt;
1. Go to system preferences -&amp;gt; print &amp; fax&lt;br&gt;
2. Add a printer by clicking the + &lt;br&gt;
3. choose IP (that is the Globe depicted on top)&lt;br&gt;
4. first line &quot;Protocol&quot; select Line Printer Daemon&lt;br&gt;
5. Address: localhost&lt;br&gt;
6. Queue: leave empty&lt;br&gt;
7. Name: e.g. Matlab (or whatever)&lt;br&gt;
8. Location: leave empty&lt;br&gt;
9. Print Using: select Postscript Printer&lt;br&gt;
10. click Add&lt;br&gt;
&lt;br&gt;
You now have a postscript printer. Set it as default (so Matlab wants to print to it).&lt;br&gt;
A. When you print from matlab it will pop up a print dialog, choose &quot;print to file&quot;. So now you can leave the file some place where you can find it.&lt;br&gt;
B. This will produce a .ps (postscript) file.&lt;br&gt;
C. Go to the place where you saved the file, and double click. This will open the file in Preview (actually it will convert it to PDF first).&lt;br&gt;
D. From Preview you can print the file by selecting your prefered printer.&lt;br&gt;
&lt;br&gt;
(Mail me if this is not detailed enough)&lt;br&gt;
Eduard.</description>
    </item>
    <item>
      <pubDate>Sat, 23 Oct 2010 01:57:04 -0400</pubDate>
      <title>Re: Java Exception on Printing?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261520#790037</link>
      <author>Stefan </author>
      <description>&quot;Rebecca &quot; &amp;lt;rbemros@siue.edu&amp;gt; wrote in message &amp;lt;h9ekcf$gf8$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I'm trying to print out my code, and pressing the print button in the Editor or choosing File/Print seems to cause a Java exception to be thrown. How do I fix this so I can print from MatLab?&lt;br&gt;
&lt;br&gt;
Hi, &lt;br&gt;
&lt;br&gt;
I had the same problem today and I found its because Matlab tries to use the printer name as the queue name, which are usually not the same on Mac OS. Setting the printer name to its queue name seems to fix it for me under Snow Leopard.&lt;br&gt;
&lt;br&gt;
To try that yourself, open Mac OS' System Preferences, select &quot;Print &amp; Fax&quot;, select your printer, click &quot;Option &amp; Supplies...&quot;, change the name in the name field to that display in the &quot;Queue Name&quot; line, click &quot;OK&quot; (, close System Preferences).&lt;br&gt;
&lt;br&gt;
You might have to quit and re-open Matlab to fetch the made changes.&lt;br&gt;
&lt;br&gt;
Best&lt;br&gt;
Stefan&lt;br&gt;
&lt;br&gt;
PS: Alternatively one might find the bug (probably in /Applications/MATLAB_R2010aSV.app/toolbox/matlab/graphics/printdlg.m) and fix it. </description>
    </item>
  </channel>
</rss>

