ALL Nutz Log via Log4jLogAdapter
Log4j: 17:56:58 INFO org.nutz.log.Logs [] - Nutz is licensed under the Apache License, Version 2.0 .
Report bugs : https://github.com/nutzam/nutz/issues
Log4j: 17:56:58 DEBUG com.nari.nwims.skengine.base.nutz.ExtConfLoader [] - lastPath=/home/na/engine/etc/db.properties
Log4j: 17:57:06 DEBUG org.nutz.resource.Scans [] - Locations for Scans:
[FileSystemResourceLocation [root=/home/na/engine], JarResourceLocation [jarPath=/home/na/engine/sk-engine.jar]]
Log4j: 17:57:07 DEBUG org.nutz.resource.Scans [scan] - Found 0 resource by src( . ) , regex( ^(.+[.])(js|json)$ )
Log4j: 17:57:07 DEBUG org.nutz.castor.Castors [reload] - Using 91 castor for Castors
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: org.nutz.lang.born.BorningException: Fail to born 'org.nutz.ioc.loader.json.JsonLoader'
by args: [
@(.)] becasue:
java.lang.RuntimeException: folder or file like '^(.+[.])(js|json)$' no found in .
at org.nutz.lang.born.DynamicConstructorBorning.born(DynamicConstructorBorning.java:21)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:967)
at org.nutz.ioc.loader.combo.ComboIocLoader.createIocLoader(ComboIocLoader.java:113)
at org.nutz.ioc.loader.combo.ComboIocLoader.(ComboIocLoader.java:85)
at com.nari.nwims.skengine.base.nutz.IocMaster.getInstance(IocMaster.java:35)
at com.nari.nwims.skengine.SKEngine.(SKEngine.java:15)
Caused by: java.lang.RuntimeException: folder or file like '^(.+[.])(js|json)$' no found in .
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:17)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:967)
at org.nutz.lang.Lang.makeThrow(Lang.java:116)
at org.nutz.resource.Scans.loadResource(Scans.java:86)
at org.nutz.ioc.loader.json.JsonLoader.(JsonLoader.java:41)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.nutz.lang.born.DynamicConstructorBorning.born(DynamicConstructorBorning.java:19)
... 6 more
Could not find the main class: com.nari.nwims.skengine.SKEngine. Program will exit.
/**
* 外部配置文件载入器。
*
* @author wukong(wukonggg@139.com)
*/
public class ExtConfLoader extends MapLoader {
private static final String DB_PROPS = "db.properties";
private static Log log = Logs.get();
public ExtConfLoader() {
NutMap map = new NutMap();
String lastPath = System.getProperty("user.dir") + "/etc/" + DB_PROPS;
log.debug("lastPath=" + lastPath);
File file = Files.findFile(lastPath);
if (Lang.isEmpty(file)) {
throw Lang.makeThrow("Can Not Find Resource [%s] Any More", DB_PROPS);
}
map.setv("type", "org.nutz.ioc.impl.PropertiesProxy");
ArrayList<String> args = new ArrayList<String>();
args.add(file.getPath());
map.setv("args", args);
getMap().put("conf", map);
}
}
public class IocMaster {
private static final Log log = Logs.get();
private static Ioc ioc = null;
private IocMaster() {
throw new RuntimeException("Shit! What are you doing?!");
}
public static Ioc getInstance() {
if (null != ioc) {
return ioc;
}
try {
ioc = new NutIoc(new ComboIocLoader(
"*com.nari.nwims.skengine.base.nutz.ExtConfLoader"
, "*js", "."
, "*anno", "com.nari.nwims.skengine"
, "*tx"
));
} catch (ClassNotFoundException e) {
String msg = "create ioc failed...";
log.error(msg);
log.error(e.getMessage());
throw new RuntimeException(e);
// } catch (MalformedURLException e) {
// e.printStackTrace();
}
return ioc;
}
}
db.js跟com在同级目录,大神们,这个是什么问题呢???