google-code-export / nutz

Automatically exported from code.google.com/p/nutz
Apache License 2.0
1 stars 1 forks source link

把工程打成jar后,get IocBean异常 #526

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
问题产生的条件:
把工程打成jar后,get IocBean异常,解压jar后,可以正常运行。

发生问题的调用代码:

ioc = new NutIoc(new ComboIocLoader("*org.nutz.ioc.loader.json.JsonLoader", 
XML_ROOT_DIR + "/datasource.json", 
"*org.nutz.ioc.loader.annotation.AnnotationIocLoader",
                    "com.yhw.sms"));

问题的详细说明:

异常堆栈:

相关日志:

C:\SMS_Server>title = CDMA短信服务

C:\SMS_Server>SET VAL=C:\SMS_Server

C:\SMS_Server>java -Xms64m -Xmx256m -classpath "C:\SMS_Server/lib/oracle-jdbc.ja
r;C:\SMS_Server/lib/SMS_Server.jar;C:\SMS_Server/lib/config;C:\SMS_Server/lib/jd
om.jar;C:\SMS_Server/lib/commons-dbcp-1.3.jar;C:\SMS_Server/lib/commons-pool-1.5
.4.jar;C:\SMS_Server/lib/JNative.jar;C:\SMS_Server/lib/log4j-1.2.14.jar;C:\SMS_S
erver/lib/quartz-all-2.0.2.jar;C:\SMS_Server/lib/slf4j-api-1.6.1.jar;C:\SMS_Serv
er/lib/slf4j-log4j12-1.6.1.jar;C:\SMS_Server/lib/nutz-1.b.40.jar;" com.yhw.sms.c
ore.MainConsole "C:\SMS_Server/config"
2011-10-04 18:03:29,390INFO:系统参数初始化成功!
2011-10-04 18:03:29,421DEBUG:Loaded 2 bean define from path=[C:\SMS_Server/confi
g/datasource.json]
2011-10-04 18:03:29,421DEBUG:Scan Resource by org.nutz.resource.impl.LocalResour
ceScan@743399
2011-10-04 18:03:29,437DEBUG:Scan Resource by org.nutz.resource.impl.LocalResour
ceScan@743399
2011-10-04 18:03:29,437DEBUG:Scan resources in JarFile( /C:/SMS_Server/lib/nutz-
1.b.40.jar ) by regex( ^.+[.]class$ ) base on src ( org/nutz/castor/castor/ )
2011-10-04 18:03:29,437DEBUG:Found 79 resources in JarFile( /C:/SMS_Server/lib/n
utz-1.b.40.jar ) by regex( ^.+[.]class$ ) base on src ( org/nutz/castor/castor/
)
2011-10-04 18:03:29,484DEBUG:Using 18 castor for Castors
2011-10-04 18:03:29,484INFO:Scan complete ! Found 0 classes in 1 base-packages!
beans = []
2011-10-04 18:03:29,484DEBUG:Get 'smsService'<class com.yhw.sms.service.SmsServi
ce>
2011-10-04 18:03:29,500DEBUG:    >> Load definition
2011-10-04 18:03:29,500ERROR:For object [smsService] - type:[class com.yhw.sms.s
ervice.SmsService]
org.nutz.ioc.IocException: For object [smsService] - type:[class com.yhw.sms.ser
vice.SmsService]
        at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:191)
        at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:200)
        at com.yhw.sms.util.NutzIoc.getIocBean(NutzIoc.java:18)
        at com.yhw.sms.core.SendMsg.<init>(SendMsg.java:19)
        at com.yhw.sms.core.MainConsole.main(MainConsole.java:17)
Caused by: org.nutz.ioc.ObjectLoadException: Object 'smsService' without define!

        at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:90)

        at org.nutz.ioc.loader.cached.CachedIocLoaderImpl.load(CachedIocLoaderIm
pl.java:47)
        at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:169)
        ... 4 more
java.lang.NullPointerException
        at com.yhw.sms.core.SendMsg$1.run(SendMsg.java:37)

Original issue reported on code.google.com by 304478...@qq.com on 4 Oct 2011 at 10:04

GoogleCodeExporter commented 9 years ago
额,这个已经fix了的, 只能解压出来

Original comment by wendal1985@gmail.com on 21 Oct 2011 at 3:33