users@glassfish.java.net

Re: Bug in Glassfish keystore and cacerts handling, can not recover key

From: legolas wood <legolas.w_at_gmail.com>
Date: Sat, 07 Apr 2007 03:11:59 +0430

Thank you for reply.
But it does not solve the problem because i never changed the passwords
before.
It means that when the exception that i said before happend
Keystore password was : changeit
master-password: ???? <I do not know what it is>
And glassfish admin console password was: adminadmin.

As I explained,when I delete the key that i insert myself into he
keystore, it works fine, but when i insert my own key it break and shows
that exception.
I import the key using keytool and delete it using keytool too.


Thanks




Shing Wai Chan wrote:
> The command is
> asadmin change-master-password
> You may need to revert the keystore password to the original one
> before using the above command as they required the master-password to
> be consistent with keystore password.
> Regards,
> Shing Wai Chan
>
> legolas wood wrote:
>> Thanks,
>> Can you tell me how to change the master password?
>> keystore password is changeit and administration console password is
>> adminadmin.
>>
>> I should say that when i delete the key that i insert myself into he
>> keystore, it works fine, but when i insert my own key it bream.
>>
>> Thanks
>>
>>
>> Shing Wai Chan wrote:
>>> The error message seems to indicate that the master password does
>>> not match with the keystore password
>>>
>>> Legolas Woodland wrote:
>>>>
>>>> Hi
>>>> thank you for reading my post
>>>> I think there is a bug in glasfish way of handling keystore and
>>>> cacerts.
>>>>
>>>> as you can see in attached image (which is made using netbeans
>>>> keytool module) I have two keys in my keystore file.
>>>> when i start glassfish it shows an error like:
>>>>
>>>> java.lang.reflect.InvocationTargetException
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>
>>>> at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>
>>>> at java.lang.reflect.Method.invoke(Method.java:585)
>>>> at com.sun.enterprise.server.PELaunch.main(PELaunch.java:272)
>>>> Caused by: java.lang.ExceptionInInitializerError
>>>> at
>>>> com.sun.enterprise.security.SecurityLifecycle.onInitialization(SecurityLifecycle.java:88)
>>>>
>>>> at
>>>> com.sun.enterprise.server.ApplicationServer.onInitialization
>>>> (ApplicationServer.java:240)
>>>> at
>>>> com.sun.enterprise.server.ondemand.OnDemandServer.onInitialization(OnDemandServer.java:93)
>>>>
>>>> at com.sun.enterprise.server.PEMain.run(PEMain.java:316)
>>>> at com.sun.enterprise.server.PEMain.main (PEMain.java:260)
>>>> ... 5 more
>>>> Caused by: java.lang.IllegalStateException:
>>>> java.security.UnrecoverableKeyException: Cannot recover key
>>>> at
>>>> com.sun.enterprise.security.SSLUtils.<clinit>(SSLUtils.java :112)
>>>> ... 10 more
>>>> Caused by: java.security.UnrecoverableKeyException: Cannot recover key
>>>> at
>>>> sun.security.provider.KeyProtector.recover(KeyProtector.java:301)
>>>> at sun.security.provider.JavaKeyStore.engineGetKey
>>>> (JavaKeyStore.java:120)
>>>> at java.security.KeyStore.getKey(KeyStore.java:731)
>>>> at
>>>> com.sun.net.ssl.internal.ssl.SunX509KeyManagerImpl.<init>(SunX509KeyManagerImpl.java:111)
>>>>
>>>> at
>>>> com.sun.net.ssl.internal.ssl.KeyManagerFactoryImpl$SunX509.engineInit
>>>> (KeyManagerFactoryImpl.java:41)
>>>> at
>>>> javax.net.ssl.KeyManagerFactory.init(KeyManagerFactory.java:192)
>>>> at
>>>> com.sun.enterprise.security.SSLUtils.initKeyManagers(SSLUtils.java:303)
>>>>
>>>> at com.sun.enterprise.security.SSLUtils
>>>> .<clinit>(SSLUtils.java:89)
>>>> ... 10 more
>>>>
>>>>
>>>>
>>>> do you know what is problem?
>>>>
>>>>