NutzCN Logo
问答 帮忙看下全局AOP问题
发布于 1979天前 作者 qq_297125b4 1340 次浏览 复制 上一个帖子 下一个帖子
标签:

是不是用这样的方法设置,但是报错IocBean[conf] fail at field=[paths]

[ERROR] [2019-06-17 11:52:09][org.nutz.mvc.impl.NutLoading]try to depose ioc
[ERROR] [2019-06-17 11:57:16][com.xinze.pumpkin.core.CoreMainSetup]log4j2 jmx will case reload memory leak! pls add -Dlog4j2.disable.jmx=true to JAVA_OPTS
[ERROR] [2019-06-17 11:57:16][org.nutz.plugins.hotplug.Hotplug]fail at hotplug name=core
[ERROR] [2019-06-17 11:57:16][org.nutz.mvc.impl.NutLoading]Error happend during start serivce!
java.lang.RuntimeException: org.nutz.ioc.IocException: IocBean[dao -> dataSource -> conf] throw Exception when creating

permissionInterceptor : {
			type :'com.xinze.pumpkin.core.interceptor.PermissionInterceptor'
		},
$aop : {
	        type : 'org.nutz.ioc.aop.config.impl.JsonAopConfigration',
	        fields : {
	            itemList : [
	                ['.+','.+','ioc:permissionInterceptor']
	            ]
	        }
	    }
4 回复

完整报错信息

[ERROR] [2019-06-17 11:57:16][com.xinze.pumpkin.core.CoreMainSetup]log4j2 jmx will case reload memory leak! pls add -Dlog4j2.disable.jmx=true to JAVA_OPTS
[ERROR] [2019-06-17 11:57:16][org.nutz.plugins.hotplug.Hotplug]fail at hotplug name=core
[ERROR] [2019-06-17 11:57:16][org.nutz.mvc.impl.NutLoading]Error happend during start serivce!
java.lang.RuntimeException: org.nutz.ioc.IocException: IocBean[dao -> dataSource -> conf] throw Exception when creating
at org.nutz.plugins.hotplug.Hotplug.setupInit(Hotplug.java:315) ~[nutz-plugins-hotplug-1.r.66.jar:?]
at com.xinze.pumpkin.webapp.web.MainSetup.init(MainSetup.java:30) ~[classes/:?]
at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:278) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:121) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.plugins.hotplug.Hotplug.load(Hotplug.java:117) ~[nutz-plugins-hotplug-1.r.66.jar:?]
at org.nutz.mvc.ActionHandler.(ActionHandler.java:19) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.mvc.NutFilter._init(NutFilter.java:91) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.mvc.NutFilter.init(NutFilter.java:69) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:270) ~[catalina.jar:9.0.21]
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:251) ~[catalina.jar:9.0.21]
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:102) ~[catalina.jar:9.0.21]
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4530) ~[catalina.jar:9.0.21]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5169) ~[catalina.jar:9.0.21]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[catalina.jar:9.0.21]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717) ~[catalina.jar:9.0.21]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690) ~[catalina.jar:9.0.21]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705) ~[catalina.jar:9.0.21]
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1728) ~[catalina.jar:9.0.21]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_211]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:289) ~[tomcat-coyote.jar:9.0.21]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) ~[?:1.8.0_211]
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) ~[?:1.8.0_211]
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:457) ~[catalina.jar:9.0.21]
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:406) ~[catalina.jar:9.0.21]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_211]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:289) ~[tomcat-coyote.jar:9.0.21]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) ~[?:1.8.0_211]
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) ~[?:1.8.0_211]
at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468) ~[?:1.8.0_211]
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) ~[?:1.8.0_211]
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) ~[?:1.8.0_211]
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) ~[?:1.8.0_211]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_211]
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408) ~[?:1.8.0_211]
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) ~[?:1.8.0_211]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_211]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357) ~[?:1.8.0_211]
at sun.rmi.transport.Transport$1.run(Transport.java:200) ~[?:1.8.0_211]
at sun.rmi.transport.Transport$1.run(Transport.java:197) ~[?:1.8.0_211]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_211]
at sun.rmi.transport.Transport.serviceCall(Transport.java:196) ~[?:1.8.0_211]
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573) ~[?:1.8.0_211]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834) ~[?:1.8.0_211]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688) ~[?:1.8.0_211]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_211]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687) [?:1.8.0_211]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_211]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_211]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_211]
Caused by: org.nutz.ioc.IocException: IocBean[dao -> dataSource -> conf] throw Exception when creating
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.ObjectMakerImpl$1.born(ObjectMakerImpl.java:79) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:78) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:117) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:64) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:161) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at com.xinze.pumpkin.core.CoreMainSetup.init(CoreMainSetup.java:59) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.plugins.hotplug.Hotplug.setupInit(Hotplug.java:282) ~[nutz-plugins-hotplug-1.r.66.jar:?]
at org.nutz.plugins.hotplug.Hotplug.abc(Hotplug.java:380) ~[nutz-plugins-hotplug-1.r.66.jar:?]
at org.nutz.plugins.hotplug.Hotplug.setupInit(Hotplug.java:311) ~[nutz-plugins-hotplug-1.r.66.jar:?]
... 57 more
Caused by: java.lang.RuntimeException: IocBean[conf] fail at field=[paths]
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.ObjectMakerImpl$1.born(ObjectMakerImpl.java:79) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:78) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:117) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:64) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:161) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at com.xinze.pumpkin.core.CoreMainSetup.init(CoreMainSetup.java:59) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.plugins.hotplug.Hotplug.setupInit(Hotplug.java:282) ~[nutz-plugins-hotplug-1.r.66.jar:?]
at org.nutz.plugins.hotplug.Hotplug.abc(Hotplug.java:380) ~[nutz-plugins-hotplug-1.r.66.jar:?]
at org.nutz.plugins.hotplug.Hotplug.setupInit(Hotplug.java:311) ~[nutz-plugins-hotplug-1.r.66.jar:?]
... 57 more
Caused by: java.lang.StackOverflowError
at java.lang.Class.getSimpleBinaryName(Class.java:1443) ~[?:1.8.0_211]
at java.lang.Class.getSimpleName(Class.java:1309) ~[?:1.8.0_211]
at org.apache.catalina.loader.WebappClassLoaderBase.toString(WebappClassLoaderBase.java:791) ~[catalina.jar:9.0.21]
at java.lang.String.valueOf(String.java:2994) ~[?:1.8.0_211]
at java.lang.StringBuilder.append(StringBuilder.java:131) ~[?:1.8.0_211]
at org.nutz.lang.Mirror.getTypeId(Mirror.java:883) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.json.Json.getEntity(Json.java:317) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.json.handler.JsonPojoHandler.toJson(JsonPojoHandler.java:45) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:82) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.json.Json.toJson(Json.java:254) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.json.Json.toJson(Json.java:216) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.json.Json.toJson(Json.java:202) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at com.xinze.pumpkin.core.interceptor.PermissionInterceptor.filter(PermissionInterceptor.java:35) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.PropertiesProxy$$NUTZAOP.hashCode(PropertiesProxy.java:1) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at java.util.HashMap.hash(HashMap.java:339) ~[?:1.8.0_211]
at java.util.HashMap.containsKey(HashMap.java:596) ~[?:1.8.0_211]
at java.util.HashSet.contains(HashSet.java:204) ~[?:1.8.0_211]
at org.nutz.json.impl.JsonRenderImpl.memoContains(JsonRenderImpl.java:304) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.json.handler.JsonPojoHandler.toJson(JsonPojoHandler.java:69) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:82) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.json.Json.toJson(Json.java:254) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.json.Json.toJson(Json.java:216) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.json.Json.toJson(Json.java:202) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at com.xinze.pumpkin.core.interceptor.PermissionInterceptor.filter(PermissionInterceptor.java:35) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at org.nutz.ioc.impl.PropertiesProxy$$NUTZAOP.hashCode(PropertiesProxy.java:1) ~[pumpkin-core-0.0.1-RELEASE.jar:0.0.1-RELEASE]
at java.util.HashMap.hash(HashMap.java:339) ~[?:1.8.0_211]
at java.util.HashMap.containsKey(HashMap.java:596) ~[?:1.8.0_211]
at java.util.HashSet.contains(HashSet.java:204) ~[?:1.8.0_211]

我把PermissionInterceptor里面的日志去掉,就可以了,但还没明白怎么回事

应该只拦截你自己的类,不要类都拦截

这个拦截是所有ioc 对象的,不止入口方法

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