Redis integration springmvc project redisPool been reported null pointer

updateTime:2018.11.16

Because the project needs to do so today redis integrate our ssm project to replace our original memcache with redis;

But after the completion of the project configuration but there is a situation that is NullPointException, null pointer;

Best not Miss

Two hours quietly and over;

Because Baidu to configure the type of redis (ie redis configuration written in config.properties and spring.xml in  the following ) reported empty basic answer to this question is not, in themselves so that like a lot;

Thinking about gettin a null pointer because the place is not configurable, so in between spring.xml and spring-mvc.xml switched, also reported a new mistake;

 

Finally, when it found the real problem is the spring package is not scanned on the scan; it was like up suddenly; better to think of it;


 

Summary: 1. encounter problems do not worry, the more urgent the more useless, but is calm everything will be solved

2. Actually, this is quite simple, because it is nothing more than the injection failure for several reasons:

① ② configure scan failed initialization failed (usually reported abnormal) ③ not take effect configuration (Configuration position error, the error will generally) ④ ⑤ no wrong account password plus @Component comment ⑥get / set methods or @autowired
find the cause, you're done; hope help face this problem of small partners;

updateTime: 2018.11.16
original articles, please indicate the source;

Released four original articles · won praise 0 · Views 929

Guess you like

Origin blog.csdn.net/atmosphere_/article/details/84146689