我在跟nutzbook走一遍教程,然后在登录的时候出现了dao为null的情况,下面是我的代码:
MainModule:
// 请注意星号!!不要拷贝少了
@IocBy(type=ComboIocProvider.class, args={
"*js", "ioc/",
"*anno", "net.wendal.nutzbook",
"*tx",
"*quartz"})
@Modules(scanPackage = true)
@SetupBy(value = MainSetup.class)
@ChainBy(args="mvc/nutzbook-mvc-chain.js")
public class MainModule {
}
日志:
[INFO ] 09:40:52.952 org.nutz.mvc.NutFilter._init(NutFilter.java:81) - NutFilter[nutz] starting ...
[DEBUG] 09:40:53.085 org.nutz.resource.Scans.<init>(Scans.java:509) - Locations for Scans:
[Dir[path=E:\Dev\apache-tomcat-8.0.44\bin], Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\nutz-1.r.60.jar], Dir[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\classes], Jar[path=E:\Dev\apache-tomcat-8.0.44\bin\bootstrap.jar], Jar[path=E:\Dev\apache-tomcat-8.0.44\bin\tomcat-juli.jar]]
[DEBUG] 09:40:53.221 org.nutz.resource.Scans.init(Scans.java:105) - Locations for Scans:
{E:\Dev\apache-tomcat-8.0.44\bin=Dir[path=E:\Dev\apache-tomcat-8.0.44\bin], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\nutz-1.r.60.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\nutz-1.r.60.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\classes=Dir[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\classes], E:\Dev\apache-tomcat-8.0.44\bin\bootstrap.jar=Jar[path=E:\Dev\apache-tomcat-8.0.44\bin\bootstrap.jar], E:\Dev\apache-tomcat-8.0.44\bin\tomcat-juli.jar=Jar[path=E:\Dev\apache-tomcat-8.0.44\bin\tomcat-juli.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\nutz-integration-shiro-1.r.60.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\nutz-integration-shiro-1.r.60.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\javax.servlet-api-3.1.0.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\javax.servlet-api-3.1.0.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\quartz-2.2.1.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\quartz-2.2.1.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\commons-logging-1.2.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\commons-logging-1.2.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\guice-multibindings-3.0.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\guice-multibindings-3.0.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\taglibs-standard-spec-1.2.5.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\taglibs-standard-spec-1.2.5.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\aopalliance-1.0.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\aopalliance-1.0.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\nutz-integration-quartz-1.r.60.r2.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\nutz-integration-quartz-1.r.60.r2.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\commons-collections-3.2.1.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\commons-collections-3.2.1.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\druid-1.0.26.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\druid-1.0.26.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\mysql-connector-java-5.1.40.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\mysql-connector-java-5.1.40.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\c3p0-0.9.1.1.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\c3p0-0.9.1.1.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\shiro-all-1.3.2.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\shiro-all-1.3.2.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\taglibs-standard-impl-1.2.5.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\taglibs-standard-impl-1.2.5.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\guice-3.0.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\guice-3.0.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\javax.inject-1.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\javax.inject-1.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\slf4j-api-1.7.12.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\slf4j-api-1.7.12.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\shiro-guice-1.3.2.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\shiro-guice-1.3.2.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\commons-beanutils-1.9.2.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\commons-beanutils-1.9.2.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\shiro-core-1.3.2.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\shiro-core-1.3.2.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\shiro-web-1.3.2.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\shiro-web-1.3.2.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\log4j-1.2.17.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\log4j-1.2.17.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\taglibs-standard-jstlel-1.2.5.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\taglibs-standard-jstlel-1.2.5.jar], F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\jstl-1.2.jar=Jar[path=F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\lib\jstl-1.2.jar]}
[DEBUG] 09:40:53.275 org.nutz.castor.Castors.reload(Castors.java:115) - Using 95 castor for Castors
[DEBUG] 09:40:53.288 org.nutz.mvc.config.AbstractNutConfig.createLoading(AbstractNutConfig.java:59) - Loading by class org.nutz.mvc.impl.NutLoading
[INFO ] 09:40:53.291 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:55) - Nutz Version : 1.r.60
[INFO ] 09:40:53.292 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:56) - Nutz.Mvc[nutz] is initializing ...
[DEBUG] 09:40:53.293 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:60) - Web Container Information:
[DEBUG] 09:40:53.294 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:61) - - Default Charset : UTF-8
[DEBUG] 09:40:53.294 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:62) - - Current . path : E:\Dev\apache-tomcat-8.0.44\bin\.
[DEBUG] 09:40:53.294 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:63) - - Java Version : 1.8.0_131
[DEBUG] 09:40:53.295 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:64) - - File separator : \
[DEBUG] 09:40:53.295 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:65) - - Timezone : Asia/Shanghai
[DEBUG] 09:40:53.295 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:66) - - OS : Windows 10 amd64
[DEBUG] 09:40:53.296 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:67) - - ServerInfo : Apache Tomcat/8.0.44
[DEBUG] 09:40:53.296 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:68) - - Servlet API : 3.1
[DEBUG] 09:40:53.297 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:73) - - ContextPath : /nutzbook
[DEBUG] 09:40:53.297 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:74) - - context.tempdir : C:\Users\17194\.IntelliJIdea2017.1\system\tomcat\Unnamed_ShiroForNutzDemo\work\Catalina\localhost\nutzbook
[DEBUG] 09:40:53.298 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:75) - - MainModule : net.wendal.nutzbook.MainModule
[DEBUG] 09:40:53.299 org.nutz.mvc.impl.NutLoading.createContext(NutLoading.java:238) - >> app.root = F:/gitResp/ShiroForNutzDemo/target/ShiroForNutzDemo
[DEBUG] 09:40:53.302 org.nutz.mvc.impl.NutLoading.createIoc(NutLoading.java:379) - @IocBy(type=org.nutz.mvc.ioc.provider.ComboIocProvider, args=["*js", "ioc/", "*anno", "net.wendal.nutzbook", "*tx", "*quartz"],init=[])
[DEBUG] 09:40:53.321 org.nutz.resource.Scans.scan(Scans.java:274) - Found 1 resource by src( ioc/ ) , regex( ^(.+[.])(js|json)$ )
[DEBUG] 09:40:53.329 org.nutz.resource.Scans.scan(Scans.java:274) - Found 10 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
[INFO ] 09:40:53.383 org.nutz.ioc.loader.annotation.AnnotationIocLoader.<init>(AnnotationIocLoader.java:50) - Found 3 classes in 1 base-packages!
beans = ["userProfileModule", "baseModule", "userModule"]
[INFO ] 09:40:53.392 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:98) - NutIoc init begin ...
[INFO ] 09:40:53.394 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:115) - ... NutIoc init complete
[INFO ] 09:40:53.397 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:159) - Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
[DEBUG] 09:40:53.399 org.nutz.mvc.impl.NutLoading.createViewMakers(NutLoading.java:369) - @Views(DefaultViewMaker.class)
[DEBUG] 09:40:53.409 org.nutz.resource.Scans.scan(Scans.java:274) - Found 1 resource by src( mvc/nutzbook-mvc-chain.js ) , regex( ^(.+[.])(js|json)$ )
[DEBUG] 09:40:53.414 org.nutz.mvc.impl.chainconfig.JsonActionChainMakerConfiguretion.<init>(JsonActionChainMakerConfiguretion.java:37) - ActionChain Config:
{
"default": {
"ps": ["net.wendal.nutzbook.mvc.LogTimeProcessor", "org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor", "org.nutz.mvc.impl.processor.EncodingProcessor", "org.nutz.mvc.impl.processor.ModuleProcessor", "!org.nutz.integration.shiro.NutShiroProcessor", "org.nutz.mvc.impl.processor.ActionFiltersProcessor", "org.nutz.mvc.impl.processor.AdaptorProcessor", "org.nutz.mvc.impl.processor.MethodInvokeProcessor", "org.nutz.mvc.impl.processor.ViewProcessor"],
"error": "org.nutz.mvc.impl.processor.FailProcessor"
}
}
[DEBUG] 09:40:53.414 org.nutz.mvc.impl.NutLoading.createChainMaker(NutLoading.java:266) - @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)
[DEBUG] 09:40:53.422 org.nutz.resource.Scans.scan(Scans.java:274) - Found 10 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
[DEBUG] 09:40:53.473 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/' >> (UserModule.java:35).index : void | @Ok(jsp:jsp.user.list) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
[DEBUG] 09:40:53.499 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/add' >> (UserModule.java:62).add : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
[DEBUG] 09:40:53.500 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/count' >> (UserModule.java:51).count : int | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
[DEBUG] 09:40:53.502 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/update' >> (UserModule.java:76).update : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
[DEBUG] 09:40:53.522 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/delete' >> (UserModule.java:92).delete : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
[DEBUG] 09:40:53.531 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/query' >> (UserModule.java:103).query : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
[DEBUG] 09:40:53.534 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/test' >> (UserModule.java:147).test : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
[DEBUG] 09:40:53.545 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/logout' >> (UserModule.java:57).logout : void | @Ok(>>:/ ) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
[DEBUG] 09:40:53.546 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/login' >> (UserModule.java:40).login : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
[DEBUG] 09:40:53.551 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/profile/' >> (UserProfileModule.java:130).index : UserProfile | @Ok(jsp:jsp.user.profile) @Fail(null ) | by 1 Filters | (I:UTF-8/O:UTF-8)
[DEBUG] 09:40:53.552 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/profile/get' >> (UserProfileModule.java:39).get : UserProfile | @Ok(null ) @Fail(null ) | by 1 Filters | (I:UTF-8/O:UTF-8)
[DEBUG] 09:40:53.553 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/profile/update' >> (UserProfileModule.java:54).update : void | @Ok(void ) @Fail(null ) | by 1 Filters | (I:UTF-8/O:UTF-8)
[INFO ] 09:40:53.562 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:23) - Init file-pool by: F:/gitResp/ShiroForNutzDemo/target/ShiroForNutzDemo/WEB-INF/tmp/user_avatar [20000]
[DEBUG] 09:40:53.565 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:37) - file-pool.home: 'F:\gitResp\ShiroForNutzDemo\target\ShiroForNutzDemo\WEB-INF\tmp\user_avatar'
[INFO ] 09:40:53.566 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:66) - file-pool.cursor: 0
[DEBUG] 09:40:53.570 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/profile/avatar' >> (UserProfileModule.java:86).uploadAvatar : void | @Ok(>>:/user/profile) @Fail(null ) | by 1 Filters | (I:UTF-8/O:UTF-8)
[DEBUG] 09:40:53.572 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/profile/avatar' >> (UserProfileModule.java:117).readAvatar : Object | @Ok(raw:jpg) @Fail(null ) | by 1 Filters | (I:UTF-8/O:UTF-8)
[INFO ] 09:40:53.573 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:220) - Found 14 module methods
[DEBUG] 09:40:53.573 org.nutz.mvc.impl.NutLoading.evalLocalization(NutLoading.java:334) - @Localization not define
[INFO ] 09:40:53.575 org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:274) - Setup application...
[DEBUG] 09:40:53.639 org.nutz.resource.Scans.scan(Scans.java:274) - Found 1 resource by src( custom/ ) , regex( ^.+[.]properties$ )
[INFO ] 09:40:53.736 com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:715) - {dataSource-1} inited
[INFO ] 09:40:53.764 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:23) - Init file-pool by: C:\Users\17194/.nutz/tmp/dao/ [200000]
[DEBUG] 09:40:53.764 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:37) - file-pool.home: 'C:\Users\17194\.nutz\tmp\dao'
[INFO ] 09:40:53.764 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:66) - file-pool.cursor: 0
[INFO ] 09:40:53.771 org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:103) - Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
[DEBUG] 09:40:54.014 org.nutz.resource.Scans.scan(Scans.java:274) - Found 3 resource by src( net/wendal/nutzbook/bean/ ) , regex( ^.+[.]class$ )
[INFO ] 09:40:54.224 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:141) - Nutz.Mvc[nutz] is up in 925ms
[INFO ] 09:40:54.224 org.nutz.mvc.NutFilter._init(NutFilter.java:113) - exclusionsPrefix = ^(/rs/|/druid/)
[2017-06-15 09:40:54,248] Artifact ShiroForNutzDemo:war exploded: Artifact is deployed successfully
[2017-06-15 09:40:54,248] Artifact ShiroForNutzDemo:war exploded: Deploy took 2,971 milliseconds
昨天是好的,但是今天就坏了,不知道哪里搞错了...