[security] NullPointerException when calling ISecurePreferences.get() from splash [message #534034] |
Mon, 17 May 2010 19:10 |
Christophe Fondacci Messages: 95 Registered: July 2009 Location: Paris |
Member |
|
|
Hello all,
I am facing a strange error.
First of all, it happened to work before... but it is not working anymore.
Here is what I am doing :
* Got an RCP app
* The product start with a splash screen (no workbench initialized)
* In this splash, I need to go in the ISecurePreferences to fetch a password from there
Here is the code which raise the problem :
final ISecurePreferences root = SecurePreferencesFactory.getDefault();
final ISecurePreferences connectionNode = root.node("repository/connection"); //$NON-NLS-1$
String password = null;
try {
password = connectionNode.get(DesignerCoreConstants.REP_PASSWORD_PROPERTY, null);
} catch (StorageException e) {
throw new ErrorException(CoreMessages
.getString("connection.editor.passwordStorageError"), e); //$NON-NLS-1$
}
In my context, the section connectionNode.get(...) raises a null pointer exception in Workbench.getWorkbenchWindows(). Indeed, the workbench is not yet initialized, but the JavaEncryption class seems to use UICallbacks to synchronize some calls in the UI thread...
You can find below the complete stack trace of the error...
The important thing is the exact same code worked before. It does not work anymore since I removed my workspace folder (and so I am now working on a brand new one).
I am working on MacOSX with SWT Cocoa 64 bits. Equinox security is release 1.0.100.v20090520-1800. The same code running on windows 64 bits platform works well, even with the same workspace manipulation
Tried antoher thing : removed the workspace, removed the .eclipse and .eclipse_keyring in my home dir (by the way, they don't come back). Now got a very similar problem on the put method... The stack trace below corresponds to this put() call.
I am not able to restore a working configuration anymore. I am out of ideas. Is there anyone who can help me with this problem ? Anything I am doing wrong ?
Thank you very much for any help,
Christophe.
http://www.nextep-softwares.com
Caused by: java.lang.NullPointerException
at org.eclipse.ui.internal.Workbench.getWorkbenchWindows(Workbench.java:1270)
at org.eclipse.ui.internal.progress.ProgressManagerUtil.getNonModalShell(ProgressManagerUtil.java:356)
at org.eclipse.ui.internal.progress.ProgressManagerUtil.getDefaultParent(ProgressManagerUtil.java:343)
at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:956)
at org.eclipse.equinox.internal.security.ui.storage.UICallbackProvider$2.run(UICallbackProvider.java:95)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:179)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:3945)
at org.eclipse.equinox.internal.security.ui.storage.UICallbackProvider.execute(UICallbackProvider.java:90)
at org.eclipse.equinox.internal.security.storage.JavaEncryption.init(JavaEncryption.java:88)
at org.eclipse.equinox.internal.security.storage.JavaEncryption.encrypt(JavaEncryption.java:131)
at org.eclipse.equinox.internal.security.storage.SecurePreferencesRoot.getModulePassword(SecurePreferencesRoot.java:260)
at org.eclipse.equinox.internal.security.storage.SecurePreferencesRoot.getPassword(SecurePreferencesRoot.java:219)
at org.eclipse.equinox.internal.security.storage.SecurePreferences.put(SecurePreferences.java:224)
at org.eclipse.equinox.internal.security.storage.SecurePreferencesWrapper.put(SecurePreferencesWrapper.java:110)
at com.nextep.designer.services.impl.RepositoryService.setRepositoryConnection(RepositoryService.java:231)
... 28 more
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03156 seconds