KB Article #178573

NullPointerException when exporting certificate + key from Policy Studio

Problem

After creating a new certificate in Policy Studio, you attempt to export certificate + key and you see an error like the following:


java.lang.NullPointerException
at com.vordel.client.manager.CertificatesGroup.getX509CertificateChain(CertificatesGroup.java:129)
at com.vordel.client.manager.CertificatesGroup.getX509CertificateChainAsArray(CertificatesGroup.java:122)
at com.vordel.client.manager.filter.cert.CertificateEditorDialog.exportPublicAndPrivateKey(CertificateEditorDialog.java:714)
at com.vordel.client.manager.filter.cert.CertificateEditorDialog.widgetSelected(CertificateEditorDialog.java:933)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at com.vordel.client.manager.filter.cert.CertPanel.createCert(CertPanel.java:358)
at com.vordel.client.manager.filter.cert.CertPanel.buttonPressed(CertPanel.java:403)
at com.vordel.client.manager.filter.cert.CertPanel.access$5(CertPanel.java:399)
at com.vordel.client.manager.filter.cert.CertPanel$10.widgetSelected(CertPanel.java:287)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.vordel.client.gui.policystudio.Application.start(Application.java:39)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)


Resolution


This only happens if you try to export immediately after creating the certificate. Just click ok to finish creating the certificate, then double click the certificate to open it again and the export certificate + key option will work properly.