在eclipse中可正常读取,执行jar文件就出错了,
求解决思路
报错如下
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:58)
Caused by: java.lang.RuntimeException: Can't start quartz plugin.
at cn.dreampie.quartz.QuartzPlugin.start(QuartzPlugin.java:54)
at com.bellon.JStorm.init(JStorm.java:127)
at com.bellon.JStorm.main(JStorm.java:57)
... 5 more
Caused by: java.lang.RuntimeException: java.net.URISyntaxException: Expected sch
eme-specific part at index 5: rsrc:
at com.jfinal.kit.PathKit.detectWebRootPath(PathKit.java:95)
at com.jfinal.kit.PathKit.getWebRootPath(PathKit.java:73)
at cn.dreampie.PropertiesKit.loadPropertyFile(PropertiesKit.java:104)
at cn.dreampie.PropertiesKit.loadPropertyFile(PropertiesKit.java:80)
at cn.dreampie.quartz.QuartzPlugin.start(QuartzPlugin.java:43)
... 7 more
Caused by: java.net.URISyntaxException: Expected scheme-specific part at index 5
: rsrc:
at java.net.URI$Parser.fail(Unknown Source)
at java.net.URI$Parser.failExpecting(Unknown Source)
at java.net.URI$Parser.parse(Unknown Source)
at java.net.URI.<init>(Unknown Source)
at java.net.URL.toURI(Unknown Source)
at com.jfinal.kit.PathKit.detectWebRootPath(PathKit.java:92)
... 11 more
所以,不要使用 PathKit.getWebRootPath(),而是去用 PathKit.getRootClassPath() 方法
如果一定要用 getWebRootPath() 方法,可以在使用之前用:PathKit.setWebRootPath(....) 提前设置好一个值