Q: I get an ExceptionInInitializerError when I try to use the seal library
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at dk.sosi.seal.MainTester.class$(MainTester.java:22)
at dk.sosi.seal.MainTester.suite(MainTester.java:23)
at dk.sosi.seal.MainTester.main(MainTester.java:35)
Caused by: dk.sosi.seal.vault.CredentialVaultException: Unable to load PKCS12 file java.io.ByteArrayInputStream@73a34b
at dk.sosi.seal.vault.GenericCredentialVault.loadKeyPairFromPKCS12(GenericCredentialVault.java:279)
at dk.sosi.seal.vault.GenericCredentialVault.setSystemCredentialPair(GenericCredentialVault.java:164)
at dk.sosi.seal.vault.CredentialVaultUtil.getCredentialVault(CredentialVaultUtil.java:227)
at dk.sosi.seal.TestPerformance.<clinit>(TestPerformance.java:60)
... 5 more
Caused by: java.security.NoSuchProviderException: no such provider: BC
at java.security.Security.getEngineClassName(Security.java:601)
at java.security.Security.getImpl(Security.java:1044)
at java.security.KeyStore.getInstance(KeyStore.java:199)
at dk.sosi.seal.vault.GenericCredentialVault.loadKeyPairFromPKCS12(GenericCredentialVault.java:273)
... 8 more
A: You have not installed a PKCS provider with the JDK. You will also get this exception if you did not install the "unbounded strength" policy files. Follow the instructions on
HowToConfigureJava.
Q: I get another ExceptionInInitializerError when I try to use the seal library
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 org.apache.axis.providers.java.MsgProvider.processMessage(MsgProvider.java:155)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
...
Caused by: java.lang.ExceptionInInitializerError
at javax.crypto.Mac.getInstance(DashoA12275)
at org.bouncycastle.jce.provider.JDKPKCS12KeyStore.engineLoad(Unknown Source)
at java.security.KeyStore.load(KeyStore.java:1150)
...
... 34 more
Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
at javax.crypto.SunJCE_b.<clinit>(DashoA12275)
... 42 more
Caused by: java.security.PrivilegedActionException: java.security.InvalidKeyException: Public key presented not for certificate signature
at java.security.AccessController.doPrivileged(Native Method)
... 43 more
Caused by: java.security.InvalidKeyException: Public key presented not for certificate signature
at org.bouncycastle.jce.provider.X509CertificateObject.checkSignature(Unknown Source)
at org.bouncycastle.jce.provider.X509CertificateObject.verify(Unknown Source)
...
... 44 more
A: We have seen this exception on Solaris, where the JRE from SUN comes with an additional security provider compared to the Windows JRE. The problem is fixed by moving down the provider according to the guidelines in
HowToConfigureJava.
Q: The performance tests are extremely fast. Something must be wrong!
A: Well the SOSI library is pretty fast. However in some cases old or bad seal*.jar files may have been copied to the
/lib/junit directory. Remove all seal*.jar files and rerun the performancetests.
Q: The build fails for me, but runs for everybody else that has checked out the project?
A: Try issue a 'mvn -U install' from the modules directory. This will update all maven plugins needed by the build.
Q: Running 'mvn -U install' downloads an extreme amount of software. Some of the downloads fails with 'Error transferring file ...'
A: In some periods the central maven repositories are very busy and you may get broken connections. You should run the "bootstrap" script located in the modules directory. This will configure Maven to download dependencies from "sunsite", which is vastly superior (in speed) to the central Maven repositories.
Q: I generated a pretty-printed XML string through the XmlUtil.node2String method, and now the signature verification fails when trying to deserialize the document
A: Pretty-printing an XML document introduces white-space elements into the SignedInfo element in the XML document. These white-space elements are not removed by the C14N algorithm (intentionally!) which breaks the signature. Use the XmlUtil.removeFormatting() method before deserializing.
Q: I serialized an IDCard using XmlUtil.node2String on the DOM generated by IDCard.serialize2DOMDocument, but deserializing fails because of missing namespace declarations in the serialized IDCard
A: You probably have an older version of Xalan on your classpath that does not generate namespace declarations correctly. Make sure you are using the version of Xalan shipped as a depency with the SOSI Library. The issue has been seen on Tomcat (version 5.2.25) which has its own older version of Xalan. There the problem was solved by placing xalan-<version>.jar from the SOSI Library distribution into $TOMCAT_HOME/common/endorsed/.
-- ChristianGasser - 14 Feb 2008