#11169 closed defect (fixed)
NPE trying to save as .osm.pbf
Reported by: | zeke76 | Owned by: | Don-vip |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Plugin pbf | Version: | |
Keywords: | template_report | Cc: | fernandodunha@…, GerdP |
Description
What steps will reproduce the problem?
- Open an osm file
- From the file menu, select Save As
- From the Files of type dropdown, select OSM Server Files pbf compressed(*.osm.pbf)
- Provide a name and click save.
What is the expected result?
I was hoping for the file to save as an .osm.pbf file.
What happens instead?
- Message Box - Update Plugins - Attached
- Select Update Plugin
- Message Box - Unexpected Exception - Attached
Please provide any additional information below. Attach a screenshot if possible.
Repository Root: http://josm.openstreetmap.de/svn Build-Date: 2015-02-01 02:33:54 Last Changed Author: Don-vip Revision: 7995 Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Relative URL: ^/trunk URL: http://josm.openstreetmap.de/svn/trunk Last Changed Date: 2015-01-31 15:17:59 +0100 (Sat, 31 Jan 2015) Last Changed Rev: 7995 Identification: JOSM/1.5 (7995 en) Windows 7 64-Bit Memory Usage: 411 MB / 910 MB (165 MB allocated, but free) Java version: 1.7.0_72, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Dataset consistency test: No problems found Plugins: - LaneConnector (UNKNOWN) - SimplifyArea (30892) - buildings_tools (30892) - pbf (31010) - reltoolbox (30892) - utilsplugin2 (30892) Last errors/warnings: - E: java.lang.NullPointerException java.lang.NullPointerException at crosby.binary.StringTable.getIndex(StringTable.java:54) at org.openstreetmap.josm.plugins.pbf.io.PbfWriter$PbfSerializer$Prim.serializeMetadataDense(PbfWriter.java:109) at org.openstreetmap.josm.plugins.pbf.io.PbfWriter$PbfSerializer$NodeGroup.serializeDense(PbfWriter.java:171) at org.openstreetmap.josm.plugins.pbf.io.PbfWriter$PbfSerializer$NodeGroup.serialize(PbfWriter.java:146) at crosby.binary.BinarySerializer.processBatch(BinarySerializer.java:121) at org.openstreetmap.josm.plugins.pbf.io.PbfWriter$PbfSerializer$Processor.checkLimit(PbfWriter.java:349) at org.openstreetmap.josm.plugins.pbf.io.PbfWriter$PbfSerializer$Processor.processNode(PbfWriter.java:360) at org.openstreetmap.josm.plugins.pbf.io.PbfWriter$PbfSerializer.process(PbfWriter.java:452) at org.openstreetmap.josm.plugins.pbf.io.PbfWriter.writeData(PbfWriter.java:478) at org.openstreetmap.josm.plugins.pbf.io.PbfWriter.writeLayer(PbfWriter.java:474) at org.openstreetmap.josm.plugins.pbf.io.PbfExporter.doSave(PbfExporter.java:32) at org.openstreetmap.josm.io.OsmExporter.save(OsmExporter.java:92) at org.openstreetmap.josm.io.OsmExporter.exportData(OsmExporter.java:67) at org.openstreetmap.josm.io.OsmExporter.exportData(OsmExporter.java:54) at org.openstreetmap.josm.actions.SaveActionBase.doInternalSave(SaveActionBase.java:84) at org.openstreetmap.josm.actions.SaveActionBase.doSave(SaveActionBase.java:56) at org.openstreetmap.josm.actions.SaveActionBase.doSave(SaveActionBase.java:46) at org.openstreetmap.josm.actions.SaveActionBase.actionPerformed(SaveActionBase.java:36) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source) at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$200(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Suppressed: java.lang.NullPointerException at crosby.binary.StringTable.getIndex(StringTable.java:54) at org.openstreetmap.josm.plugins.pbf.io.PbfWriter$PbfSerializer$Prim.serializeMetadataDense(PbfWriter.java:109) at org.openstreetmap.josm.plugins.pbf.io.PbfWriter$PbfSerializer$NodeGroup.serializeDense(PbfWriter.java:171) at org.openstreetmap.josm.plugins.pbf.io.PbfWriter$PbfSerializer$NodeGroup.serialize(PbfWriter.java:146) at crosby.binary.BinarySerializer.processBatch(BinarySerializer.java:121) at crosby.binary.BinarySerializer.flush(BinarySerializer.java:96) at crosby.binary.BinarySerializer.close(BinarySerializer.java:101) at org.openstreetmap.josm.plugins.pbf.io.PbfWriter.close(PbfWriter.java:484) at org.openstreetmap.josm.plugins.pbf.io.PbfExporter.doSave(PbfExporter.java:36) ... 46 more
Some environment variables
USER
C:\Users\Jeff\AppData\Roaming\npm\
C:\Users\Jeff\AppData\Local\AutoIt v3\SciTE
%USERPROFILE%\AppData\Local\Temp
%USERPROFILE%\AppData\Local\Temp
SYSTEM
ComSpec - %SystemRoot%\system32\cmd.exe
Path - C:\Program Files\ImageMagick-6.9.0-Q16;
C:\Program Files (x86)\ActiveState Komodo Edit 8\;
C:\Program Files (x86)\AMD APP\bin\x86_64;
C:\Program Files (x86)\AMD APP\bin\x86;
C:\Program Files\Common Files\Microsoft Shared\Windows Live;
C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;
C:\windows\system32;
C:\windows;
C:\windows\System32\Wbem;
C:\windows\System32\WindowsPowerShell\v1.0\;
C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;
C:\Program Files (x86)\Windows Live\Shared;
C:\Python33\;
C:\Windows\system32\gs\gs7.05\bin;
C:\Program Files\Microsoft Windows Performance Toolkit\;
C:\Program Files\nodejs\;
C:\Program Files (x86)\QuickTime\QTSystem\;
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\
PATHEXT - .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PSModulePath - %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\
VS100COMNTOOLS - C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\
Attachments (6)
Change History (20)
by , 9 years ago
Attachment: | Bug Error.PNG added |
---|
comment:3 by , 9 years ago
I was rather thinking to your source .osm file or your exact downloaded area, as I cannot reproduce the bug.
by , 9 years ago
Attachment: | Portsmouth Area.7z added |
---|
comment:4 by , 9 years ago
Hi Vincent,
Yes, that would make more sense. I had to zip the file because it was to large to add as an attachment. The file is for Portsmouth, NH, USA.
A little background, I am using OSM for scenery in an X-Plane flight simulator program. I have a 3rd party app that converts .osm.pbf to a format X-Plane understands. I would like to test changes I am making prior to uploading them. If I can create the .osm.pbf files I can do that on my local machine.
Thank you for the quick response on this. Let me know if you need anything else.
Jeff
comment:6 by , 9 years ago
Cc: | added |
---|---|
Priority: | minor → major |
Summary: | Recieving Errors trying to save as .osm.pbf using the PBF plugin → NPE trying to save as .osm.pbf |
comment:9 by , 8 years ago
I'm getting the same problem with this StringTable class from a different call stack:
java.lang.NullPointerException
at org.openstreetmap.osmosis.osmbinary.StringTable.getIndex(StringTable.java:54)
at crosby.binary.osmosis.OsmosisSerializer$RelationGroup.serialize(OsmosisSerializer.java:323)
at org.openstreetmap.osmosis.osmbinary.BinarySerializer.processBatch(BinarySerializer.java:121)
at crosby.binary.osmosis.OsmosisSerializer.complete(OsmosisSerializer.java:495)
comment:10 by , 8 years ago
Cc: | added |
---|
@Gerd: I have added a unit test for this in [o32862], maybe you know how to quickly solve it?
by , 8 years ago
Attachment: | fix_pbfwriter.patch added |
---|
by , 8 years ago
Attachment: | fix_pbfwriter_v2.patch added |
---|
comment:12 by , 8 years ago
See fix_pbfwriter_v2.patch.
The pbf format doesn't expect incomplete data, so nodes without coordinates, ways without nodes, and relations without
members should be ignored. I am not sure if it makes sense to write new data (with negative ids).
I think pbf format is not meant for this, so maybe the pbf output from JOSM can cause trouble in other programs.
I did not find out what value one should write for a null string, so now an empty string is stored.
comment:13 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thank you! I have applied the patch slightly modified for the comparator stuff, see [o32865:32866].
comment:14 by , 8 years ago
Thanks, I like your changes.
The stream() api is still brand new for me, this was the first time that I used it.
Message Box - Unexpecter Exception