启动tomcat是遇到 Caused by: java.lang.RuntimeException: folder or file like '^(.+[.])(js|json)$' no found in properties/config.js问题
日志情况如下
三月 15, 2018 9:57:18 上午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter web
java.lang.ExceptionInInitializerError
at com.gistech.ba.filter.WebFilter.<init>(WebFilter.java:27)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:114)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4908)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5602)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: folder or file like '^(.+[.])(js|json)$' no found in properties/config.js
at org.nutz.lang.Lang.makeThrow(Lang.java:152)
at org.nutz.resource.Scans.loadResource(Scans.java:112)
at org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:45)
at com.gistech.ba.common.BeanFactory.<clinit>(BeanFactory.java:25)
... 18 more
三月 15, 2018 9:57:18 上午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter login
java.lang.NoClassDefFoundError: Could not initialize class com.gistech.ba.common.BeanFactory
at com.gistech.ba.filter.LoginFilter.<init>(LoginFilter.java:36)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:114)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4908)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5602)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
三月 15, 2018 9:57:18 上午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter ws
java.lang.NoClassDefFoundError: Could not initialize class com.gistech.ba.common.BeanFactory
at com.gistech.ba.filter.WebShareFilter.<init>(WebShareFilter.java:29)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:114)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4908)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5602)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
三月 15, 2018 9:57:22 上午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter nutz
java.lang.NoClassDefFoundError: Could not initialize class com.gistech.ba.common.BeanFactory
at com.gistech.ba.common.SystemCacheManager.initTemplates(SystemCacheManager.java:30)
at com.gistech.ba.common.SystemCacheManager.init(SystemCacheManager.java:23)
at com.gistech.ba.MainSetup.init(MainSetup.java:37)
at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:278)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:121)
at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
at org.nutz.mvc.NutFilter.init(NutFilter.java:69)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4908)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5602)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
三月 15, 2018 9:57:22 上午 org.apache.catalina.core.StandardContext startInternal
跟踪发现出现问题处代码如下
public class BeanFactory {
private static Ioc ioc;
static {
ioc = Mvcs.getIoc();
ioc = (ioc == null) ? Mvcs.ctx.getDefaultIoc() : ioc;
if (ioc == null) {
AnnotationIocLoader annotationIocLoader = new AnnotationIocLoader("com.gistech.ba");
JsonLoader jsonLoader = new JsonLoader("properties/config.js"); //此处报错
ComboIocLoader comboIocLoader = new ComboIocLoader(annotationIocLoader, jsonLoader);
ioc = new NutIoc(comboIocLoader);
}
}
查看编译后目录\WEB-INF\classes 下也是存在properties\config.js文件的 不知道问题出在那了