解决Caused by: java.lang.VerifyError: Bad type on operand stack Exception Details问题

在使用springMVC框架中,使用redis过程中,项目突然报错

jedis:exception is java.lang.VerifyError: Bad type on operand stack

具体错误信息为:

 Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanInitializationException: Failed to process @EventListener annotation on bean with name 'redisConnectionFactory'; nested exception is java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    org/springframework/data/redis/connection/jedis/JedisConnectionFactory.createCluster()Lredis/clients/jedis/JedisCluster; @9: invokevirtual
  Reason:
    Type 'redis/clients/jedis/JedisPoolConfig' (current frame, stack[2]) is not assignable to 'org/apache/commons/pool2/impl/GenericObjectPoolConfig'
  Current Frame:
    bci: @9
    flags: { }
    locals: { 'org/springframework/data/redis/connection/jedis/JedisConnectionFactory' }
    stack: { 'org/springframework/data/redis/connection/jedis/JedisConnectionFactory', 'org/springframework/data/redis/connection/RedisClusterConfiguration', 'redis/clients/jedis/JedisPoolConfig' }
  Bytecode:
    0000000: 2a2a b400 112a b400 0ab6 0035 4c2a bb00
    0000010: 3659 bb00 3759 2bb7 0038 bb00 3959 2bb7
    0000020: 003a b200 3bb7 003c b500 3d2b b0       


at org.springframework.context.event.EventListenerMethodProcessor.afterSingletonsInstantiated(EventListenerMethodProcessor.java:105)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:792)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    org/springframework/data/redis/connection/jedis/JedisConnectionFactory.createCluster()Lredis/clients/jedis/JedisCluster; @9: invokevirtual
  Reason:
    Type 'redis/clients/jedis/JedisPoolConfig' (current frame, stack[2]) is not assignable to 'org/apache/commons/pool2/impl/GenericObjectPoolConfig'
  Current Frame:
    bci: @9
    flags: { }
    locals: { 'org/springframework/data/redis/connection/jedis/JedisConnectionFactory' }
    stack: { 'org/springframework/data/redis/connection/jedis/JedisConnectionFactory', 'org/springframework/data/redis/connection/RedisClusterConfiguration', 'redis/clients/jedis/JedisPoolConfig' }
  Bytecode:
    0000000: 2a2a b400 112a b400 0ab6 0035 4c2a bb00
    0000010: 3659 bb00 3759 2bb7 0038 bb00 3959 2bb7
    0000020: 003a b200 3bb7 003c b500 3d2b b0       


at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)
at java.lang.Class.getDeclaredMethods(Class.java:1860)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:612)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:524)
at org.springframework.core.MethodIntrospector.selectMethods(MethodIntrospector.java:68)
at org.springframework.context.event.EventListenerMethodProcessor.processBean(EventListenerMethodProcessor.java:127)
at org.springframework.context.event.EventListenerMethodProcessor.afterSingletonsInstantiated(EventListenerMethodProcessor.java:102)
... 19 more
五月 03, 2018 1:27:06 下午 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart
五月 03, 2018 1:27:06 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/mc] startup failed due to previous errors
五月 03, 2018 1:27:06 下午 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
五月 03, 2018 1:27:06 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/mc] registered the JDBC driver [oracle.jdbc.driver.OracleDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
五月 03, 2018 1:27:06 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/mc] appears to have started a thread named [OracleTimeoutPollingThread] but has failed to stop it. This is very likely to create a memory leak.
五月 03, 2018 1:27:06 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8080"]
五月 03, 2018 1:27:06 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
五月 03, 2018 1:27:06 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 47497 ms



项目中使用的jedis版本为

2.1.0

在参考国内一篇文章:https://www.cnblogs.com/tv151579/p/6139646.html;

https://stackoverflow.com/questions/22704518/jedispoolconfig-is-not-assignable-to-genericobjectpoolconfig

和他的解决方案后,将jedis.version改为2.4.2,重新运行项目,可以正常启动了,暂时记录该错误,具体成因再探索。

你可能感兴趣的:(问题故障,java,web)