NutzCN Logo
问答 启动报错folder or file like '^(.+[.])(js|json)$' no found in properties/config.js
发布于 2437天前 作者 FWC1994 3286 次浏览 复制 上一个帖子 下一个帖子
标签:

启动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文件的 不知道问题出在那了

6 回复

为啥你要自行new ioc容器

@wendal 会对这块有什么影响

@wendal 我这块问题是什么原因导致的 现在知道问题在哪了 但不知道怎么解决啊 系统开发的框架不能动啊 -_-

因为这些写是不对的, 绝大多数情况下自行new ioc容器都是错误用法

@wendal 今天发现 最后导致这一问题的原因是 我的tomcat目录下有空格 导致的

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