NutzCN Logo
问答 使用redis报错 throw Exception when creating
发布于 1600天前 作者 qq_23492d00 1863 次浏览 复制 上一个帖子 下一个帖子
标签:

异常:

org.nutz.ioc.IocException: IocBean[loginAction] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:240)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:270)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:116)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at com.hfits.common.listeners.SessionListener.process(SessionListener.java:33)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: IocBean[loginAction] fail at field=[redis]
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)
	at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
	... 32 more
Caused by: org.nutz.ioc.IocException: IocBean[redis] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:240)
	at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:60)
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
	... 34 more
Caused by: java.lang.NullPointerException
	at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:78)
	at org.nutz.ioc.ObjectProxy.get(ObjectProxy.java:69)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:260)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:270)
	at org.nutz.ioc.aop.config.impl.AnnotationAopConfigration.makeIt(AnnotationAopConfigration.java:23)
	at org.nutz.ioc.aop.config.impl.AnnotationAopConfigration.makeIt(AnnotationAopConfigration.java:18)
	at org.nutz.ioc.aop.SimpleAopMaker.getInterceptorPairList(SimpleAopMaker.java:117)
	at org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:101)
	... 37 more

代码:

@IocBean
public class Redis {

    @Aop("redis") // 必须添加这个注解哦,否则jedis()会抛出空指针
    public void addTopic() {
        jedis().set("key:", "test");
    }

}

	@Inject
	protected Redis redis;

	@At
	public void test(){
		redis.addTopic();
	}
9 回复

换个名字吧,建议@Aop("redis"),是否会和你的类名Redis冲突?

Redis类名换成RedisUtils还是同样的错...

报错日志没贴全

2020-08-05 22:20:53,454 [DEBUG][org.nutz.mvc.impl.UrlMappingImpl] - Found mapping for [GET] path=/private/test : LoginAction.test(LoginAction.java:65)
2020-08-05 22:20:53,454 [DEBUG][org.nutz.ioc.impl.NutIoc] - Get 'loginAction'<class com.hfits.modules.sys.LoginAction>
2020-08-05 22:20:53,454 [DEBUG][org.nutz.ioc.impl.NutIoc] - 	 >> Load definition name=loginAction
2020-08-05 22:20:53,454 [DEBUG][org.nutz.ioc.loader.combo.ComboIocLoader] - Found IocObject(loginAction) in AnnotationIocLoader(packages=[com.hfits])
2020-08-05 22:20:53,454 [DEBUG][org.nutz.ioc.impl.NutIoc] - 	 >> Make...'loginAction'<class com.hfits.modules.sys.LoginAction>
2020-08-05 22:20:53,454 [DEBUG][org.nutz.ioc.impl.ScopeContext] - Save object 'loginAction' to [app] 
2020-08-05 22:20:53,454 [DEBUG][org.nutz.ioc.impl.NutIoc] - Get 'log'<interface org.nutz.aop.MethodInterceptor>
2020-08-05 22:20:53,502 [DEBUG][org.nutz.ioc.impl.NutIoc] - Get 'dao'<interface org.nutz.dao.Dao>
2020-08-05 22:20:53,502 [DEBUG][org.nutz.ioc.impl.NutIoc] - Get 'redisUtils'<class com.hfits.modules.sys.RedisUtils>
2020-08-05 22:20:53,502 [DEBUG][org.nutz.ioc.impl.NutIoc] - 	 >> Load definition name=redisUtils
2020-08-05 22:20:53,502 [DEBUG][org.nutz.ioc.loader.combo.ComboIocLoader] - Found IocObject(redisUtils) in AnnotationIocLoader(packages=[com.hfits])
2020-08-05 22:20:53,502 [DEBUG][org.nutz.ioc.impl.NutIoc] - 	 >> Make...'redisUtils'<class com.hfits.modules.sys.RedisUtils>
2020-08-05 22:20:53,502 [DEBUG][org.nutz.ioc.impl.ScopeContext] - Save object 'redisUtils' to [app] 
2020-08-05 22:20:53,503 [DEBUG][org.nutz.ioc.impl.NutIoc] - Get 'redis'<interface org.nutz.aop.MethodInterceptor>
2020-08-05 22:20:53,503 [DEBUG][org.nutz.ioc.impl.NutIoc] - 	 >> Load definition name=redis
2020-08-05 22:20:53,503 [DEBUG][org.nutz.ioc.loader.combo.ComboIocLoader] - Found IocObject(redis) in JsonLoader(paths=[org/nutz/integration/jedis/jedis.js])
2020-08-05 22:20:53,503 [DEBUG][org.nutz.ioc.impl.NutIoc] - 	 >> Make...'redis'<interface org.nutz.aop.MethodInterceptor>
2020-08-05 22:20:53,503 [DEBUG][org.nutz.ioc.impl.ScopeContext] - Save object 'redis' to [app] 
2020-08-05 22:20:53,514 [DEBUG][org.nutz.ioc.impl.NutIoc] - Get 'jedisAgent'<>
2020-08-05 22:20:53,514 [DEBUG][org.nutz.ioc.impl.NutIoc] - 	 >> Load definition name=jedisAgent
2020-08-05 22:20:53,514 [DEBUG][org.nutz.ioc.loader.combo.ComboIocLoader] - Found IocObject(jedisAgent) in JsonLoader(paths=[org/nutz/integration/jedis/jedis.js])
2020-08-05 22:20:53,514 [DEBUG][org.nutz.ioc.impl.NutIoc] - 	 >> Make...'jedisAgent'<>
2020-08-05 22:20:53,514 [DEBUG][org.nutz.ioc.impl.ScopeContext] - Save object 'jedisAgent' to [app] 
2020-08-05 22:20:53,517 [DEBUG][org.nutz.ioc.impl.ScopeContext] - Remove object 'jedisAgent' from [app] 
2020-08-05 22:20:53,518 [DEBUG][org.nutz.ioc.impl.ScopeContext] - Remove object 'redis' from [app] 
2020-08-05 22:20:53,518 [DEBUG][org.nutz.ioc.impl.ScopeContext] - Remove object 'redisUtils' from [app] 
2020-08-05 22:20:53,518 [DEBUG][org.nutz.ioc.impl.ScopeContext] - Remove object 'loginAction' from [app] 
2020-08-05 22:20:53,518 [WARN][org.nutz.mvc.impl.processor.FailProcessor] - Error@/private/test :
org.nutz.ioc.IocException: IocBean[loginAction] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:240)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:270)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:116)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at com.hfits.common.listeners.SessionListener.process(SessionListener.java:33)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: IocBean[loginAction] fail at field=[redisUtils]
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)
	at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
	... 32 more
Caused by: org.nutz.ioc.IocException: IocBean[redisUtils -> redis] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:240)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:270)
	at org.nutz.ioc.aop.config.impl.AnnotationAopConfigration.makeIt(AnnotationAopConfigration.java:23)
	at org.nutz.ioc.aop.config.impl.AnnotationAopConfigration.makeIt(AnnotationAopConfigration.java:18)
	at org.nutz.ioc.aop.SimpleAopMaker.getInterceptorPairList(SimpleAopMaker.java:117)
	at org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:101)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:240)
	at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:60)
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
	... 34 more
Caused by: java.lang.RuntimeException: IocBean[redis] fail at field=[jedisAgent]
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)
	at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
	... 44 more
Caused by: org.nutz.ioc.IocException: IocBean[jedisAgent] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:240)
	at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
	... 46 more
Caused by: java.lang.NoClassDefFoundError: redis/clients/util/Pool
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.getDeclaredMethods(Class.java:1975)
	at org.nutz.ioc.aop.SimpleAopMaker.getMethods(SimpleAopMaker.java:154)
	at org.nutz.ioc.aop.SimpleAopMaker.getInterceptorPairList(SimpleAopMaker.java:112)
	at org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:101)
	... 49 more
Caused by: java.lang.ClassNotFoundException: redis.clients.util.Pool
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1328)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1156)
	... 56 more

@wendal 这是全部的报错日志,帮忙瞅瞅兽总

Caused by: java.lang.ClassNotFoundException: redis.clients.util.Pool

很明显的错误呀,要么没加依赖,要么版本不是2.9

之前使用的是jedis-3.0.1,现在换成了jedis-2.9.0,报下面的错:

org.nutz.ioc.IocException: IocBean[loginAction] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:240)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:270)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:116)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at com.hfits.common.listeners.SessionListener.process(SessionListener.java:33)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: IocBean[loginAction] fail at field=[redisUtils]
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)
	at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
	... 32 more
Caused by: org.nutz.ioc.IocException: IocBean[redisUtils -> redis] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:240)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:270)
	at org.nutz.ioc.aop.config.impl.AnnotationAopConfigration.makeIt(AnnotationAopConfigration.java:23)
	at org.nutz.ioc.aop.config.impl.AnnotationAopConfigration.makeIt(AnnotationAopConfigration.java:18)
	at org.nutz.ioc.aop.SimpleAopMaker.getInterceptorPairList(SimpleAopMaker.java:117)
	at org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:101)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:240)
	at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:60)
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
	... 34 more
Caused by: java.lang.RuntimeException: IocBean[redis] fail at field=[jedisAgent]
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)
	at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
	... 44 more
Caused by: org.nutz.ioc.IocException: IocBean[jedisAgent] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:240)
	at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
	... 46 more
Caused by: java.lang.RuntimeException: IocBean[jedisAgent] fail at field=[conf]
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)
	at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
	... 49 more
Caused by: org.nutz.ioc.IocException: IocBean[conf] For object [conf] - type:[]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:249)
	at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
	... 51 more
Caused by: org.nutz.ioc.ObjectLoadException: Object 'conf' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:157)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:194)
	... 53 more

IocBy注解配置如下:

@IocBy(
    type = ComboIocProvider.class,
    args = {"*org.nutz.ioc.loader.json.JsonLoader", "config/ioc/", "*org.nutz.ioc.loader.annotation.AnnotationIocLoader", "com.hfits", "*tx", "*jedis"}
)

配置文件:/config/ioc/redis.properties

redis.host=localhost
redis.port=6379
redis.timeout=2000
#redis.password=wendal.net
redis.database=0
#redis.mode=cluster

@wendal

是在src目录下建个conf文件夹,在建个redis.properties吧,还是报和上面一样的错呢 @wendal

dao.js里面声明conf

添加回复
请先登陆
回到顶部