Thank you,David.
It is very useful. I found the root cause. The ConfiguredSecretKey.ser file should be created by geronimo server itself.
org.apache.geronimo.crypto.ConfiguredEncryption can explain it.


2012/9/14 David Jencks <david_jencks@yahoo.com>
The instructions you point to recommend setting up the gbean as you have done and NOT creating a ConfiguredSecretKey.ser file: one will be created for you on first use based on a secure random number.

If you want to supply your own key for some reason, you should look at the ConfiguredEncryption gbean code to see how the .ser file is generated and do something similar with your key.

hope this helps

david jencks

On Sep 13, 2012, at 7:53 PM, Zhi Xie wrote:

I want to use the Obscuring Passwords feacture in geronimo 3.0-beta-1
Create a ConfiguredSecretKey.ser file in the var\security directory, add a ConfiguredEncryption gbean in the config.xml like this.

"org.apache.geronimo.framework/rmi-naming/3.0-w20120503/car?ServiceModule=org.apache.geronimo.framework/rmi-naming/3.0-w20120503/car,j2eeType=GBean,name=ConfiguredEncryption">
            <attribute name="path">var/security/ConfiguredSecretKey.ser</attribute>
            <reference name="ServerInfo">
                <pattern>
                    <name>ServerInfo</name>
                </pattern>
            </reference>
        </gbean>

But got an exception below. I think I have make a wrong ConfiguredSecretKey.ser. Could anybody know how to create a right one.


2012-09-13 14:39:36,322 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: abstractName="org.apache.geronimo.framework/rmi-naming/3.0-w20120503/car?ServiceModule=org.apache.geronimo.framework/rmi-naming/3.0-w20120503/car,j2eeType=GBean,name=ConfiguredEncryption"
java.io.StreamCorruptedException: invalid stream header: FEEDFEED
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:786)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:283)
at org.apache.geronimo.crypto.ConfiguredEncryption.<init>(ConfiguredEncryption.java:51)
at org.apache.geronimo.system.util.ConfiguredEncryption.<init>(ConfiguredEncryption.java:53)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:44)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:516)
at org.apache.xbean.recipe.ReflectionUtil$ConstructorFactory.create(ReflectionUtil.java:958)
at org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:276)
at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:958)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:271)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:105)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:127)
at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:569)
at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:386)
at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:466)
at org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:225)
at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:710)
at org.apache.geronimo.system.main.EmbeddedDaemon.doStartup(EmbeddedDaemon.java:239)
at org.apache.geronimo.system.main.EmbeddedDaemon.execute(EmbeddedDaemon.java:99)
at org.apache.geronimo.system.osgi.BootActivator$1.execute(BootActivator.java:107)
at org.apache.geronimo.main.Bootstrapper.execute(Bootstrapper.java:68)
at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:65)
at org.apache.geronimo.cli.daemon.DaemonCLI.main(DaemonCLI.java:32)

--
Best Regards
Gary





--
Best Regards
Gary