nutz的版本1.r.62
```java
@IocBean
public class RemoteCacheService extends RedisService {
}
测试代码
public class RemoteCacheServiceTest {
private Ioc ioc;
@Before
public void before() throws ClassNotFoundException {
JsonLoader jsonLoader = new JsonLoader("/config");
AnnotationIocLoader annoLoader = new AnnotationIocLoader("/com/weirhp");
IocLoader iocLoader = new ComboIocLoader("*jedis");
IocLoader iocLoader2 = new ComboIocLoader(jsonLoader, annoLoader, iocLoader);
ioc = new NutIoc(iocLoader2);
}
// 有问题
@Test
public void testSet() throws InterruptedException {
RemoteCacheService cacheService = ioc.get(RemoteCacheService.class);
cacheService.set("test", "111");
}
// 没问题
@Test
public void testSet2() throws InterruptedException {
RedisService cacheService = ioc.get(RedisService.class);
cacheService.set("test", "111");
}
}
```
java.lang.NullPointerException
at org.nutz.integration.jedis.RedisService.set(RedisService.java:40)
at net.cloudenjoy.test.index.RemoteCacheServiceTest.testLoadQuestion(RemoteCacheServiceTest.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)