users@glassfish.java.net

How to reset the master password and keystore password properly...

From: Chris Fleischmann <Chris.Fleischmann_at_Sun.COM>
Date: Mon, 16 Jun 2008 13:55:25 +1000

Howdy folks, I have seemed to stuff things up with my GlassFish v2ur2
installation... I need to know how to reset the Application Server
(GlassFish v2ur2) password properly so that the keystore password starts
working again?

I tried changing the master password using keytool, realising later that
was the wrong way to go about it... I then tried changing the master
password following the article here:
http://weblogs.java.net/blog/kumarjayanti/archive/2007/11/ssl_and_crl_che.html
It seems I can now use the new password to show details of my
certificate, a.k.a:

keytool -list -keystore keystore.jks -storepass <newpassword>

sudo keytool -list -v -keystore
/opt/glassfish/domains/domain1/config/keystore.jks -storepass <new
password>

[sudo] password for chris:

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

Alias name: s1as
Creation date: 16/06/2008
Entry type: PrivateKeyEntry
Certificate chain length: 1

AND:

-list -v -alias s1as -keystore
/opt/glassfish/domains/domain1/config/keystore.jks
Enter keystore password: Alias name: s1as
Creation date: 16/06/2008
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:

Also works...

However when I try to start my server.. I still get the following error :

[#|2008-06-16T03:15:46.355+0000|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=10;_ThreadName=main;_RequestID=0c7e227d-e677-424a-9e74-634b19647435;|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:597)
      at com.sun.enterprise.server.PELaunch.main(PELaunch.java:412)
Caused by: java.lang.ExceptionInInitializerError
      at
com.sun.enterprise.security.SecurityLifecycle.onInitialization(SecurityLifecycle.java:101)

      at
com.sun.enterprise.server.ApplicationServer.onInitialization(ApplicationServer.java:262)

      at
com.sun.enterprise.server.ondemand.OnDemandServer.onInitialization(OnDemandServer.java:101)

      at com.sun.enterprise.server.PEMain.run(PEMain.java:401)
      at com.sun.enterprise.server.PEMain.main(PEMain.java:338)
      ... 5 more
Caused by: java.lang.IllegalStateException: Keystore was tampered with,
or password was incorrect
      at
com.sun.enterprise.security.SecuritySupportImpl.loadStores(SecuritySupportImpl.java:114)

      at
com.sun.enterprise.security.SecuritySupportImpl.initJKS(SecuritySupportImpl.java:82)

      at
com.sun.enterprise.security.SecuritySupportImpl.<init>(SecuritySupportImpl.java:76)

      at
com.sun.enterprise.security.SecuritySupportImpl.<init>(SecuritySupportImpl.java:71)

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
      at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

      at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at java.lang.Class.newInstance0(Class.java:355)
      at java.lang.Class.newInstance(Class.java:308)
      at
com.sun.enterprise.pluggable.PluggableFeatureFactoryBaseImpl.invoke(PluggableFeatureFactoryBaseImpl.java:84)

      at $Proxy0.getSecuritySupport(Unknown Source)
      at
com.sun.enterprise.security.SecurityUtil.getSecuritySupport(SecurityUtil.java:365)

      at com.sun.enterprise.security.SSLUtils.<clinit>(SSLUtils.java:102)
      ... 10 more
|#]