刚修改的
var ioc = {
resources : {
type : "org.nutz.ioc.impl.PropertiesProxy",
fields : {
paths : ["custom/"]
}
},
dataSource : {
factory : "$resources#make",
args : ["com.alibaba.druid.pool.DruidDataSource", "db."],
type : "com.alibaba.druid.pool.DruidDataSource",
events : {
create : "init",
depose : 'close'
}
},
dao : {
type : "org.nutz.dao.impl.NutDao",
args : [{refer:"dataSource"}]
}
};
问题解决了,但是又报另一个错了
D:\s_develop\JDK\jdk1.8.0_121\bin\java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:58369,suspend=y,server=n -Dmaven.home=D:\s_develop\maven\apache-maven-3.1.1 -Dclassworlds.conf=D:\s_develop\maven\apache-maven-3.1.1\bin\m2.conf -Dfile.encoding=UTF-8 -classpath "D:\s_develop\maven\apache-maven-3.1.1\boot\plexus-classworlds-2.5.1.jar;D:\s_develop\IntelliJ_IDEAR\IntelliJ IDEA 2017.2.1\lib\idea_rt.jar" org.codehaus.classworlds.Launcher -Didea.version=2017.2.2 -s D:\s_develop\maven\apache-maven-3.1.1\conf\settings.xml tomcat7:run
Connected to the target VM, address: '127.0.0.1:58369', transport: 'socket'
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building nutzbook 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.1:run (default-cli) @ nutzbook >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ nutzbook ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ nutzbook ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.1:run (default-cli) @ nutzbook <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.1:run (default-cli) @ nutzbook ---
[INFO] Running war on http://localhost:8080/nutzbook
[INFO] Using existing Tomcat server configuration at E:\WorkSpace\workspace_InstallJIDAER.No2\nutzbook\target\tomcat
[INFO] create webapp with contextPath: /nutzbook
八月 19, 2017 4:10:24 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8080"]
八月 19, 2017 4:10:24 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Tomcat
八月 19, 2017 4:10:24 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.37
2017-8-19 16:10:26.368 INFO [localhost-startStop-1] Select SystemLog as Nutz.Log implement
2017-8-19 16:10:26.376 INFO [localhost-startStop-1] NutFilter[nutz] starting ...
2017-8-19 16:10:26.454 DEBUG [localhost-startStop-1] Locations for Scans:
[Dir[path=E:\WorkSpace\workspace_InstallJIDAER.No2\nutzbook], Jar[path=D:\s_develop\maven\repository\org\nutz\nutz\1.r.60\nutz-1.r.60.jar], Jar[path=D:\s_develop\maven\apache-maven-3.1.1\boot\plexus-classworlds-2.5.1.jar], Jar[path=D:\s_develop\IntelliJ_IDEAR\IntelliJ IDEA 2017.2.1\lib\idea_rt.jar]]
2017-8-19 16:10:26.455 INFO [localhost-startStop-1] [loc=E:\WorkSpace\workspace_InstallJIDAER.No2\nutzbook\src\main\webapp\WEB-INF\classes]not exist
2017-8-19 16:10:26.456 DEBUG [localhost-startStop-1] Locations for Scans:
{E:\WorkSpace\workspace_InstallJIDAER.No2\nutzbook=Dir[path=E:\WorkSpace\workspace_InstallJIDAER.No2\nutzbook], D:\s_develop\maven\repository\org\nutz\nutz\1.r.60\nutz-1.r.60.jar=Jar[path=D:\s_develop\maven\repository\org\nutz\nutz\1.r.60\nutz-1.r.60.jar], D:\s_develop\maven\apache-maven-3.1.1\boot\plexus-classworlds-2.5.1.jar=Jar[path=D:\s_develop\maven\apache-maven-3.1.1\boot\plexus-classworlds-2.5.1.jar], D:\s_develop\IntelliJ_IDEAR\IntelliJ IDEA 2017.2.1\lib\idea_rt.jar=Jar[path=D:\s_develop\IntelliJ_IDEAR\IntelliJ IDEA 2017.2.1\lib\idea_rt.jar], E:\WorkSpace\workspace_InstallJIDAER.No2\nutzbook\src\main\webapp\WEB-INF\classes=ErrorResourceLocation [loc=E:\WorkSpace\workspace_InstallJIDAER.No2\nutzbook\src\main\webapp\WEB-INF\classes]}
17-08-19 16:10:26.455 WARN [localhost-startStop-1] /WEB-INF/lib/ NOT found?!
2017-8-19 16:10:26.520 DEBUG [localhost-startStop-1] Using 95 castor for Castors
2017-8-19 16:10:26.529 DEBUG [localhost-startStop-1] Loading by class org.nutz.mvc.impl.NutLoading
2017-8-19 16:10:26.536 INFO [localhost-startStop-1] Nutz Version : 1.r.60
2017-8-19 16:10:26.536 INFO [localhost-startStop-1] Nutz.Mvc[nutz] is initializing ...
2017-8-19 16:10:26.536 DEBUG [localhost-startStop-1] Web Container Information:
2017-8-19 16:10:26.539 DEBUG [localhost-startStop-1] - Default Charset : UTF-8
2017-8-19 16:10:26.539 DEBUG [localhost-startStop-1] - Current . path : E:\WorkSpace\workspace_InstallJIDAER.No2\nutzbook\.
2017-8-19 16:10:26.539 DEBUG [localhost-startStop-1] - Java Version : 1.8.0_121
2017-8-19 16:10:26.539 DEBUG [localhost-startStop-1] - File separator : \
2017-8-19 16:10:26.540 DEBUG [localhost-startStop-1] - Timezone : Asia/Shanghai
2017-8-19 16:10:26.540 DEBUG [localhost-startStop-1] - OS : Windows 10 amd64
2017-8-19 16:10:26.540 DEBUG [localhost-startStop-1] - ServerInfo : Apache Tomcat/7.0.37
2017-8-19 16:10:26.541 DEBUG [localhost-startStop-1] - Servlet API : 3.0
2017-8-19 16:10:26.541 DEBUG [localhost-startStop-1] - ContextPath : /nutzbook
2017-8-19 16:10:26.541 DEBUG [localhost-startStop-1] - context.tempdir : E:\WorkSpace\workspace_InstallJIDAER.No2\nutzbook\target\tomcat\work\Tomcat\localhost\nutzbook
2017-8-19 16:10:26.542 DEBUG [localhost-startStop-1] - MainModule : net.wendal.nutzbook.MainModule
2017-8-19 16:10:26.543 DEBUG [localhost-startStop-1] >> app.root = E:/WorkSpace/workspace_InstallJIDAER.No2/nutzbook/src/main/webapp
2017-8-19 16:10:26.545 DEBUG [localhost-startStop-1] @IocBy(type=org.nutz.mvc.ioc.provider.ComboIocProvider, args=["*js", "ioc/", "*anno", "net.wendal.nutzbook", "*tx", "*async"],init=[])
2017-8-19 16:10:26.574 DEBUG [localhost-startStop-1] Found 1 resource by src( ioc/ ) , regex( ^(.+[.])(js|json)$ )
2017-8-19 16:10:26.575 DEBUG [localhost-startStop-1] loading ioc js config from [E:/WorkSpace/workspace_InstallJIDAER.No2/nutzbook/target/classes/ioc/dao.js]
2017-8-19 16:10:26.584 DEBUG [localhost-startStop-1] Loaded 3 bean define from path=[ioc/] --> [resources, dao, dataSource]
2017-8-19 16:10:26.589 DEBUG [localhost-startStop-1] Found 4 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
2017-8-19 16:10:26.634 DEBUG [localhost-startStop-1] Found @IocBean : class net.wendal.nutzbook.module.UserModule
2017-8-19 16:10:27.654 INFO [localhost-startStop-1] Found 1 classes in 1 base-packages!
beans = ["userModule"]
2017-8-19 16:10:27.658 DEBUG [localhost-startStop-1] Loaded 5 bean define from reader --
[txREPEATABLE_READ, txSERIALIZABLE, txNONE, txREAD_UNCOMMITTED, txREAD_COMMITTED]
2017-8-19 16:10:27.664 DEBUG [localhost-startStop-1] Load AopConfigure for anno=org.nutz.aop.interceptor.async.Async by type=org.nutz.aop.interceptor.async.AsyncAopIocLoader
2017-8-19 16:10:27.671 INFO [localhost-startStop-1] NutIoc init begin ...
2017-8-19 16:10:27.676 INFO [localhost-startStop-1] ... NutIoc init complete
2017-8-19 16:10:27.688 INFO [localhost-startStop-1] Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
2017-8-19 16:10:27.691 DEBUG [localhost-startStop-1] @Views(DefaultViewMaker.class)
2017-8-19 16:10:27.733 DEBUG [localhost-startStop-1] @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)
2017-8-19 16:10:27.755 DEBUG [localhost-startStop-1] module class location 'file:/E:/WorkSpace/workspace_InstallJIDAER.No2/nutzbook/target/classes/'
2017-8-19 16:10:27.755 DEBUG [localhost-startStop-1] > scan 'net.wendal.nutzbook'
2017-8-19 16:10:27.762 DEBUG [localhost-startStop-1] Found 4 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
2017-8-19 16:10:27.763 DEBUG [localhost-startStop-1] >> add 'net.wendal.nutzbook.module.UserModule'
2017-8-19 16:10:27.778 INFO [localhost-startStop-1] Optional processor class not found, disabled : org.nutz.integration.shiro.NutShiroProcessor
2017-8-19 16:10:27.792 INFO [localhost-startStop-1] Optional processor class not found, disabled : org.nutz.plugins.validation.ValidationProcessor
2017-8-19 16:10:27.840 DEBUG [localhost-startStop-1] '/user/logout' >> (UserModule.java:36).logout : void | @Ok(>>:/ ) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2017-8-19 16:10:27.850 DEBUG [localhost-startStop-1] '/user/login' >> (UserModule.java:25).login : Object | @Ok(json ) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2017-8-19 16:10:27.852 INFO [localhost-startStop-1] Found 2 module methods
2017-8-19 16:10:27.852 DEBUG [localhost-startStop-1] @Localization not define
2017-8-19 16:10:27.853 INFO [localhost-startStop-1] Nutz.Mvc[nutz] is up in 1310ms
八月 19, 2017 4:10:27 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
2017-8-19 16:10:47.125 DEBUG [http-bio-8080-exec-4] Found mapping for [POST] path=/user/login : UserModule.login(UserModule.java:25)
2017-8-19 16:10:47.128 DEBUG [http-bio-8080-exec-4] Get 'userModule'<class net.wendal.nutzbook.module.UserModule>
2017-8-19 16:10:47.128 DEBUG [http-bio-8080-exec-4] Get '$aop_async'<interface org.nutz.ioc.aop.config.AopConfigration>
2017-8-19 16:10:47.130 DEBUG [http-bio-8080-exec-4] >> Load definition name=$aop_async
2017-8-19 16:10:47.136 DEBUG [http-bio-8080-exec-4] Found IocObject($aop_async) in AsyncAopIocLoader@1058135170
2017-8-19 16:10:47.136 DEBUG [http-bio-8080-exec-4] >> Make...'$aop_async'<interface org.nutz.ioc.aop.config.AopConfigration>
2017-8-19 16:10:47.138 DEBUG [http-bio-8080-exec-4] Save object '$aop_async' to [app]
2017-8-19 16:10:47.150 DEBUG [http-bio-8080-exec-4] Load AopConfigure for anno=org.nutz.ioc.aop.Aop by type=org.nutz.ioc.aop.config.impl.AnnotationAopConfigration
2017-8-19 16:10:47.150 DEBUG [http-bio-8080-exec-4] >> Load definition name=userModule
2017-8-19 16:10:47.150 DEBUG [http-bio-8080-exec-4] Found IocObject(userModule) in AnnotationIocLoader(packages=[net.wendal.nutzbook])
2017-8-19 16:10:47.151 DEBUG [http-bio-8080-exec-4] >> Make...'userModule'<class net.wendal.nutzbook.module.UserModule>
2017-8-19 16:10:47.151 DEBUG [http-bio-8080-exec-4] Load class net.wendal.nutzbook.module.UserModule without AOP
2017-8-19 16:10:47.151 DEBUG [http-bio-8080-exec-4] Save object 'userModule' to [app]
2017-8-19 16:10:47.161 DEBUG [http-bio-8080-exec-4] Get 'dao'<interface org.nutz.dao.Dao>
2017-8-19 16:10:47.161 DEBUG [http-bio-8080-exec-4] >> Load definition name=dao
2017-8-19 16:10:47.161 DEBUG [http-bio-8080-exec-4] Loading define for name=dao
2017-8-19 16:10:47.168 DEBUG [http-bio-8080-exec-4] Found IocObject(dao) in JsonLoader(paths=[ioc/])
2017-8-19 16:10:47.168 DEBUG [http-bio-8080-exec-4] >> Make...'dao'<interface org.nutz.dao.Dao>
2017-8-19 16:10:47.185 DEBUG [http-bio-8080-exec-4] Load class org.nutz.dao.impl.NutDao without AOP
2017-8-19 16:10:47.185 DEBUG [http-bio-8080-exec-4] Save object 'dao' to [app]
2017-8-19 16:10:47.188 DEBUG [http-bio-8080-exec-4] Get 'dataSource'<>
2017-8-19 16:10:47.188 DEBUG [http-bio-8080-exec-4] >> Load definition name=dataSource
2017-8-19 16:10:47.188 DEBUG [http-bio-8080-exec-4] Loading define for name=dataSource
2017-8-19 16:10:47.198 DEBUG [http-bio-8080-exec-4] Found IocObject(dataSource) in JsonLoader(paths=[ioc/])
2017-8-19 16:10:47.198 DEBUG [http-bio-8080-exec-4] >> Make...'dataSource'<>
2017-8-19 16:10:47.225 DEBUG [http-bio-8080-exec-4] Load class com.alibaba.druid.pool.DruidDataSource without AOP
2017-8-19 16:10:47.226 DEBUG [http-bio-8080-exec-4] Save object 'dataSource' to [app]
2017-8-19 16:10:47.228 DEBUG [http-bio-8080-exec-4] Get 'resources'<>
2017-8-19 16:10:47.228 DEBUG [http-bio-8080-exec-4] >> Load definition name=resources
2017-8-19 16:10:47.228 DEBUG [http-bio-8080-exec-4] Loading define for name=resources
2017-8-19 16:10:47.228 DEBUG [http-bio-8080-exec-4] Found IocObject(resources) in JsonLoader(paths=[ioc/])
2017-8-19 16:10:47.228 DEBUG [http-bio-8080-exec-4] >> Make...'resources'<>
2017-8-19 16:10:47.231 DEBUG [http-bio-8080-exec-4] Load class org.nutz.ioc.impl.PropertiesProxy without AOP
2017-8-19 16:10:47.231 DEBUG [http-bio-8080-exec-4] Save object 'resources' to [app]
2017-8-19 16:10:47.303 DEBUG [http-bio-8080-exec-4] Found 1 resource by src( custom/ ) , regex( ^.+[.]properties$ )
2017-8-19 16:10:47.387 DEBUG [http-bio-8080-exec-4] Remove object 'dataSource' from [app]
17-08-19 16:10:47.390 WARN [http-bio-8080-exec-4] Error@/user/login :
org.nutz.ioc.IocException: [userModule, dao, dataSource] # FAIL to create Ioc Bean name=[dataSource]
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:149)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:75)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:60)
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:31)
at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:56)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:135)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:116)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:198)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
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.NullPointerException
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1628)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:559)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:642)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.nutz.ioc.trigger.MethodEventTrigger.trigger(MethodEventTrigger.java:18)
at org.nutz.ioc.weaver.DefaultWeaver.onCreate(DefaultWeaver.java:72)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
... 35 more
2017-8-19 16:10:47.389 DEBUG [http-bio-8080-exec-4] Remove object 'dao' from [app]
2017-8-19 16:10:47.390 DEBUG [http-bio-8080-exec-4] Remove object 'userModule' from [app]