Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#13302 closed defect (fixed)

Print plugin crashes once "custom size" is set

Reported by: skyper Owned by: Don-vip
Priority: normal Milestone:
Component: Plugin print Version:
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

  1. open printing dialog
  2. set the paper size to "custom size"
  3. close the dialog with this setting
  4. try to open printing dialog again

What is the expected result?

printing dialog opens

What happens instead?

IllegalArgumentException

Please provide any additional information below. Attach a screenshot if possible.

Seems to be no possibility to change the setting back to default within the preferences.

URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2016-08-09 00:25:24 +0200 (Tue, 09 Aug 2016)
Build-Date:2016-08-09 01:35:26
Revision:10770
Relative:URL: ^/trunk

Identification: JOSM/1.5 (10770 en) Linux Debian GNU/Linux 8.5 (jessie)
Memory Usage: 586 MB / 882 MB (108 MB allocated, but free)
Java version: 1.8.0_91-8u91-b14-1~bpo8+1-b14, Oracle Corporation, OpenJDK 64-Bit Server VM
Java package: openjdk-8-jre:amd64-8u91-b14-1~bpo8+1
Java ATK Wrapper package: libatk-wrapper-java:all-0.30.5-1
Program arguments: [--language=en]
Dataset consistency test: No problems found

Plugins:
+ conflation (0.2.0)
+ jts (32539)
+ print (32502)
+ undelete (32584)
+ utilsplugin2 (32725)

Map paint styles:
+ https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1

Last errors/warnings:
- W: JOSM expected to find primitive [way -10474] in dataset but it is not there. Please report this at https://josm.openstreetmap.de. This is not a critical error, it should be safe to continue in your work.
- E: java.lang.Exception
- W: JOSM expected to find primitive [way -10474] in dataset but it is not there. Please report this at https://josm.openstreetmap.de. This is not a critical error, it should be safe to continue in your work.
- E: java.lang.Exception
- W: JOSM expected to find primitive [way -10750] in dataset but it is not there. Please report this at https://josm.openstreetmap.de. This is not a critical error, it should be safe to continue in your work.
- E: java.lang.Exception
- W: JOSM expected to find primitive [way -10750] in dataset but it is not there. Please report this at https://josm.openstreetmap.de. This is not a critical error, it should be safe to continue in your work.
- E: java.lang.Exception
- W: Print request attribute not supported: page-ranges: class javax.print.attribute.standard.PageRanges - 1-2147483647
- E: java.lang.IllegalArgumentException: Invalid enum: class sun.print.CustomMediaSizeName - 82


=== REPORTED CRASH DATA ===
BugReportExceptionHandler$BugReporterThread#askForBugReport:
No data collected.

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (17) of main
java.lang.IllegalArgumentException: Invalid enum: class sun.print.CustomMediaSizeName - 82
	at org.openstreetmap.josm.plugins.print.PrintDialog.unmarshallPrintSetting(PrintDialog.java:534)
	at org.openstreetmap.josm.plugins.print.PrintDialog.loadPrintSettings(PrintDialog.java:556)
	at org.openstreetmap.josm.plugins.print.PrintDialog.<init>(PrintDialog.java:151)
	at org.openstreetmap.josm.plugins.print.PrintAction.run(PrintAction.java:70)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Attachments (0)

Change History (6)

comment:1 Changed 3 years ago by Don-vip

Owner: changed from team to skyper
Status: newneedinfo

I don't have the value "Custom size" on my system. After you select this option and quit JOSM, can you please share the value of the preference entries beginning by "print.settings."?

comment:2 Changed 3 years ago by Don-vip

I've published a potential fix in [o33118:33119] (not really sure it works). Can you please test?

comment:3 in reply to:  2 ; Changed 3 years ago by skyper

Replying to Don-vip:

I've published a potential fix in [o33118:33119] (not really sure it works). Can you please test?

Does not crash anymore and "custom size" is set. Only minor issue is that the setting is not remembered in the printer setting dialog and it is always back to default (A4).

Replying to Don-vip:

I don't have the value "Custom size" on my system.

Does depend on the printer and the driver.

After you select this option and quit JOSM, can you please share the value of the preference entries beginning by "print.settings."?

Here you go:

  <tag key='print.map-scale' value='2000'/>
  <tag key='print.preview.enabled' value='true'/>
  <tag key='print.resolution.dpi' value='600'/>
  <lists key='print.settings.request-attributes'>
    <list>
      <entry value='javax.print.attribute.standard.Copies'/>
      <entry value='javax.print.attribute.standard.Copies'/>
      <entry value='javax.print.attribute.IntegerSyntax'/>
      <entry value='1'/>
    </list>
    <list>
      <entry value='javax.print.attribute.standard.Media'/>
      <entry value='sun.print.CustomMediaSizeName'/>
      <entry value='javax.print.attribute.EnumSyntax'/>
      <entry value='342'/>
    </list>
    <list>
      <entry value='javax.print.attribute.standard.OrientationRequested'/>
      <entry value='javax.print.attribute.standard.OrientationRequested'/>
      <entry value='javax.print.attribute.EnumSyntax'/>
      <entry value='4'/>
    </list>
    <list>
      <entry value='javax.print.attribute.standard.Chromaticity'/>
      <entry value='javax.print.attribute.standard.Chromaticity'/>
      <entry value='javax.print.attribute.EnumSyntax'/>
      <entry value='1'/>
    </list>
  </lists>
  <lists key='print.settings.service-attributes'>
    <list>
      <entry value='javax.print.attribute.standard.PrinterName'/>
      <entry value='javax.print.attribute.standard.PrinterName'/>
      <entry value='javax.print.attribute.TextSyntax'/>
      <entry value='HP_LaserJet_4100_Series'/>
    </list>
  </lists>
Last edited 3 years ago by Don-vip (previous) (diff)

comment:4 Changed 3 years ago by skyper

Owner: changed from skyper to Don-vip
Status: needinfonew

comment:5 in reply to:  3 ; Changed 3 years ago by Don-vip

Resolution: fixed
Status: newclosed

Replying to skyper:

Does not crash anymore and "custom size" is set. Only minor issue is that the setting is not remembered in the printer setting dialog and it is always back to default (A4).

If the custom size is displayed in the initial dialog but not in the printer setting dialog, that's a java/driver issue, I can't do anything about it.

Closing the ticket as fixed then.

comment:6 in reply to:  5 Changed 3 years ago by skyper

Replying to Don-vip:

Replying to skyper:

Does not crash anymore and "custom size" is set. Only minor issue is that the setting is not remembered in the printer setting dialog and it is always back to default (A4).

If the custom size is displayed in the initial dialog but not in the printer setting dialog, that's a java/driver issue, I can't do anything about it.

No, I meant once I have set it to "custom (size)" in the printer setting dialog and open this dialog again it is back to default where when I set it e.g. to "A5" it is remembered if I reopen the dialog. But this is a minor clinch.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.