Hi
Possibly a
Wildfly configuration issue, hence posting on this forum.
I am using Apache WSS4J (Web Services Security) through CXF and Spring to sign and encrypt a message request.
The application is deployed in Wildfly.
However, at the start of the sign and encryption process, I am getting the "Invalid keystore format" error.
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:958)
at java.lang.Thread.run(Thread.java:745)
Caused by: 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.apache.ws.security.components.crypto.Merlin.load(Merlin.java:365)
... 30 more
2015-05-18 14:23:33,791 DEBUG org.apache.ws.security.components.crypto.Merlin 369 Invalid keystore format
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.apache.ws.security.components.crypto.Merlin.load(Merlin.java:365)
at org.apache.ws.security.components.crypto.Merlin.loadProperties(Merlin.java:190)
at org.apache.ws.security.components.crypto.Merlin.<init>(Merlin.java:140)
at org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFactory.java:117)
at org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFactory.java:187)
When I looked the source code for sun.security.provider.JavaKeyStore.engineLoad line 650, this what I found
645 int xMagic = dis.readInt();
646 int xVersion = dis.readInt();
647
648 if (xMagic!=MAGIC ||
649 (xVersion!=VERSION_1 && xVersion!=VERSION_2)) {
650 throw new IOException("Invalid keystore format");
651 }
http://www.docjar.com/html/api/sun/security/provider/JavaKeyStore.java.html
where
68 private static final int MAGIC = 0xfeedfeed;
69 private static final int VERSION_1 = 0x01;
70 private static final int VERSION_2 = 0x02
It seems the cause is due to the failure of the check on line 648/649.
Any suggestion as to :-
what this check is all about ?
How I can overcome this ?
Also could this be due to a Wildfly configuration setting that I may have missed out ?
Thank you for your help.
Pete