NutzCN Logo
问答 求sqltpl使用手册,或者模板
发布于 2661天前 作者 jeasonsilver 1564 次浏览 复制 上一个帖子 下一个帖子
标签:

需要动态拼接sql条件用

16 回复

源码里面有demo

String dst = sql.toPreparedStatement().replaceAll("[ \t\n\r]", "");
assertEquals("select * from t_user where name = ? and passwd = ?".replaceAll(" ", ""), dst);
上边 模型中这两行是干什么用的,可以不带这他们吗?
SqlManager sqlm = new FileSqlManager("conf/sqls/WarningDetail");
Sql sql = sqlm.create("user.fetch");
sql.setParam("name",name).setParam("cat_name",cat_name);

那是个testcase, 判断一下SQL是否正确嘛... 正常使用当然是不需要的

SQL文件路径是 conf/sqls/WarningDetail/sqls.sqls,但是他报找不到

模型的test包下为什么是.sqls

conf目录是个源文件夹?改成

SqlManager sqlm = new FileSqlManager("sqls/");

conf(maven:resouse)/sqls/WarningDetail.sql
代码:
SqlManager sqlm = new FileSqlManager("conf/sqls/");
Sql sql = sqlm.create("WarningData.query");
.sql文件:
/* WarningData.query */
SELECT……
日志:
org.nutz.dao.SqlNotFoundException: fail to find SQL 'WarningData.query'!

回复按钮旁边还有个按钮!

把日志完整发一下

2017-08-03 14:47:58,414 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) WARN  - Error@/warning/query/detailed :
org.nutz.dao.SqlNotFoundException: fail to find SQL 'WarningData.query'!
	at org.nutz.dao.impl.FileSqlManager.get(FileSqlManager.java:130)
	at org.nutz.dao.impl.FileSqlManager.create(FileSqlManager.java:135)
	at net.nutz.wcc.server.WarningServer.QueryDetailed(WarningServer.java:39)
	at net.nutz.wcc.controller.WarningAction.QueryDetailed(WarningAction.java:58)
	at net.nutz.wcc.controller.WarningAction$FM$QueryDetailed$8101c8b5c0af664cebe32906dd0e2c2a.invoke(WarningAction.java)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:31)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	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:202)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

E:\Work\InstelliJIDEAR_TomcatNo.2\apache-tomcat-8.5.14\bin\catalina.bat run
[2017-08-03 02:47:35,118] Artifact wcc:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE:   "C:\Users\lenovo\.IntelliJIdea2017.2\system\tomcat\Unnamed_wcc"
Using CATALINA_HOME:   "E:\Work\InstelliJIDEAR_TomcatNo.2\apache-tomcat-8.5.14"
Using CATALINA_TMPDIR: "E:\Work\InstelliJIDEAR_TomcatNo.2\apache-tomcat-8.5.14\temp"
Using JRE_HOME:        "D:\Software_Develops\JDK"
Using CLASSPATH:       "E:\Work\InstelliJIDEAR_TomcatNo.2\apache-tomcat-8.5.14\bin\bootstrap.jar;E:\Work\InstelliJIDEAR_TomcatNo.2\apache-tomcat-8.5.14\bin\tomcat-juli.jar"
Connected to the target VM, address: '127.0.0.1:57862', transport: 'socket'
03-Aug-2017 14:47:36.198 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.14
03-Aug-2017 14:47:36.202 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Apr 13 2017 12:55:45 UTC
03-Aug-2017 14:47:36.202 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.14.0
03-Aug-2017 14:47:36.202 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows 10
03-Aug-2017 14:47:36.202 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            10.0
03-Aug-2017 14:47:36.202 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
03-Aug-2017 14:47:36.202 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             D:\Software_Develops\JDK\jre
03-Aug-2017 14:47:36.203 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_121-b13
03-Aug-2017 14:47:36.203 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
03-Aug-2017 14:47:36.203 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\Users\lenovo\.IntelliJIdea2017.2\system\tomcat\Unnamed_wcc
03-Aug-2017 14:47:36.203 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         E:\Work\InstelliJIDEAR_TomcatNo.2\apache-tomcat-8.5.14
03-Aug-2017 14:47:36.203 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfile.encoding=UTF-8
03-Aug-2017 14:47:36.203 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\lenovo\.IntelliJIdea2017.2\system\tomcat\Unnamed_wcc\conf\logging.properties
03-Aug-2017 14:47:36.203 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
03-Aug-2017 14:47:36.204 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:57862,suspend=y,server=n
03-Aug-2017 14:47:36.204 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfile.encoding=UTF-8
03-Aug-2017 14:47:36.204 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
03-Aug-2017 14:47:36.204 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
03-Aug-2017 14:47:36.204 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
03-Aug-2017 14:47:36.204 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
03-Aug-2017 14:47:36.204 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
03-Aug-2017 14:47:36.205 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
03-Aug-2017 14:47:36.205 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
03-Aug-2017 14:47:36.206 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\lenovo\.IntelliJIdea2017.2\system\tomcat\Unnamed_wcc
03-Aug-2017 14:47:36.206 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=E:\Work\InstelliJIDEAR_TomcatNo.2\apache-tomcat-8.5.14
03-Aug-2017 14:47:36.206 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=E:\Work\InstelliJIDEAR_TomcatNo.2\apache-tomcat-8.5.14\temp
03-Aug-2017 14:47:36.206 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library 1.2.12 using APR version 1.5.2.
03-Aug-2017 14:47:36.206 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
03-Aug-2017 14:47:36.206 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
03-Aug-2017 14:47:37.245 信息 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.2k  26 Jan 2017)
03-Aug-2017 14:47:37.387 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
03-Aug-2017 14:47:37.414 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
03-Aug-2017 14:47:37.417 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
03-Aug-2017 14:47:37.419 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
03-Aug-2017 14:47:37.419 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1663 ms
03-Aug-2017 14:47:37.465 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
03-Aug-2017 14:47:37.466 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.14
03-Aug-2017 14:47:37.492 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
03-Aug-2017 14:47:37.508 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
03-Aug-2017 14:47:37.512 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 93 ms
Connected to server
[2017-08-03 02:47:37,721] Artifact wcc:war exploded: Artifact is being deployed, please wait...
03-Aug-2017 14:47:39.292 信息 [RMI TCP Connection(3)-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.
2017-08-03 14:47:39,561 org.nutz.mvc.NutFilter._init(NutFilter.java:85) INFO  - NutFilter[nutz] starting ...
2017-08-03 14:47:39,593 org.nutz.resource.Scans.printLocations(Scans.java:521) DEBUG - Locations count=4 time use 11ms
2017-08-03 14:47:39,622 org.nutz.resource.Scans.printLocations(Scans.java:521) DEBUG - Locations count=12 time use 28ms
2017-08-03 14:47:39,757 org.nutz.castor.Castors.reload(Castors.java:115) DEBUG - Using 95 castor for Castors
2017-08-03 14:47:39,787 org.nutz.mvc.config.AbstractNutConfig.createLoading(AbstractNutConfig.java:59) DEBUG - Loading by class org.nutz.mvc.impl.NutLoading
2017-08-03 14:47:39,791 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:55) INFO  - Nutz Version : 1.r.62 
2017-08-03 14:47:39,791 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:56) INFO  - Nutz.Mvc[nutz] is initializing ...
2017-08-03 14:47:39,791 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:60) DEBUG - Web Container Information:
2017-08-03 14:47:39,793 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:61) DEBUG -  - Default Charset : UTF-8
2017-08-03 14:47:39,793 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:62) DEBUG -  - Current . path  : E:\Work\InstelliJIDEAR_TomcatNo.2\apache-tomcat-8.5.14\bin\.
2017-08-03 14:47:39,793 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:63) DEBUG -  - Java Version    : 1.8.0_121
2017-08-03 14:47:39,794 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:64) DEBUG -  - File separator  : \
2017-08-03 14:47:39,794 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:65) DEBUG -  - Timezone        : Asia/Shanghai
2017-08-03 14:47:39,794 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:66) DEBUG -  - OS              : Windows 10 amd64
2017-08-03 14:47:39,795 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:67) DEBUG -  - ServerInfo      : Apache Tomcat/8.5.14
2017-08-03 14:47:39,795 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:68) DEBUG -  - Servlet API     : 3.1
2017-08-03 14:47:39,797 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:73) DEBUG -  - ContextPath     : /wcc
2017-08-03 14:47:39,797 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:74) DEBUG -  - context.tempdir : C:\Users\lenovo\.IntelliJIdea2017.2\system\tomcat\Unnamed_wcc\work\Catalina\localhost\wcc
2017-08-03 14:47:39,798 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:75) DEBUG -  - MainModule      : net.nutz.wcc.MainModule
2017-08-03 14:47:39,799 org.nutz.mvc.impl.NutLoading.createContext(NutLoading.java:235) DEBUG - >> app.root = E:/Work/InstelliJIDEAR_WorkSpaceNo.1/wcc/target/wcc
2017-08-03 14:47:39,806 org.nutz.mvc.impl.NutLoading.createIoc(NutLoading.java:376) DEBUG - @IocBy(type=org.nutz.mvc.ioc.provider.ComboIocProvider, args=["*js", "ioc/", "*anno", "net.nutz.wcc", "*tx", "*async"],init=[])
2017-08-03 14:47:39,923 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 1 resource by src( ioc/ ) , regex( ^(.+[.])(js|json)$ )
2017-08-03 14:47:39,923 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:49) DEBUG - loading [dao.js]
2017-08-03 14:47:39,931 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:57) DEBUG - Loaded 3 bean define from path=[ioc/] --> [conf, dao, dataSource]
2017-08-03 14:47:39,948 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 16 resource by src( net/nutz/wcc/ ) , regex( ^.+[.]class$ )
2017-08-03 14:47:39,969 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:76) DEBUG - Found @IocBean : class net.nutz.wcc.controller.WarningAction
2017-08-03 14:47:39,980 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:76) DEBUG - Found @IocBean : class net.nutz.wcc.module.UserModule
2017-08-03 14:47:39,982 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:76) DEBUG - Found @IocBean : class net.nutz.wcc.server.WarningServer
2017-08-03 14:47:40,008 org.nutz.ioc.loader.annotation.AnnotationIocLoader.<init>(AnnotationIocLoader.java:52) INFO  - Found 3 classes in 1 base-packages!
beans = ["warningAction", "warningServer", "userModule"]
2017-08-03 14:47:40,020 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:40) DEBUG - Loaded 5 bean define from reader --
[txREPEATABLE_READ, txSERIALIZABLE, txNONE, txREAD_UNCOMMITTED, txREAD_COMMITTED]
2017-08-03 14:47:40,082 org.nutz.ioc.aop.SimpleAopMaker.<init>(SimpleAopMaker.java:79) DEBUG - Load AopConfigure for anno=org.nutz.aop.interceptor.async.Async by type=org.nutz.aop.interceptor.async.AsyncAopIocLoader
2017-08-03 14:47:40,172 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:98) INFO  - NutIoc init begin ...
2017-08-03 14:47:40,176 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:115) INFO  - ... NutIoc init complete
2017-08-03 14:47:40,180 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:159) INFO  - Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
2017-08-03 14:47:40,184 org.nutz.mvc.impl.NutLoading.createViewMakers(NutLoading.java:366) DEBUG - @Views(DefaultViewMaker.class)
2017-08-03 14:47:40,194 org.nutz.mvc.impl.NutLoading.createChainMaker(NutLoading.java:263) DEBUG - @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)
2017-08-03 14:47:40,213 org.nutz.mvc.impl.Loadings.scanModules(Loadings.java:154) DEBUG - module class location 'file:/E:/Work/InstelliJIDEAR_WorkSpaceNo.1/wcc/target/wcc/WEB-INF/classes/'
2017-08-03 14:47:40,214 org.nutz.mvc.impl.Loadings.scanModuleInPackage(Loadings.java:184) DEBUG -  > scan 'net.nutz.wcc'
2017-08-03 14:47:40,224 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 16 resource by src( net/nutz/wcc/ ) , regex( ^.+[.]class$ )
2017-08-03 14:47:40,226 org.nutz.mvc.impl.Loadings.checkModule(Loadings.java:199) DEBUG -    >> add 'net.nutz.wcc.controller.WarningAction'
2017-08-03 14:47:40,227 org.nutz.mvc.impl.Loadings.checkModule(Loadings.java:199) DEBUG -    >> add 'net.nutz.wcc.module.UserModule'
2017-08-03 14:47:40,285 org.nutz.mvc.impl.NutActionChainMaker.getProcessorByName(NutActionChainMaker.java:72) INFO  - Optional processor class not found, disabled : org.nutz.integration.shiro.NutShiroProcessor
2017-08-03 14:47:40,341 org.nutz.mvc.impl.NutActionChainMaker.getProcessorByName(NutActionChainMaker.java:72) INFO  - Optional processor class not found, disabled : org.nutz.plugins.validation.ValidationProcessor
2017-08-03 14:47:40,399 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG -    '/user/count'               >> (UserModule.java:26).count            : int        | @Ok(json ) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2017-08-03 14:47:40,431 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG -    '/user/logout'              >> (UserModule.java:42).logout           : void       | @Ok(>>:/ ) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2017-08-03 14:47:40,443 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG -    '/user/login'               >> (UserModule.java:30).login            : Object     | @Ok(json ) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2017-08-03 14:47:40,446 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG -    '/warning/query/detailed'   >> (WarningAction.java:58).QueryDetailed : List       | @Ok(json ) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2017-08-03 14:47:40,447 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG -    '/warning/query/navigation' >> (WarningAction.java:39).QueryNavigation : List       | @Ok(json ) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2017-08-03 14:47:40,448 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG -    '/warning/query'            >> (WarningAction.java:65).QueryWaring   : List       | @Ok(json ) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2017-08-03 14:47:40,448 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:217) INFO  - Found 6 module methods
2017-08-03 14:47:40,449 org.nutz.mvc.impl.NutLoading.evalLocalization(NutLoading.java:303) DEBUG - Localization: org.nutz.mvc.impl.NutMessageLoader('msg/')  dft<zh-CN>
2017-08-03 14:47:40,455 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 1 resource by src( msg/ ) , regex( ^.+[.]properties$ )
2017-08-03 14:47:40,455 org.nutz.mvc.impl.NutMessageLoader.load(NutMessageLoader.java:27) DEBUG - Load Messages in 1 resource : [[File[E:\Work\InstelliJIDEAR_WorkSpaceNo.1\wcc\target\wcc\WEB-INF\classes\msg\user.properties]]]
2017-08-03 14:47:40,458 org.nutz.mvc.impl.NutMessageLoader.load(NutMessageLoader.java:95) DEBUG - Message Loaded, size = 1
2017-08-03 14:47:40,462 org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:271) INFO  - Setup application...
2017-08-03 14:47:40,469 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2017-08-03 14:47:40,469 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get '$aop_async'<interface org.nutz.ioc.aop.config.AopConfigration>
2017-08-03 14:47:40,471 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - 	 >> Load definition name=$aop_async
2017-08-03 14:47:40,476 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject($aop_async) in AsyncAopIocLoader@409475048
2017-08-03 14:47:40,476 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - 	 >> Make...'$aop_async'<interface org.nutz.ioc.aop.config.AopConfigration>
2017-08-03 14:47:40,478 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object '$aop_async' to [app] 
2017-08-03 14:47:40,493 org.nutz.ioc.aop.SimpleAopMaker.<init>(SimpleAopMaker.java:79) DEBUG - Load AopConfigure for anno=org.nutz.ioc.aop.Aop by type=org.nutz.ioc.aop.config.impl.AnnotationAopConfigration
2017-08-03 14:47:40,493 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - 	 >> Load definition name=dao
2017-08-03 14:47:40,494 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=dao
2017-08-03 14:47:40,499 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(dao) in JsonLoader(paths=[ioc/])
2017-08-03 14:47:40,500 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - 	 >> Make...'dao'<interface org.nutz.dao.Dao>
2017-08-03 14:47:40,535 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class org.nutz.dao.impl.NutDao without AOP
2017-08-03 14:47:40,536 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'dao' to [app] 
2017-08-03 14:47:40,538 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dataSource'<>
2017-08-03 14:47:40,538 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - 	 >> Load definition name=dataSource
2017-08-03 14:47:40,539 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=dataSource
2017-08-03 14:47:40,573 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(dataSource) in JsonLoader(paths=[ioc/])
2017-08-03 14:47:40,574 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - 	 >> Make...'dataSource'<>
2017-08-03 14:47:40,605 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class com.alibaba.druid.pool.DruidDataSource without AOP
2017-08-03 14:47:40,605 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'dataSource' to [app] 
2017-08-03 14:47:40,607 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'conf'<>
2017-08-03 14:47:40,607 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - 	 >> Load definition name=conf
2017-08-03 14:47:40,607 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=conf
2017-08-03 14:47:40,662 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(conf) in JsonLoader(paths=[ioc/])
2017-08-03 14:47:40,663 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - 	 >> Make...'conf'<>
2017-08-03 14:47:40,664 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class org.nutz.ioc.impl.PropertiesProxy without AOP
2017-08-03 14:47:40,666 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'conf' to [app] 
2017-08-03 14:47:40,777 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 1 resource by src( custom/ ) , regex( ^.+[.]properties$ )
2017-08-03 14:47:40,778 org.nutz.ioc.impl.PropertiesProxy.setPaths(PropertiesProxy.java:113) DEBUG - load properties from File[E:\Work\InstelliJIDEAR_WorkSpaceNo.1\wcc\target\wcc\WEB-INF\classes\custom\db.properties]
2017-08-03 14:47:41,513 com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:854) INFO  - {dataSource-1} inited
2017-08-03 14:47:41,515 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dataSource'<>
2017-08-03 14:47:42,256 org.nutz.dao.jdbc.Jdbcs.<clinit>(Jdbcs.java:90) DEBUG - Jdbcs init complete
2017-08-03 14:47:42,257 org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:103) INFO  - Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
Thu Aug 03 14:47:42 CST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2017-08-03 14:47:42,664 org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:188) DEBUG - select expert : org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert
2017-08-03 14:47:42,673 org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:199) DEBUG - JDBC Driver --> mysql-connector-java-5.1.40 ( Revision: 402933ef52cad9aa82624e80acbea46e3a701ce6 )
2017-08-03 14:47:42,673 org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:200) DEBUG - JDBC Name   --> MySQL Connector Java
2017-08-03 14:47:42,674 org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:202) DEBUG - JDBC URL    --> jdbc:mysql://127.0.0.1:3306/wcc
2017-08-03 14:47:42,815 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:206) DEBUG - Mysql : character_set_client=utf8
2017-08-03 14:47:42,815 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:206) DEBUG - Mysql : character_set_connection=utf8
2017-08-03 14:47:42,815 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:206) DEBUG - Mysql : character_set_database=utf8
2017-08-03 14:47:42,816 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:206) DEBUG - Mysql : character_set_filesystem=binary
2017-08-03 14:47:42,816 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:206) DEBUG - Mysql : character_set_results=
2017-08-03 14:47:42,817 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:206) DEBUG - Mysql : character_set_server=utf8
2017-08-03 14:47:42,817 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:206) DEBUG - Mysql : character_set_system=utf8
2017-08-03 14:47:42,818 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:206) DEBUG - Mysql : character_sets_dir=C:\Program Files\MySQL\MySQL Server 5.7\share\charsets\
2017-08-03 14:47:42,821 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:213) DEBUG - Mysql : binlog_format=ROW
2017-08-03 14:47:42,822 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:220) DEBUG - Mysql : database=wcc
2017-08-03 14:47:42,823 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:226) DEBUG - Mysql : user=root@localhost
2017-08-03 14:47:42,869 org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:221) DEBUG - Database info --> MYSQL:[MySQL - 5.7.17-log]
2017-08-03 14:47:42,878 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 16 resource by src( net/nutz/wcc/ ) , regex( ^.+[.]class$ )
2017-08-03 14:47:42,959 org.nutz.dao.jdbc.Jdbcs.guessEntityFieldColumnType(Jdbcs.java:863) DEBUG - take field 'use(net.nutz.wcc.bean.User)'(net.nutz.wcc.bean.WccConupdown) as VARCHAR(128)
2017-08-03 14:47:43,012 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT COUNT(*) FROM t_user 
2017-08-03 14:47:43,015 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:141) INFO  - Nutz.Mvc[nutz] is up in 3217ms
2017-08-03 14:47:43,015 org.nutz.mvc.NutFilter._init(NutFilter.java:117) INFO  - exclusionsPrefix  = ^(/rs/|/druid/)
[2017-08-03 02:47:43,042] Artifact wcc:war exploded: Artifact is deployed successfully
[2017-08-03 02:47:43,043] Artifact wcc:war exploded: Deploy took 5,322 milliseconds
2017-08-03 14:47:45,488 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/warning/query/navigation : WarningAction.QueryNavigation(WarningAction.java:39)
2017-08-03 14:47:45,491 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'warningAction'<class net.nutz.wcc.controller.WarningAction>
2017-08-03 14:47:45,491 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - 	 >> Load definition name=warningAction
2017-08-03 14:47:45,491 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(warningAction) in AnnotationIocLoader(packages=[net.nutz.wcc])
2017-08-03 14:47:45,492 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - 	 >> Make...'warningAction'<class net.nutz.wcc.controller.WarningAction>
2017-08-03 14:47:45,492 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class net.nutz.wcc.controller.WarningAction without AOP
2017-08-03 14:47:45,493 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'warningAction' to [app] 
2017-08-03 14:47:45,502 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2017-08-03 14:47:45,503 org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:64) DEBUG - name=warnSer not found, search for type=net.nutz.wcc.server.WarningServer
2017-08-03 14:47:45,503 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=conf
2017-08-03 14:47:45,504 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(conf) in JsonLoader(paths=[ioc/])
2017-08-03 14:47:45,505 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=dao
2017-08-03 14:47:45,505 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(dao) in JsonLoader(paths=[ioc/])
2017-08-03 14:47:45,505 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=dataSource
2017-08-03 14:47:45,506 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(dataSource) in JsonLoader(paths=[ioc/])
2017-08-03 14:47:45,506 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(warningAction) in AnnotationIocLoader(packages=[net.nutz.wcc])
2017-08-03 14:47:45,507 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(warningServer) in AnnotationIocLoader(packages=[net.nutz.wcc])
2017-08-03 14:47:45,507 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'warningServer'<class net.nutz.wcc.server.WarningServer>
2017-08-03 14:47:45,508 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - 	 >> Load definition name=warningServer
2017-08-03 14:47:45,508 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(warningServer) in AnnotationIocLoader(packages=[net.nutz.wcc])
2017-08-03 14:47:45,508 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - 	 >> Make...'warningServer'<class net.nutz.wcc.server.WarningServer>
2017-08-03 14:47:45,508 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class net.nutz.wcc.server.WarningServer without AOP
2017-08-03 14:47:45,508 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'warningServer' to [app] 
2017-08-03 14:47:45,834 org.nutz.service.EntityService.<init>(EntityService.java:41) DEBUG - Get TypeParams for self : net.nutz.wcc.bean.WccCatdata
2017-08-03 14:47:45,835 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dao'<>
2017-08-03 14:47:45,987 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - Select DISTINCT(cat_name) FROM fct_jg_wcc_catdata where chain_price <> 0
03-Aug-2017 14:47:47.505 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory E:\Work\InstelliJIDEAR_TomcatNo.2\apache-tomcat-8.5.14\webapps\manager
03-Aug-2017 14:47:47.555 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory E:\Work\InstelliJIDEAR_TomcatNo.2\apache-tomcat-8.5.14\webapps\manager has finished in 49 ms
2017-08-03 14:47:49,728 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [GET] path=/warning/query/detailed : WarningAction.QueryDetailed(WarningAction.java:58)
2017-08-03 14:47:49,728 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'warningAction'<class net.nutz.wcc.controller.WarningAction>
2017-08-03 14:47:52,842 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 0 resource by src( conf/sqls/ ) , regex( .(sql|sqlx|sqls)$ )
2017-08-03 14:47:52,842 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 0 resource by src( conf/sqls/ ) , regex( .(sql|sqlx|sqls)$ )

把 conf/sqls/WarningDetail 这个文件夹的绝对路径 发一下

wcc/src/main/conf/sqls maven的项目

这样是不行的

目录改为 wcc/src/main/resources/sqls

代码改成 SqlManager sqlm = new FileSqlManager("sqls/");

名称必须改成resources吗,我把conf在idear里声明成资源了

添加回复
请先登陆
回到顶部