问答详情
源自:3-3 秒杀操作-并发优化-3

测试web时,启动Tomcat出现问题,测试也全通过了,就是进入http://localhost:8080/seckill/list时出现以下错误

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisDao': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.seckill.dao.cache.RedisDao] from ClassLoader [ParallelWebappClassLoader
  context: ROOT
  delegate: false
----------> Parent Classloader:
java.net.URLClassLoader@564fabc8
]

Caused by: java.lang.NoClassDefFoundError: com/dyuproject/protostuff/Schema	at java.base/java.lang.Class.getDeclaredMethods0(Native Method)	at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3167)	at java.base/java.lang.Class.getDeclaredMethods(Class.java:2310)	at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:489)	... 41 common frames omitted

怎么解决啊?包也全导入了

<!-- redis客户端:Jedis -->
<dependency>
    <groupId>redis.clients</groupId>
    <artifactId>jedis</artifactId>
    <version>2.7.3</version>
</dependency>
<!-- protostuff序列化依赖 -->
<dependency>
    <groupId>com.dyuproject.protostuff</groupId>
    <artifactId>protostuff-core</artifactId>
    <version>1.0.8</version>
</dependency>
<dependency>
    <groupId>com.dyuproject.protostuff</groupId>
    <artifactId>protostuff-runtime</artifactId>
    <version>1.0.8</version>
</dependency>
<!-- 自己注入RedisDao -->
<bean id="redisDao" class="org.seckill.dao.cache.RedisDao">
    <constructor-arg index="0" value="localhost"/>
    <constructor-arg index="1" value="6379"/>
</bean>


提问者:qq_慕UI0414813 2019-08-17 00:08

个回答

  • qq_慕UI0414813
    2019-08-18 11:05:11

    我找到问题所在了,就是自己的File->Project Structure->Artifacts的后面导入的包未导入lib文件下,所以手动导入自己报错为空的包即可!