Application logging throws 'Wrong Type At Constant Pool Index' error


Overview of the Issue

This issue occurs in the following circumstances:

  1. The vFunction Sudo or Sudoless Controller Installation TGZ is installed in a Linux environment
  2. A WebSphere 8.5 Application Server is used to run the JVM
  3. When the Application starts, the following error is generated that prevents the Application from running properly
[8/6/24 10:35:28:356 CDT] 0000012a webapp        E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[spring-mvc]: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.requestMappingHandlerMapping()] threw exception; nested exception is java.lang.annotation.AnnotationFormatError: java.lang.IllegalArgumentException: Wrong type at constant pool index
  at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1015)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean_vfun_aroundBody0(AbstractAutowireCapableBeanFactory.java:456)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$VfunAjcClosure1.run(AbstractAutowireCapableBeanFactory.java:1)
  at vfrtshadow.org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:179)
  at com.vfunction.analysis.aspects.spring.SpringCreateBeanAspect.aroundNewBeanInstance(SpringCreateBeanAspect.java:111)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:429)
  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:607)
  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)
  at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
  at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
  at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
  at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
  at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
  at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
  at javax.servlet.GenericServlet.init(GenericServlet.java:161)
  at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:345)
  at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:168)
  at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:637)
  at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
  at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
  at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
  at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)
  at domain.name.org.class.doFilter(AppDomainFilter.java:67)
  at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
  at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
  at domain.name.org.class.doFilter(AppMasterFilter.java:86)
  at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
  at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
  at org.extremecomponents.table.filter.AbstractExportFilter.doFilter(AbstractExportFilter.java:49)
  at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
  at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
  at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:967)
  at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1107)
  at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
  at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:952)
  at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)
  at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:213)
  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
  at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88)
  at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
  at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
  at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
  at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
  at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
  at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
  at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
  at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.requestMappingHandlerMapping()] threw exception; nested exception is java.lang.annotation.AnnotationFormatError: java.lang.IllegalArgumentException: Wrong type at constant pool index
  at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:181)
  at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570)
  ... 56 more
Caused by: java.lang.annotation.AnnotationFormatError: java.lang.IllegalArgumentException: Wrong type at constant pool index
  at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:89)
  at java.lang.reflect.AccessibleObject.getAnnotationsFromCache(AccessibleObject.java:313)
  at java.lang.reflect.Executable.declaredAnnotations(Executable.java:606)
  at java.lang.reflect.Executable.getAnnotation(Executable.java:581)
  at java.lang.reflect.Method.getAnnotation(Method.java:643)
  at org.springframework.core.annotation.AnnotationUtils.getAnnotation(AnnotationUtils.java:101)
  at org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:122)
  at org.springframework.context.annotation.BeanAnnotationHelper.determineBeanNameFor(BeanAnnotationHelper.java:43)
  at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:240)
  at org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration$$EnhancerByCGLIB$$5db868cd.requestMappingHandlerMapping(<generated>)
  at sun.reflect.GeneratedMethodAccessor285.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
  at java.lang.reflect.Method.invoke(Method.java:508)
  at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:160)
  ... 57 more
Caused by: java.lang.IllegalArgumentException: Wrong type at constant pool index
  at sun.reflect.ConstantPool.getClassAt(ConstantPool.java:49)
  at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:256)
  at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:132)
  at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:84)

Steps to Resolve the Issue

This issue can be resolved by taking the following steps:

  1. SSH to the Application Server running the JVM
  2. Modify the vFunction Instance’s installation.yaml so the changes will persist during an upgrade. For example, vi BASE_DIRECTORY/vfunction/etc/sysconfig/vfunction/installation/instances/default-java/installation.yaml:
After the Change
agent:
  ...
  override_properties:
    - com.vfunction.runtime.config.tracking.classloaderresources.enabled=false
    - com.vfunction.runtime.config.aop.xml.spring.singleton.tracking.enabled=false
    - com.vfunction.runtime.config.aop.xml.spring.prototype.tracking.enabled=false
    - com.vfunction.runtime.config.aop.xml.spring.session.tracking.enabled=false
    - com.vfunction.runtime.config.aop.xml.spring.request.tracking.enabled=false
    - com.vfunction.runtime.config.aop.xml.spring.globalsession.tracking.enabled=false
    - com.vfunction.runtime.config.aop.xml.spring.application.tracking.enabled=false
    - com.vfunction.runtime.config.aop.xml.spring.websocket.tracking.enabled=false
    - com.vfunction.runtime.config.aop.xml.spring.unknown.tracking.enabled=false
Before the Change
agent:
  ...
  override_properties:
#    - key=value
  1. Run the vFunction upgrade script. For example: bash BASE_DIRECTORY/vfunction/opt/vfunction/controller-installation/upgrade.sh -i default-java
  2. Restart the JVM
  3. Confirm the Application starts as expected