EM won't start with Java version jdk1.8.0_172

Document ID : KB000107629
Last Modified Date : 27/07/2018
Show Technical Document Details
Issue:
Our company mandates that we stay on a current approved rev of Java to be internally compliant. The current compliant version is jdk1.8.0_172. I tried modifying the Introscope_Enterprise_Manager.lax file and pointing to the new Java version, but the EM threw an exception and would not start.

EM.log shows
7/23/18 01:54:56.670 PM GMT [INFO] [main] [com.wily.apm.model.SpringAppContext] SpringAppContext initialization, logging configured with '/opt/fedex/wily/mom1/Introscope10.7.0.45/./config/log4j.properties'
Jul 23, 2018 1:54:58 PM java.io.ObjectInputStream filterCheck
INFO: ObjectInputFilter REJECTED: null, array length: -1, nRefs: 1, depth: 1, bytes: 70, ex: n/a
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.ca.wily.jasypt.APMEncryptablePropertyPlaceholderConfigurer#0' defined in class path resource [apm-hibernate-context.xml]: Cannot resolve reference to bean 'stringEncryptor' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stringEncryptor' defined in class path resource [jasyptEncryptor.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ca.apm.crypto.jasypt.APMStringEncryptor]: Constructor threw exception; nested exception is java.io.IOException: Invalid secret key format
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:334)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:651)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:145)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1077)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:981)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:662)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    at com.wily.apm.model.SpringAppContext.init(SpringAppContext.java:73)
    at com.wily.apm.model.SpringAppContext.<init>(SpringAppContext.java:42)
    at com.wily.apm.model.SpringAppContext.<clinit>(SpringAppContext.java:36)
    at com.wily.introscope.server.enterprise.entity.appmap.AppMapEntity.initApmDataService(AppMapEntity.java:233)
    at com.wily.introscope.server.enterprise.entity.appmap.AppMapEntity.<init>(AppMapEntity.java:169)
    at com.wily.introscope.server.enterprise.EnterpriseServer.initialize(EnterpriseServer.java:631)
    at com.wily.introscope.server.enterprise.EnterpriseServer.doStart(EnterpriseServer.java:384)
    at com.wily.util.ALifeCycle.start(ALifeCycle.java:86)
    at com.wily.introscope.server.enterprise.EnterpriseServer.<init>(EnterpriseServer.java:327)
    at com.wily.introscope.server.enterprise.EnterpriseServer.<init>(EnterpriseServer.java:306)
    at com.wily.introscope.server.enterprise.EnterpriseServer.start(EnterpriseServer.java:1606)
    at com.wily.introscope.em.internal.Activator.startEM(Activator.java:119)
    at com.wily.introscope.em.internal.Application.start(Application.java:27)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
    at org.eclipse.core.launcher.Main.main(Main.java:30)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.zerog.lax.LAX.launch(Unknown Source)
    at com.zerog.lax.LAX.main(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stringEncryptor' defined in class path resource [jasyptEncryptor.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ca.apm.crypto.jasypt.APMStringEncryptor]: Constructor threw exception; nested exception is java.io.IOException: Invalid secret key format
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1039)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:985)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
    ... 48 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ca.apm.crypto.jasypt.APMStringEncryptor]: Constructor threw exception; nested exception is java.io.IOException: Invalid secret key format
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1032)
    ... 56 more
Caused by: java.io.IOException: Invalid secret key format
    at com.sun.crypto.provider.JceKeyStore.engineLoad(JceKeyStore.java:856)
    at java.security.KeyStore.load(KeyStore.java:1445)
    at com.ca.apm.crypto.util.JCEKSKeystore.load(JCEKSKeystore.java:109)
    at com.ca.apm.crypto.util.JCEKSKeystore.<init>(JCEKSKeystore.java:64)
    at com.ca.apm.crypto.jasypt.APMStringEncryptor.<init>(APMStringEncryptor.java:73)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
Environment:
APM 10.5 or 10.7. 
Cause:
Searching Google for “java.io.IOException: Invalid secret key format” shows that there are many communities reporting the same problem after upgrading Java to this specific version. One of the solutions provided was to import the old keystore to a new keystore using the old java version’s keytool.

The issue is due to the latest security vulnerability fix JDK-8181370 (Better keystore handling) provided by Oracle (security enhancement).
 
 
Resolution:
One of the solutions is to import the old keystore to a new keystore using the old Java version’s keytool        (Using the keytool from an older JDK (prior the fix for JDK-8181370), you can use JDK 1.8.0.131

The steps would be:
1) install JDK 1.8.0.131 (which is known to be able to read the keystore)
2) import the keystore using this older JDK's keytool.

Now, the imported keystore should be readable by the latest JDK.” More info in https://community.oracle.com/thread/4109117
Additional Information:
A fix should be provided for this in 10.7.0 SP 2.