NutzCN Logo
问答 ioc loader 错误
发布于 3132天前 作者 Rekoe 2757 次浏览 复制 上一个帖子 下一个帖子
标签:
2016-4-19 15:16:21.228 WARN [main] !!You are using default SystemLog! Don't use it in Production environment!!
Exception in thread "main" org.nutz.lang.born.BorningException: Fail to born 'org.nutz.ioc.loader.annotation.AnnotationIocLoader'
 by args: [
  @(com.rekoe)] becasue:
java.lang.ExceptionInInitializerError
	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:990)
	at org.nutz.ioc.loader.combo.ComboIocLoader.createIocLoader(ComboIocLoader.java:118)
	at org.nutz.ioc.loader.combo.ComboIocLoader.<init>(ComboIocLoader.java:90)
	at com.rekoe.chat.IocProvider.init(IocProvider.java:24)
	at com.rekoe.chat.IocProvider.ioc(IocProvider.java:32)
	at com.rekoe.chat.IocProvider.main(IocProvider.java:38)
Caused by: java.lang.ExceptionInInitializerError
	at org.nutz.ioc.loader.annotation.AnnotationIocLoader.<init>(AnnotationIocLoader.java:44)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
	at org.nutz.lang.born.DynamicConstructorBorning.born(DynamicConstructorBorning.java:19)
	... 7 more
Caused by: sun.misc.InvalidJarIndexException: Invalid index
	at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:939)
	at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:848)
	at sun.misc.URLClassPath$JarLoader.findResource(URLClassPath.java:818)
	at sun.misc.URLClassPath$1.next(URLClassPath.java:226)
	at sun.misc.URLClassPath$1.hasMoreElements(URLClassPath.java:236)
	at java.net.URLClassLoader$3$1.run(URLClassLoader.java:583)
	at java.net.URLClassLoader$3$1.run(URLClassLoader.java:581)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader$3.next(URLClassLoader.java:580)
	at java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:605)
	at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
	at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
	at org.nutz.resource.Scans.<init>(Scans.java:455)
	at org.nutz.resource.Scans.<clinit>(Scans.java:432)
	... 13 more
6 回复

要不你导入nutz.cn的源码试试? 我之前试过没问题的.

@wendal
这样加载的

private static void init() {
		try {
			ioc = new NutIoc(new ComboIocLoader("*anno", "com.rekoe", "*async"));
		} catch (ClassNotFoundException e) {
			logger.error("Ioc create error", e);
		}
	}

非mvc项目???

@wendal
嗯 用这个测试个东西

Scans.java的455行

while (urls.hasMoreElements()) {

这代码都报错,不应该啊

@Rekoe
@wendal
重新打了个jar 就可以了
结贴

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