Idea使用记录--添加Problems&&解决Autowired报错could not autowire

2023-02-12,,,,

今天在使用Idea的时候,发现Idea在整个每次找到错误代码非常不方便(Idea如果类中有错误,没有打开过类并不会提示,比如构建工程后缺少jar包问题)。我想快速看到工程哪里出问题类似于eclipse中的problem,能很快的定位到问题出现在哪里。

添加Problems

同时需要把Power Save Mode 模式关闭( 这个顾名思义是省电模式。当你勾选此模式以后,IntelliJ不会给你完成任何自动完成的功能,例如本来你输入一个字符会自动提示的,勾选以后就没有了)

解决Autowired报错could not autowire

今天早上在自动装配Redis的时候总是报could not autowire no beans...,但是在配置文件中已经生成了bean

     <bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig">
        <property name="maxIdle" value="${dataSource.redis.maxIdle}" />
        <property name="maxActive" value="${dataSource.redis.maxActive}" />
        <property name="maxWait" value="${dataSource.redis.maxWait}" />
        <property name="testOnBorrow" value="${dataSource.redis.testOnBorrow}" />
    </bean>

    <bean id="connectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
        p:host-name="${dataSource.redis.host}" p:port="${dataSource.redis.port}" p:password="${dataSource.redis.pass}"  p:pool-config-ref="poolConfig"/>

    <bean id="redisTemplate" class="org.springframework.data.redis.core.StringRedisTemplate">
        <property name="connectionFactory"   ref="connectionFactory" />
    </bean>

早上在使用shift+F6改变类名称之后,redisTemplate总是红色大波浪。

解决方式:

 删除项目的iml文件,然后reimport项目的pom.xml 文件,MVN重建后错误提示消失。

Idea使用记录--添加Problems&&解决Autowired报错could not autowire的相关教程结束。

《Idea使用记录--添加Problems&&解决Autowired报错could not autowire.doc》

下载本文的Word格式文档,以方便收藏与打印。