src
/com
/common
/report
MainModule.java
/config
/nutz
/config.js
app.properties
log4j.properties
//org.apache.commons.dbcp.BasicDataSource
var ioc = {
appConfig : {
type : "org.nutz.ioc.impl.PropertiesProxy",
fields : {
paths : ["app.properties"]
}
},
dataSource : {
type : "com.alibaba.druid.pool.DruidDataSource",
events : {
depose : 'close'
},
fields : {
driverClassName : {
java : "$appConfig.get('db.driver')"
},
url : {
java : "$appConfig.get('db.url')"
},
username : {
java : "$appConfig.get('db.username')"
},
password : {
java : "$appConfig.get('db.password')"
}
}
},
dao : {
type : 'org.nutz.dao.impl.NutDao',
args : [{
refer : "dataSource"
}]
}
// ,
// driver : {
// type : 'java.lang.String',
// args : [{java :"$appConfig.get('driver')"}]
// }
};
package com;
import org.nutz.mvc.annotation.Encoding;
import org.nutz.mvc.annotation.IocBy;
import org.nutz.mvc.annotation.Localization;
import org.nutz.mvc.annotation.Modules;
import org.nutz.mvc.annotation.SetupBy;
import org.nutz.mvc.ioc.provider.ComboIocProvider;
import com.common.base.BaseAction;
import com.common.setup.CommonSetup;
@Modules(value = { BaseAction.class }, scanPackage = true)
@IocBy(type = ComboIocProvider.class, args = { "*org.nutz.ioc.loader.json.JsonLoader", "config/nutz", "*org.nutz.ioc.loader.annotation.AnnotationIocLoader", "config/nutz/config.js" })
@Encoding(input = "UTF-8", output = "UTF-8")
@Localization("msg")
public class MainModule {
}
控制台报错问题:
[INFO ] 20:50:37.780 org.nutz.mvc.NutFilter._init(NutFilter.java:81) - NutFilter[nutz] starting ...
[DEBUG] 20:50:37.940 org.nutz.resource.Scans.<init>(Scans.java:509) - Locations for Scans:
[Dir[path=D:\Tomcat7.0\bin], Jar[path=D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\nutz-1.r.60.jar], Dir[path=D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\classes], Jar[path=D:\Tomcat7.0\bin\bootstrap.jar], Jar[path=D:\Tomcat7.0\bin\tomcat-juli.jar], Jar[path=D:\MyEclipse2014\binary\com.sun.java.jdk7.win32.x86_64_1.7.0.u45\lib\tools.jar]]
[DEBUG] 20:50:38.100 org.nutz.resource.Scans.init(Scans.java:105) - Locations for Scans:
{D:\Tomcat7.0\bin=Dir[path=D:\Tomcat7.0\bin], D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\nutz-1.r.60.jar=Jar[path=D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\nutz-1.r.60.jar], D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\classes=Dir[path=D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\classes], D:\Tomcat7.0\bin\bootstrap.jar=Jar[path=D:\Tomcat7.0\bin\bootstrap.jar], D:\Tomcat7.0\bin\tomcat-juli.jar=Jar[path=D:\Tomcat7.0\bin\tomcat-juli.jar], D:\MyEclipse2014\binary\com.sun.java.jdk7.win32.x86_64_1.7.0.u45\lib\tools.jar=Jar[path=D:\MyEclipse2014\binary\com.sun.java.jdk7.win32.x86_64_1.7.0.u45\lib\tools.jar], D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\mysql-connector-java-5.0.4-bin.jar=Jar[path=D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\mysql-connector-java-5.0.4-bin.jar], D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\nutz-1.r.60-sources.jar=Jar[path=D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\nutz-1.r.60-sources.jar], D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\slf4j-api-1.7.9.jar=Jar[path=D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\slf4j-api-1.7.9.jar], D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\log4j-1.2.17.jar=Jar[path=D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\log4j-1.2.17.jar], D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\javax.servlet.jsp.jstl.jar=Jar[path=D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\javax.servlet.jsp.jstl.jar], D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\nutz-1.r.60-javadoc.jar=Jar[path=D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\nutz-1.r.60-javadoc.jar], D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\jstl-impl.jar=Jar[path=D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\jstl-impl.jar], D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\slf4j-jdk14-1.7.9.jar=Jar[path=D:\Tomcat7.0\webapps\ReportManagementV1\WEB-INF\lib\slf4j-jdk14-1.7.9.jar]}
[DEBUG] 20:50:38.174 org.nutz.castor.Castors.reload(Castors.java:115) - Using 95 castor for Castors
[DEBUG] 20:50:38.192 org.nutz.mvc.config.AbstractNutConfig.createLoading(AbstractNutConfig.java:59) - Loading by class org.nutz.mvc.impl.NutLoading
[INFO ] 20:50:38.194 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:55) - Nutz Version : 1.r.60
[INFO ] 20:50:38.195 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:56) - Nutz.Mvc[nutz] is initializing ...
[DEBUG] 20:50:38.195 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:60) - Web Container Information:
[DEBUG] 20:50:38.196 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:61) - - Default Charset : GBK
[DEBUG] 20:50:38.196 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:62) - - Current . path : D:\Tomcat7.0\bin\.
[DEBUG] 20:50:38.196 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:63) - - Java Version : 1.7.0_45
[DEBUG] 20:50:38.196 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:64) - - File separator : \
[DEBUG] 20:50:38.196 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:65) - - Timezone : Asia/Shanghai
[DEBUG] 20:50:38.197 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:66) - - OS : Windows 8 amd64
[DEBUG] 20:50:38.197 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:67) - - ServerInfo : Apache Tomcat/7.0.68
[DEBUG] 20:50:38.197 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:68) - - Servlet API : 3.0
[DEBUG] 20:50:38.199 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:73) - - ContextPath : /ReportManagementV1
[DEBUG] 20:50:38.199 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:74) - - context.tempdir : D:\Tomcat7.0\work\Catalina\localhost\ReportManagementV1
[DEBUG] 20:50:38.200 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:75) - - MainModule : com.MainModule
[DEBUG] 20:50:38.201 org.nutz.mvc.impl.NutLoading.createContext(NutLoading.java:238) - >> app.root = D:/Tomcat7.0/webapps/ReportManagementV1
[DEBUG] 20:50:38.203 org.nutz.mvc.impl.NutLoading.createIoc(NutLoading.java:379) - @IocBy(type=org.nutz.mvc.ioc.provider.ComboIocProvider, args=["*js", "config/nutz", "*anno", "com", "*tx", "*async"],init=[])
[DEBUG] 20:50:38.228 org.nutz.resource.Scans.scan(Scans.java:274) - Found 1 resource by src( config/nutz ) , regex( ^(.+[.])(js|json)$ )
[DEBUG] 20:50:38.229 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:48) - loading ioc js config from [config.js]
[DEBUG] 20:50:38.235 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:56) - Loaded 3 bean define from path=[config/nutz] --> [dataSource, dao, appConfig]
[DEBUG] 20:50:54.580 org.nutz.resource.Scans.scan(Scans.java:274) - Found 3807 resource by src( com/ ) , regex( ^.+[.]class$ )
[INFO ] 20:50:56.126 org.nutz.resource.Scans.rs2class(Scans.java:422) - Resource can't map to Class, Resource mysql/jdbc/integration/c3p0/MysqlConnectionTester.class
[INFO ] 20:50:56.146 org.nutz.resource.Scans.rs2class(Scans.java:422) - Resource can't map to Class, Resource mysql/jdbc/integration/jboss/ExtendedMysqlExceptionSorter.class
[INFO ] 20:50:56.167 org.nutz.resource.Scans.rs2class(Scans.java:422) - Resource can't map to Class, Resource mysql/jdbc/integration/jboss/MysqlValidConnectionChecker.class
[DEBUG] 20:50:56.190 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) - Found @IocBean : class com.common.base.BaseDao
[DEBUG] 20:50:56.205 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) - Found @IocBean : class com.report.action.SysAdminAction
[DEBUG] 20:50:56.215 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) - Found @IocBean : class com.report.dao.SysAdminDao
[INFO ] 20:50:56.492 org.nutz.ioc.loader.annotation.AnnotationIocLoader.<init>(AnnotationIocLoader.java:50) - Found 3 classes in 1 base-packages!
beans = ["baseDao", "sysAdminDao", "sysAdminAction"]
[DEBUG] 20:50:56.495 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:40) - Loaded 5 bean define from reader --
[txREPEATABLE_READ, txREAD_COMMITTED, txNONE, txSERIALIZABLE, txREAD_UNCOMMITTED]
[DEBUG] 20:50:56.496 org.nutz.ioc.aop.SimpleAopMaker.<init>(SimpleAopMaker.java:79) - Load AopConfigure for anno=org.nutz.aop.interceptor.async.Async by type=org.nutz.aop.interceptor.async.AsyncAopIocLoader
[INFO ] 20:50:56.499 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:98) - NutIoc init begin ...
[INFO ] 20:50:56.502 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:115) - ... NutIoc init complete
[INFO ] 20:50:56.505 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:159) - Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
[DEBUG] 20:50:56.507 org.nutz.mvc.impl.NutLoading.createViewMakers(NutLoading.java:369) - @Views(DefaultViewMaker.class)
[DEBUG] 20:50:56.514 org.nutz.mvc.impl.NutLoading.createChainMaker(NutLoading.java:266) - @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)
[DEBUG] 20:50:56.522 org.nutz.mvc.impl.Loadings.scanModules(Loadings.java:154) - module class location 'file:/D:/Tomcat7.0/webapps/ReportManagementV1/WEB-INF/classes/'
[DEBUG] 20:50:56.522 org.nutz.mvc.impl.Loadings.scanModules(Loadings.java:154) - module class location 'file:/D:/Tomcat7.0/webapps/ReportManagementV1/WEB-INF/classes/'
[DEBUG] 20:50:56.523 org.nutz.mvc.impl.Loadings.scanModuleInPackage(Loadings.java:184) - > scan 'com.common.base'
[DEBUG] 20:50:56.525 org.nutz.resource.Scans.scan(Scans.java:274) - Found 9 resource by src( com/common/base/ ) , regex( ^.+[.]class$ )
[DEBUG] 20:50:56.527 org.nutz.mvc.impl.Loadings.scanModuleInPackage(Loadings.java:184) - > scan 'com'
[DEBUG] 20:51:12.298 org.nutz.resource.Scans.scan(Scans.java:274) - Found 3807 resource by src( com/ ) , regex( ^.+[.]class$ )
[INFO ] 20:51:13.001 org.nutz.resource.Scans.rs2class(Scans.java:422) - Resource can't map to Class, Resource mysql/jdbc/integration/c3p0/MysqlConnectionTester.class
[INFO ] 20:51:13.023 org.nutz.resource.Scans.rs2class(Scans.java:422) - Resource can't map to Class, Resource mysql/jdbc/integration/jboss/ExtendedMysqlExceptionSorter.class
[INFO ] 20:51:13.046 org.nutz.resource.Scans.rs2class(Scans.java:422) - Resource can't map to Class, Resource mysql/jdbc/integration/jboss/MysqlValidConnectionChecker.class
[DEBUG] 20:51:13.050 org.nutz.mvc.impl.Loadings.checkModule(Loadings.java:198) - >> add 'com.report.action.SysAdminAction'
[INFO ] 20:51:13.627 org.nutz.mvc.impl.NutActionChainMaker.getProcessorByName(NutActionChainMaker.java:72) - Optional processor class not found, disabled : org.nutz.integration.shiro.NutShiroProcessor
[INFO ] 20:51:13.637 org.nutz.mvc.impl.NutActionChainMaker.getProcessorByName(NutActionChainMaker.java:72) - Optional processor class not found, disabled : org.nutz.plugins.validation.ValidationProcessor
[DEBUG] 20:51:13.642 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/sysAdmin/addsysadmin' >> (SysAdminAction.java:29).addSysAdmin : boolean | @Ok(json ) @Fail(null ) | by 0 Filters | (I:UTF-8/O:UTF-8)
[INFO ] 20:51:13.643 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:220) - Found 1 module methods
[DEBUG] 20:51:13.643 org.nutz.mvc.impl.NutLoading.evalLocalization(NutLoading.java:306) - Localization: org.nutz.mvc.impl.NutMessageLoader('msg') dft<>
[DEBUG] 20:51:13.644 org.nutz.resource.Scans.scan(Scans.java:274) - Found 0 resource by src( msg ) , regex( ^.+[.]properties$ )
[DEBUG] 20:51:13.644 org.nutz.mvc.impl.NutMessageLoader.load(NutMessageLoader.java:27) - Load Messages in 0 resource : [[]]
[DEBUG] 20:51:13.644 org.nutz.mvc.impl.NutMessageLoader.load(NutMessageLoader.java:95) - Message Loaded, size = 0
[INFO ] 20:51:13.645 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:141) - Nutz.Mvc[nutz] is up in 35444ms