MainModule:
@IocBy(type=ComboIocProvider.class, args={"*js", "ioc/",
"*anno", "com.wsd.oa",
"*tx", // 事务拦截 aop
"*async"}) // 异步执行aop
@Modules(scanPackage=true)
@Filters({@By(type=CheckSession.class)})
public class MainModule {
}
ioc/dao.js:
var ioc = {
conf : {
type : "org.nutz.ioc.impl.PropertiesProxy",
fields : {
paths : ["custom/"]
}
},
dataSource : {
factory : "$conf#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"}]
}
};
custom/db.properties:
db.url=jdbc:oracle:thin:@172.21.29.61:1521/orcl
db.username=wsd
db.password=wsd
#db.validationQuery=select 1
db.maxActive=100
db.testWhileIdle=true
db.filters=mergeStat
db.connectionProperties=druid.stat.slowSqlMillis=2000
#db.defaultAutoCommit=true
tomcat启动日志:
E:\program\apache-tomcat-8.0.44\bin\catalina.bat run
[2017-07-29 09:46:02,136] Artifact api:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE: "C:\Users\Administrator.PC-20170703OBGO\.IntelliJIdea2017.2\system\tomcat\Unnamed_api"
Using CATALINA_HOME: "E:\program\apache-tomcat-8.0.44"
Using CATALINA_TMPDIR: "E:\program\apache-tomcat-8.0.44\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_131"
Using CLASSPATH: "E:\program\apache-tomcat-8.0.44\bin\bootstrap.jar;E:\program\apache-tomcat-8.0.44\bin\tomcat-juli.jar"
Connected to the target VM, address: '127.0.0.1:50669', transport: 'socket'
29-Jul-2017 09:46:03.399 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.44
29-Jul-2017 09:46:03.403 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: May 10 2017 17:21:09 UTC
29-Jul-2017 09:46:03.403 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.44.0
29-Jul-2017 09:46:03.403 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 7
29-Jul-2017 09:46:03.403 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 6.1
29-Jul-2017 09:46:03.403 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
29-Jul-2017 09:46:03.404 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk1.8.0_131\jre
29-Jul-2017 09:46:03.404 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_131-b11
29-Jul-2017 09:46:03.404 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
29-Jul-2017 09:46:03.404 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\Administrator.PC-20170703OBGO\.IntelliJIdea2017.2\system\tomcat\Unnamed_api
29-Jul-2017 09:46:03.404 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: E:\program\apache-tomcat-8.0.44
29-Jul-2017 09:46:03.405 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\Administrator.PC-20170703OBGO\.IntelliJIdea2017.2\system\tomcat\Unnamed_api\conf\logging.properties
29-Jul-2017 09:46:03.405 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
29-Jul-2017 09:46:03.405 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:50669,suspend=y,server=n
29-Jul-2017 09:46:03.406 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfile.encoding=UTF-8
29-Jul-2017 09:46:03.406 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
29-Jul-2017 09:46:03.406 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
29-Jul-2017 09:46:03.406 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
29-Jul-2017 09:46:03.407 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
29-Jul-2017 09:46:03.407 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
29-Jul-2017 09:46:03.407 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
29-Jul-2017 09:46:03.407 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
29-Jul-2017 09:46:03.407 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=E:\program\apache-tomcat-8.0.44\endorsed
29-Jul-2017 09:46:03.407 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\Administrator.PC-20170703OBGO\.IntelliJIdea2017.2\system\tomcat\Unnamed_api
29-Jul-2017 09:46:03.410 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=E:\program\apache-tomcat-8.0.44
29-Jul-2017 09:46:03.410 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=E:\program\apache-tomcat-8.0.44\temp
29-Jul-2017 09:46:03.410 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.8.0_131\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Broadcom\Broadcom 802.11;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_131\bin;.
29-Jul-2017 09:46:03.595 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
29-Jul-2017 09:46:03.619 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
29-Jul-2017 09:46:03.624 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
29-Jul-2017 09:46:03.627 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
29-Jul-2017 09:46:03.628 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 718 ms
29-Jul-2017 09:46:03.682 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
29-Jul-2017 09:46:03.682 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.44
29-Jul-2017 09:46:03.698 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
29-Jul-2017 09:46:03.719 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
29-Jul-2017 09:46:03.724 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 95 ms
Connected to server
[2017-07-29 09:46:03,856] Artifact api:war exploded: Artifact is being deployed, please wait...
29-Jul-2017 09:46:05.045 信息 [RMI TCP Connection(4)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
[INFO ] 09:46:05.207 org.nutz.mvc.NutFilter._init(NutFilter.java:81) - NutFilter[nutz] starting ...
[DEBUG] 09:46:05.289 org.nutz.resource.Scans.<init>(Scans.java:509) - Locations for Scans:
[Dir[path=E:\program\apache-tomcat-8.0.44\bin], Jar[path=E:\111\api\target\api-1.0-SNAPSHOT\WEB-INF\lib\nutz-1.r.60.jar], Dir[path=E:\111\api\target\api-1.0-SNAPSHOT\WEB-INF\classes], Jar[path=E:\program\apache-tomcat-8.0.44\bin\bootstrap.jar], Jar[path=E:\program\apache-tomcat-8.0.44\bin\tomcat-juli.jar]]
[DEBUG] 09:46:05.386 org.nutz.resource.Scans.init(Scans.java:105) - Locations for Scans:
{E:\program\apache-tomcat-8.0.44\bin=Dir[path=E:\program\apache-tomcat-8.0.44\bin], E:\111\api\target\api-1.0-SNAPSHOT\WEB-INF\lib\nutz-1.r.60.jar=Jar[path=E:\111\api\target\api-1.0-SNAPSHOT\WEB-INF\lib\nutz-1.r.60.jar], E:\111\api\target\api-1.0-SNAPSHOT\WEB-INF\classes=Dir[path=E:\111\api\target\api-1.0-SNAPSHOT\WEB-INF\classes], E:\program\apache-tomcat-8.0.44\bin\bootstrap.jar=Jar[path=E:\program\apache-tomcat-8.0.44\bin\bootstrap.jar], E:\program\apache-tomcat-8.0.44\bin\tomcat-juli.jar=Jar[path=E:\program\apache-tomcat-8.0.44\bin\tomcat-juli.jar], E:\111\api\target\api-1.0-SNAPSHOT\WEB-INF\lib\log4j-1.2.17.jar=Jar[path=E:\111\api\target\api-1.0-SNAPSHOT\WEB-INF\lib\log4j-1.2.17.jar], E:\111\api\target\api-1.0-SNAPSHOT\WEB-INF\lib\javax.servlet-api-3.1.0.jar=Jar[path=E:\111\api\target\api-1.0-SNAPSHOT\WEB-INF\lib\javax.servlet-api-3.1.0.jar], E:\111\api\target\api-1.0-SNAPSHOT\WEB-INF\lib\druid-1.0.26.jar=Jar[path=E:\111\api\target\api-1.0-SNAPSHOT\WEB-INF\lib\druid-1.0.26.jar]}
[DEBUG] 09:46:05.495 org.nutz.castor.Castors.reload(Castors.java:115) - Using 95 castor for Castors
[DEBUG] 09:46:05.520 org.nutz.mvc.config.AbstractNutConfig.createLoading(AbstractNutConfig.java:59) - Loading by class org.nutz.mvc.impl.NutLoading
[INFO ] 09:46:05.526 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:55) - Nutz Version : 1.r.60
[INFO ] 09:46:05.527 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:56) - Nutz.Mvc[nutz] is initializing ...
[DEBUG] 09:46:05.528 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:60) - Web Container Information:
[DEBUG] 09:46:05.531 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:61) - - Default Charset : UTF-8
[DEBUG] 09:46:05.531 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:62) - - Current . path : E:\program\apache-tomcat-8.0.44\bin\.
[DEBUG] 09:46:05.532 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:63) - - Java Version : 1.8.0_131
[DEBUG] 09:46:05.532 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:64) - - File separator : \
[DEBUG] 09:46:05.533 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:65) - - Timezone : Asia/Shanghai
[DEBUG] 09:46:05.533 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:66) - - OS : Windows 7 amd64
[DEBUG] 09:46:05.535 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:67) - - ServerInfo : Apache Tomcat/8.0.44
[DEBUG] 09:46:05.536 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:68) - - Servlet API : 3.1
[DEBUG] 09:46:05.538 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:73) - - ContextPath :
[DEBUG] 09:46:05.539 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:74) - - context.tempdir : C:\Users\Administrator.PC-20170703OBGO\.IntelliJIdea2017.2\system\tomcat\Unnamed_api\work\Catalina\localhost\ROOT
[DEBUG] 09:46:05.539 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:75) - - MainModule : com.wsd.oa.MainModule
[DEBUG] 09:46:05.541 org.nutz.mvc.impl.NutLoading.createContext(NutLoading.java:238) - >> app.root = E:/111/api/target/api-1.0-SNAPSHOT
[DEBUG] 09:46:05.562 org.nutz.mvc.impl.NutLoading.createIoc(NutLoading.java:379) - @IocBy(type=org.nutz.mvc.ioc.provider.ComboIocProvider, args=["*js", "ioc/", "*anno", "com.wsd.oa", "*tx", "*async"],init=[])
[DEBUG] 09:46:05.593 org.nutz.resource.Scans.scan(Scans.java:274) - Found 1 resource by src( ioc/ ) , regex( ^(.+[.])(js|json)$ )
[DEBUG] 09:46:05.594 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:48) - loading ioc js config from [dao.js]
[DEBUG] 09:46:05.594 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:48) - loading ioc js config from [dao.js]
[DEBUG] 09:46:05.601 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:56) - Loaded 3 bean define from path=[ioc/] --> [conf, dao, dataSource]
[DEBUG] 09:46:05.601 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:56) - Loaded 3 bean define from path=[ioc/] --> [conf, dao, dataSource]
[DEBUG] 09:46:05.606 org.nutz.resource.Scans.scan(Scans.java:274) - Found 5 resource by src( com/wsd/oa/ ) , regex( ^.+[.]class$ )
[WARN ] 09:46:05.621 org.nutz.ioc.loader.annotation.AnnotationIocLoader.<init>(AnnotationIocLoader.java:55) - NONE Annotation-Class found!! Check your ioc configure!! packages=[com.wsd.oa]
[WARN ] 09:46:05.621 org.nutz.ioc.loader.annotation.AnnotationIocLoader.<init>(AnnotationIocLoader.java:55) - NONE Annotation-Class found!! Check your ioc configure!! packages=[com.wsd.oa]
[DEBUG] 09:46:05.624 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:40) - Loaded 5 bean define from reader --
[txREPEATABLE_READ, txSERIALIZABLE, txNONE, txREAD_UNCOMMITTED, txREAD_COMMITTED]
[DEBUG] 09:46:05.624 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:40) - Loaded 5 bean define from reader --
[txREPEATABLE_READ, txSERIALIZABLE, txNONE, txREAD_UNCOMMITTED, txREAD_COMMITTED]
[DEBUG] 09:46:05.627 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
[DEBUG] 09:46:05.627 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 ] 09:46:05.632 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:98) - NutIoc init begin ...
[INFO ] 09:46:05.632 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:98) - NutIoc init begin ...
[INFO ] 09:46:05.636 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:115) - ... NutIoc init complete
[INFO ] 09:46:05.636 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:115) - ... NutIoc init complete
[INFO ] 09:46:05.641 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:159) - Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
[DEBUG] 09:46:05.644 org.nutz.mvc.impl.NutLoading.createViewMakers(NutLoading.java:369) - @Views(DefaultViewMaker.class)
[DEBUG] 09:46:05.654 org.nutz.mvc.impl.NutLoading.createChainMaker(NutLoading.java:266) - @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)
[DEBUG] 09:46:05.665 org.nutz.mvc.impl.Loadings.scanModules(Loadings.java:154) - module class location 'file:/E:/111/api/target/api-1.0-SNAPSHOT/WEB-INF/classes/'
[DEBUG] 09:46:05.665 org.nutz.mvc.impl.Loadings.scanModules(Loadings.java:154) - module class location 'file:/E:/111/api/target/api-1.0-SNAPSHOT/WEB-INF/classes/'
[DEBUG] 09:46:05.666 org.nutz.mvc.impl.Loadings.scanModuleInPackage(Loadings.java:184) - > scan 'com.wsd.oa'
[DEBUG] 09:46:05.666 org.nutz.mvc.impl.Loadings.scanModuleInPackage(Loadings.java:184) - > scan 'com.wsd.oa'
[DEBUG] 09:46:05.670 org.nutz.resource.Scans.scan(Scans.java:274) - Found 5 resource by src( com/wsd/oa/ ) , regex( ^.+[.]class$ )
[DEBUG] 09:46:05.673 org.nutz.mvc.impl.Loadings.checkModule(Loadings.java:198) - >> add 'com.wsd.oa.controller.UserController'
[DEBUG] 09:46:05.673 org.nutz.mvc.impl.Loadings.checkModule(Loadings.java:198) - >> add 'com.wsd.oa.controller.UserController'
[INFO ] 09:46:05.681 org.nutz.mvc.impl.processor.ModuleProcessor.init(ModuleProcessor.java:61) - Create Module obj without Ioc --> class com.wsd.oa.controller.UserController
[INFO ] 09:46:05.684 org.nutz.mvc.impl.NutActionChainMaker.getProcessorByName(NutActionChainMaker.java:72) - Optional processor class not found, disabled : org.nutz.integration.shiro.NutShiroProcessor
[INFO ] 09:46:05.701 org.nutz.mvc.impl.NutActionChainMaker.getProcessorByName(NutActionChainMaker.java:72) - Optional processor class not found, disabled : org.nutz.plugins.validation.ValidationProcessor
[DEBUG] 09:46:05.735 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/index' >> (UserController.java:13).index : Object | @Ok(json ) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
[DEBUG] 09:46:05.739 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) - '/user/logout' >> (UserController.java:19).logout : Object | @Ok(json ) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
[INFO ] 09:46:05.739 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:220) - Found 2 module methods
[DEBUG] 09:46:05.743 org.nutz.mvc.impl.NutLoading.evalLocalization(NutLoading.java:334) - @Localization not define
[INFO ] 09:46:05.746 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:141) - Nutz.Mvc[nutz] is up in 205ms
[INFO ] 09:46:05.747 org.nutz.mvc.NutFilter._init(NutFilter.java:113) - exclusionsPrefix = ^(/rs/|/druid/)
[2017-07-29 09:46:05,820] Artifact api:war exploded: Artifact is deployed successfully
[2017-07-29 09:46:05,820] Artifact api:war exploded: Deploy took 1,964 milliseconds
[DEBUG] 09:46:06.042 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) - Search mapping for [GET] path=/ : NOT Action match
[DEBUG] 09:46:06.063 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) - Search mapping for [GET] path=/ : NOT Action match
[DEBUG] 09:46:06.392 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) - Search mapping for [GET] path=/ : NOT Action match
29-Jul-2017 09:46:13.702 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory E:\program\apache-tomcat-8.0.44\webapps\manager
29-Jul-2017 09:46:13.776 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory E:\program\apache-tomcat-8.0.44\webapps\manager has finished in 73 ms
为啥不见nutzdao出来?