Announcement Announcement Module
Collapse
No announcement yet.
ERROR JKSKeyManager:120 - Error initializing key store Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ERROR JKSKeyManager:120 - Error initializing key store

    After successfully building, deploying and playing with the spring-security-saml2-sample I am trying to replicate it in my webapp. I am using a copy of the same JKS keystore as the one in spring-security-saml2-sample. Oddly when my app loads in Glassfish 3.2.2.2 web server I get the following exception:

    Code:
    INFO: 10:14:40,948 ERROR JKSKeyManager:120 - Error initializing key store
    java.io.IOException: Invalid keystore format
    	at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:650)
    	at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:55)
    	at java.security.KeyStore.load(KeyStore.java:1214)
    	at org.springframework.security.saml.key.JKSKeyManager.initialize(JKSKeyManager.java:117)
    	at org.springframework.security.saml.key.JKSKeyManager.<init>(JKSKeyManager.java:79)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
    	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:121)
    Some notes and observations follow...

    1. The keystore shows no diffs with the one in spring-security-saml2-sample (as expected)

    2. If I try "keytool -list" command on my keystore it works fine and dumps the certs in it.

    3. I am using spring-framework modules from 3.2.2.RELEASE and spring-security 3.1.4.RELEASE. Can any one say with certainty that these works with spring-security-saml2-core? UPDATE: Tried with 3.1.2.RELEASE version of spring core and spring security. Nothing changed and I am still getting the same error.

    4. The spring-security-saml2-sample works just fine and does not see the same error

    5. I am using JDK 1.7.0_21

    I am unable to debug this in Netbeans 7.3 IDE further because I am still unable to build spring core from git source due to a build issue discussed elsewhere.

    Any suggestions on what I could try? Thanks.
    Last edited by farrukh_najmi; May 8th, 2013, 11:24 AM.

  • #2
    [Solved] ERROR JKSKeyManager:120 - Error initializing key store

    The problem was that my jks file was being filtered by maven. The following change to the pom.xml file for my project fixed the problem:

    Code:
    ...
        <build>
            <resources>
                <resource>
                    <directory>src/main/resources</directory>
                    <filtering>true</filtering>
                    <excludes>
                        <exclude>**/*.jks</exclude>
                    </excludes>
                </resource>
                <resource>
                    <directory>src/main/resources</directory>
                    <filtering>false</filtering>
                    <includes>
                        <include>**/*.jks</include>
                    </includes>
                </resource>
            </resources>
    ...

    Comment

    Working...
    X