How To Get Example SecurePreferencesFactory to work [message #127505] |
Thu, 12 March 2009 17:14  |
Eclipse User |
|
|
|
Hi,
I tried running the following code which will eventually get put into a
plugin.
ISecurePreferences root = SecurePreferencesFactory.getDefault();
ISecurePreferences node = root.node("cvs/eclipse.org");
node.put("password", myPassword, true);
But when I run it I just get a stack trace that appears as follows:
Exception in thread "main" java.lang.NullPointerException
at
org.eclipse.equinox.internal.security.storage.SecurePreferen cesMapper.open(SecurePreferencesMapper.java:67)
at
org.eclipse.equinox.internal.security.storage.SecurePreferen cesMapper.getDefault(SecurePreferencesMapper.java:44)
at
org.eclipse.equinox.security.storage.SecurePreferencesFactor y.getDefault(SecurePreferencesFactory.java:50)
at
com.nuwavetech.vfs.security.PreferencesManager.main(Preferen cesManager.java:13)
I tried looking into if anyone else had this issue or for a more complete
example and came across this:
http://dev.eclipse.org/mhonarc/lists/equinox-dev/msg05026.ht ml
but that didn't seem to answer the question, at least when it came to
pointing out an actual working example. Any ideas? Thanks,
Andy
|
|
|
|
Re: How To Get Example SecurePreferencesFactory to work [message #127574 is a reply to message #127505] |
Fri, 13 March 2009 17:10   |
Eclipse User |
|
|
|
Hi Andy,
That is an odd place to get an NPE. From the code, the only way to get that
would be to remove "Lazy Activation" flag from the
"org.eclipse.equinox.security" bundle or to set launch configuration to
disable its lazy activation.
If you have this bundle checked out in your workspace, check that its
manifest.mf file has "Bundle-ActivationPolicy: lazy". If you modified launch
configuration from the default, it is worth checking that too.
If problem persist, be sure to open a bug against Equinox/Security with a
sample of your code and launch configuration that reproduces the problem.
Sincerely,
Oleg Besedin
"Andy " <andrewnbenjamin@hotmail.com> wrote in message
news:bc3066e55b372d3a379f4308b853f289$1@www.eclipse.org...
> Hi,
>
> I tried running the following code which will eventually get put into a
> plugin.
> ISecurePreferences root = SecurePreferencesFactory.getDefault();
> ISecurePreferences node = root.node("cvs/eclipse.org");
> node.put("password", myPassword, true);
>
>
> But when I run it I just get a stack trace that appears as follows:
>
> Exception in thread "main" java.lang.NullPointerException
>
>
>
> at
> org.eclipse.equinox.internal.security.storage.SecurePreferen cesMapper.open(SecurePreferencesMapper.java:67)
>
> at
> org.eclipse.equinox.internal.security.storage.SecurePreferen cesMapper.getDefault(SecurePreferencesMapper.java:44)
>
> at
> org.eclipse.equinox.security.storage.SecurePreferencesFactor y.getDefault(SecurePreferencesFactory.java:50)
>
> at
> com.nuwavetech.vfs.security.PreferencesManager.main(Preferen cesManager.java:13)
>
>
>
>
> I tried looking into if anyone else had this issue or for a more complete
> example and came across this:
>
> http://dev.eclipse.org/mhonarc/lists/equinox-dev/msg05026.ht ml
>
> but that didn't seem to answer the question, at least when it came to
> pointing out an actual working example. Any ideas? Thanks,
>
> Andy
>
|
|
|
|
|
|
Re: How To Get Example SecurePreferencesFactory to work [message #127694 is a reply to message #127650] |
Wed, 18 March 2009 13:18  |
Eclipse User |
|
|
|
I thought I would post the solution to the problem I ran into above. The
issue above has to do with importing the jar files twice. Make sure that
the jar files are only referenced from within the Dependencies\Imported
Packages in the plugin.xml and not also referenced from if you right mouse
on the project root and select Java build path and add the jars again
under the libraries path. The plug-in dependencies node should already
have the jar file available for you in the project.
|
|
|
Powered by
FUDForum. Page generated in 0.28082 seconds