基于springboot+kotlin+gradle构建的框架的坑

项目采用以上技术构建,于是本人就尝试构建自己的脚手架,然后遇到一大推问题。

使用的是springinitials构建,IDE是:IDEA

现在也是知其然不知其所以然,但是先记录下来修改过程,以后等知识水平补充上来的话就再将其中的一些原理解释一下:


第一坑:

构建起框架后, gradle 出现导入问题:load timeout

解决方法:在 build.gradle 如下图位置添加 maven 依赖:

        maven {
            url("https://plugins.gradle.org/m2/")
        }
        maven {url ‘http://maven.aliyun.com/nexus/content/groups/public/‘}
        maven {
            url ‘http://mvn.dev.alipay.net:8080/artifactory/repo‘
        }

第二坑,解决上面的问题后,立马遇到新问题:

解决方法:还是在 build.gradle 中添加第一坑中的 maven 即可解决,不过这次的位置是在一个单独的 repositories 标签内:

然后整个Gradle构建就会完成了:启动的main方法可以正常显示,且gradle不会再出现爆红:


第三坑:在你以为问题都ok了的情况下,直接去跑 main 方法了,但是还是有问题了:

问你难不难受?拉到最后面后:可以发现 nest exception 里面:

难不难受?

然后问题这个就比较好解决了,在构建项目的时候选择了依赖 spring-jpa 于是在 build.gradle 中注释掉关于 jpa 的相关依赖后:

补充:这里同理mongodb也会有类似的问题出现,这里也把mongodb也注释掉。

好了你会看到启动的整个控制台输出没有问题了:

"C:\Program Files\Java\jdk1.8.0_66\bin\java" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:54375,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=54374 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -javaagent:C:\Users\wb-jez365495\.IntelliJIdea2017.3\system\groovyHotSwap\gragent.jar -javaagent:C:\Users\wb-jez365495\.IntelliJIdea2017.3\system\captureAgent\debugger-agent.jar=C:\Users\wb-jez365495\AppData\Local\Temp\capture75.props -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_66\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\rt.jar;D:\mykotlin\out\production\classes;D:\mykotlin\out\production\resources;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-actuator\2.0.0.RELEASE\22d7f64be5452ddad3fd0d651c818de658a18f3e\spring-boot-starter-actuator-2.0.0.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-freemarker\2.0.0.RELEASE\aa64780e8ca4861c6c6d3995b8773a9c043f82e4\spring-boot-starter-freemarker-2.0.0.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-web\2.0.0.RELEASE\fcb2a9e18f98382e626935841f85ed44d7153615\spring-boot-starter-web-2.0.0.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.module\jackson-module-kotlin\2.9.4\edf756e3e6f9a15b825442d66df3f70ddc1c8c89\jackson-module-kotlin-2.9.4.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib-jdk8\1.2.20\12ef3991ea49e4f58e2241eb1b3453dc80bfac3c\kotlin-stdlib-jdk8-1.2.20.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-reflect\1.2.20\f6f78911d9abbc803697a9030962258d9bda49b3\kotlin-reflect-1.2.20.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-json\2.0.0.RELEASE\5a09c939d8bd60d7f163c1c0c20a3127ba9fffa\spring-boot-starter-json-2.0.0.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter\2.0.0.RELEASE\6d7d8e4bf053cd1833f3c7dbce676bc274f0892f\spring-boot-starter-2.0.0.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-actuator-autoconfigure\2.0.0.RELEASE\ffaa094aef881dbb30621f6f042dcfec125ffe9\spring-boot-actuator-autoconfigure-2.0.0.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-devtools\2.0.0.RELEASE\db0a05542d0d59b55cdee8767cb2ec41cf49e4a6\spring-boot-devtools-2.0.0.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-core\1.0.1\698281b5829a16ddea19f3a5d4414d7ece1d3f11\micrometer-core-1.0.1.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.freemarker\freemarker\2.3.27-incubating\fa71f754fd3c4123358c2b1e5eef630cd99d752f\freemarker-2.3.27-incubating.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context-support\5.0.4.RELEASE\b40b6c00f8725a31dc968bc33fe8959f14898c9d\spring-context-support-5.0.4.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-tomcat\2.0.0.RELEASE\908bc9de1a7cfa857edf44182d426f6e0d8a3008\spring-boot-starter-tomcat-2.0.0.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.hibernate.validator\hibernate-validator\6.0.7.Final\8b9d9c7ec8c73963ea0fe81912fc67711a4ef76\hibernate-validator-6.0.7.Final.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework\spring-webmvc\5.0.4.RELEASE\addcf1caa22613c474bd6dde8c7134fef940b1f0\spring-webmvc-5.0.4.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework\spring-web\5.0.4.RELEASE\9565bbc67bf1a850a6505deaa5103931712a7b80\spring-web-5.0.4.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jsr310\2.9.4\12d52679a6615c7972ea25bd8ebb60b191fe79b7\jackson-datatype-jsr310-2.9.4.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jdk8\2.9.4\63ac052d52a70a15820d3dc07ea757826fd51d40\jackson-datatype-jdk8-2.9.4.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.module\jackson-module-parameter-names\2.9.4\5833c819877c3e85bad847f4d2fa4e70379217c6\jackson-module-parameter-names-2.9.4.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.9.4\498bbc3b94f566982c7f7c6d4d303fce365529be\jackson-databind-2.9.4.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\2.9.0\7c10d545325e3a6e72e06381afe469fd40eb701\jackson-annotations-2.9.0.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib-jdk7\1.2.20\583b3d6b6caef2b66042c8755d1ef8395d12d0b2\kotlin-stdlib-jdk7-1.2.20.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.2.20\1ce9e25c74aade0aa039cce459f2906a8c8ffc8e\kotlin-stdlib-1.2.20.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-autoconfigure\2.0.0.RELEASE\c89896a469ecf92996ecba40755919896ace5470\spring-boot-autoconfigure-2.0.0.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-actuator\2.0.0.RELEASE\309a5d45b09e361d29c9e7d1def644d70a50173b\spring-boot-actuator-2.0.0.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot\2.0.0.RELEASE\771da2071ff14a47f108642a641c204ae4ef7b15\spring-boot-2.0.0.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-logging\2.0.0.RELEASE\fe939b71659ef1f98a53cce0b5bcf771685cf6a6\spring-boot-starter-logging-2.0.0.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\javax.annotation\javax.annotation-api\1.3.2\934c04d3cfef185a8008e7bf34331b79730a9d43\javax.annotation-api-1.3.2.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context\5.0.4.RELEASE\3e76d08c851113077642c5704f0f94d5ce58e905\spring-context-5.0.4.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aop\5.0.4.RELEASE\f8e029e54c0267dadb6b9f713f3feb54ec4f3a0e\spring-aop-5.0.4.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework\spring-beans\5.0.4.RELEASE\7a8c3d48d4c33621e64d1399721d8e067450fcbd\spring-beans-5.0.4.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework\spring-expression\5.0.4.RELEASE\4bda161f2e34c1486f2527a23eb47293567f473c\spring-expression-5.0.4.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework\spring-core\5.0.4.RELEASE\2221a957b5561a34f044350ba4e30ef5870254a3\spring-core-5.0.4.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.yaml\snakeyaml\1.19\2d998d3d674b172a588e54ab619854d073f555b5\snakeyaml-1.19.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.hdrhistogram\HdrHistogram\2.1.10\9e1ac84eed220281841b75e72fb9de5a297fbf04\HdrHistogram-2.1.10.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.latencyutils\LatencyUtils\2.0.3\769c0b82cb2421c8256300e907298a9410a2a3d3\LatencyUtils-2.0.3.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-websocket\8.5.28\8a5a48740dd80cad644ceb541e77fd8e0809e3b7\tomcat-embed-websocket-8.5.28.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-core\8.5.28\b684c98cf77c6528079c4e59fc1feeb218bf82f1\tomcat-embed-core-8.5.28.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-el\8.5.28\75745598f60646ccf0c4b105468a9c8be9b8432e\tomcat-embed-el-8.5.28.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\javax.validation\validation-api\2.0.1.Final\cb855558e6271b1b32e716d24cb85c7f583ce09e\validation-api-2.0.1.Final.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.jboss.logging\jboss-logging\3.3.2.Final\3789d00e859632e6c6206adc0c71625559e6e3b0\jboss-logging-3.3.2.Final.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\com.fasterxml\classmate\1.3.4\3d5f48f10bbe4eb7bd862f10c0583be2e0053c6\classmate-1.3.4.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.9.4\a9a71ec1aa37da47db168fede9a4a5fb5e374320\jackson-core-2.9.4.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.jetbrains\annotations\13.0\919f0dfe192fb4e063e7dacadee7f8bb9a2672a9\annotations-13.0.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.2.3\7c4f3c474fb2c041d8028740440937705ebb473a\logback-classic-1.2.3.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-to-slf4j\2.10.0\f7e631ccf49cfc0aefa4a2a728da7d374c05bd3c\log4j-to-slf4j-2.10.0.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.slf4j\jul-to-slf4j\1.7.25\af5364cd6679bfffb114f0dec8a157aaa283b76\jul-to-slf4j-1.7.25.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jcl\5.0.4.RELEASE\3053e2bad0a18571bdbb9596ce51f9d458f5934f\spring-jcl-5.0.4.RELEASE.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-core\1.2.3\864344400c3d4d92dfeb0a305dc87d953677c03c\logback-core-1.2.3.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api\1.7.25\da76ca59f6a57ee3102f8f9bd9cee742973efa8a\slf4j-api-1.7.25.jar;C:\Users\wb-jez365495\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-api\2.10.0\fec5797a55b786184a537abd39c3fa1449d752d6\log4j-api-2.10.0.jar;D:\IntelliJ IDEA\lib\idea_rt.jar" com.mykotlin.demo.DemoApplicationKt
Connected to the target VM, address: ‘127.0.0.1:54375‘, transport: ‘socket‘
15:10:02.029 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Included patterns for restart : []
15:10:02.033 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Excluded patterns for restart : [/spring-boot-starter/target/classes/, /spring-boot-autoconfigure/target/classes/, /spring-boot-starter-[\w-]+/, /spring-boot/target/classes/, /spring-boot-actuator/target/classes/, /spring-boot-devtools/target/classes/]
15:10:02.033 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/D:/mykotlin/out/production/classes/, file:/D:/mykotlin/out/production/resources/]

  .   ____          _            __ _ _
 /\\ / ___‘_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | ‘_ | ‘_| | ‘_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  ‘  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.0.RELEASE)

2018-03-08 15:10:02.615  INFO 12000 --- [  restartedMain] com.mykotlin.demo.DemoApplicationKt      : Starting DemoApplicationKt on MININT-23T4F0B with PID 12000 (D:\mykotlin\out\production\classes started by wb-jez365495 in D:\mykotlin)
2018-03-08 15:10:02.617  INFO 12000 --- [  restartedMain] com.mykotlin.demo.DemoApplicationKt      : No active profile set, falling back to default profiles: default
2018-03-08 15:10:02.681  INFO 12000 --- [  restartedMain] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.ser[email protected]4694434b: startup date [Thu Mar 08 15:10:02 CST 2018]; root of context hierarchy
2018-03-08 15:10:05.394  INFO 12000 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2018-03-08 15:10:05.416  INFO 12000 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2018-03-08 15:10:05.416  INFO 12000 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.28
2018-03-08 15:10:05.425  INFO 12000 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener   : 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_66\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:\Program Files\nodejs\node_global;C:\ProgramData\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;D:\redis;C:\Program Files\nodejs\node_global;C:\Program Files\nodejs\;C:\Program Files\erl\bin;C:\Program Files\RabbitMQ Server\rabbitmq_server-3.7.3;C:\Program Files\RabbitMQ Server\rabbitmq_server-3.7.3;%RABBITMQ_HOME%\sbin\sbin\sbin;C:\Users\wb-jez365495\AppData\Roaming\npm;C:\Program Files\Java\jdk1.8.0_66\bin;C:\Program Files\gradle-4.6/bin;C:\Users\wb-jez365495\AppData\Roaming\npm;.]
2018-03-08 15:10:05.551  INFO 12000 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2018-03-08 15:10:05.552  INFO 12000 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2881 ms
2018-03-08 15:10:06.409  INFO 12000 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Servlet dispatcherServlet mapped to [/]
2018-03-08 15:10:06.414  INFO 12000 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: ‘characterEncodingFilter‘ to: [/*]
2018-03-08 15:10:06.414  INFO 12000 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: ‘hiddenHttpMethodFilter‘ to: [/*]
2018-03-08 15:10:06.414  INFO 12000 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: ‘httpPutFormContentFilter‘ to: [/*]
2018-03-08 15:10:06.414  INFO 12000 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: ‘requestContextFilter‘ to: [/*]
2018-03-08 15:10:06.415  INFO 12000 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: ‘httpTraceFilter‘ to: [/*]
2018-03-08 15:10:06.415  INFO 12000 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: ‘webMvcMetricsFilter‘ to: [/*]
2018-03-08 15:10:06.708  INFO 12000 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.ser[email protected]4694434b: startup date [Thu Mar 08 15:10:02 CST 2018]; root of context hierarchy
2018-03-08 15:10:06.780  INFO 12000 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-03-08 15:10:06.781  INFO 12000 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-03-08 15:10:06.824  INFO 12000 --- [  restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-03-08 15:10:06.824  INFO 12000 --- [  restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-03-08 15:10:06.881  INFO 12000 --- [  restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-03-08 15:10:07.253  INFO 12000 --- [  restartedMain] o.s.ui.freemarker.SpringTemplateLoader   : SpringTemplateLoader for FreeMarker: using resource loader [org.springframework.boot.web.ser[email protected]4694434b: startup date [Thu Mar 08 15:10:02 CST 2018]; root of context hierarchy] and template loader path [classpath:/templates/]
2018-03-08 15:10:07.254  INFO 12000 --- [  restartedMain] o.s.w.s.v.f.FreeMarkerConfigurer         : ClassTemplateLoader for Spring macros added to FreeMarker configuration
2018-03-08 15:10:07.274  WARN 12000 --- [  restartedMain] o.s.b.a.f.FreeMarkerAutoConfiguration    : Cannot find template location(s): [classpath:/templates/] (please add some templates, check your FreeMarker configuration, or set spring.freemarker.checkTemplateLocation=false)
2018-03-08 15:10:07.318  INFO 12000 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2018-03-08 15:10:07.344  INFO 12000 --- [  restartedMain] s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Mapped "{[/actuator/health],methods=[GET],produces=[application/vnd.spring-boot.actuator.v2+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$OperationHandler.handle(javax.servlet.http.HttpServletRequest,java.util.Map<java.lang.String, java.lang.String>)
2018-03-08 15:10:07.345  INFO 12000 --- [  restartedMain] s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Mapped "{[/actuator/info],methods=[GET],produces=[application/vnd.spring-boot.actuator.v2+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$OperationHandler.handle(javax.servlet.http.HttpServletRequest,java.util.Map<java.lang.String, java.lang.String>)
2018-03-08 15:10:07.346  INFO 12000 --- [  restartedMain] s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Mapped "{[/actuator],methods=[GET],produces=[application/vnd.spring-boot.actuator.v2+json || application/json]}" onto protected java.util.Map<java.lang.String, java.util.Map<java.lang.String, org.springframework.boot.actuate.endpoint.web.Link>> org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping.links(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-03-08 15:10:07.563  INFO 12000 --- [  restartedMain] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2018-03-08 15:10:07.612  INFO 12000 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ‘‘
2018-03-08 15:10:07.616  INFO 12000 --- [  restartedMain] com.mykotlin.demo.DemoApplicationKt      : Started DemoApplicationKt in 5.506 seconds (JVM running for 6.823)
2018-03-08 15:10:08.387  INFO 12000 --- [on(4)-127.0.0.1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring FrameworkServlet ‘dispatcherServlet‘
2018-03-08 15:10:08.388  INFO 12000 --- [on(4)-127.0.0.1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet ‘dispatcherServlet‘: initialization started
2018-03-08 15:10:08.401  INFO 12000 --- [on(4)-127.0.0.1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet ‘dispatcherServlet‘: initialization completed in 13 ms

这时候就可以尝试做一些自己的工作了。

原文地址:https://www.cnblogs.com/lilinzhiyu/p/8528611.html

时间: 2024-10-09 16:38:00

基于springboot+kotlin+gradle构建的框架的坑的相关文章

基于spring-boot的rest微服务框架

周末在家研究spring-boot,参考github上的一些开源项目,整了一个rest微服务框架,取之于民,用之于民,在github上开源了,地址如下: https://github.com/yjmyzz/spring-boot-rest-framework 主要特性如下: ----------------- 数据访问 dao采用mybatis 3.3.0 + tk.mybatis通用Mapper3.1.3 , 支持事务回滚 数据库初始化脚本 见src/mybatis-generator/ddl

SpringBoot使用Gradle构建war包

Spring Boot默认将应用打包成可执行的jar包.有时候需要打包成war包部署在tomcat等容器.下面简单介绍下打包的步骤. 一.修改gradle.build文件 1.1 添加如下配置 apply plugin: 'war' 1.2 修改依赖,将tomcat的依赖范围修改为providedCompile dependencies { compile('org.springframework.boot:spring-boot-starter-web') providedCompile("o

基于Spring4+SpringMVC4+Mybatis3+Hibernate4+Junit4框架构建高性能企业级的部标GPS监控平台

开发企业级的部标GPS监控平台,投入的开发力量很大,开发周期也很长,选择主流的开发语言以及成熟的开源技术框架来构建基础平台,是最恰当不过的事情,在设计之初就避免掉了技术选型的风险,避免以后在开发过程中,不断的填坑走弯路,以至于整个团队被坑埋掉.做GPS平台这么多年,以前就了解到一些开发团队过于关注某一种语言的优势,比如过于选用GO,Erlang,python,php等技术,最后团队熟悉这些技术的关键人员离职了,都没人接手,不能不说是个悲剧.所以说平台的技术架构选型要注重的是稳健,均衡而不是偏激,

用Gradle构建Java Play框架应用

在LinkedIn,我们一直在评估最好的开发框架和工具来开发伟大的产品.11年的历史中,我们使用过很多前端web框架-如Grails.Frontier(LinkedIn内部的web框架),最近是:Play!我们喜欢Play,并热情地在公司内部推行起来.于是我们用Play进行了整合和扩展.现在我们正在评估哪个构建系统(build system,下同)更好用. 这篇文章介绍了用在Play中用Gradle来支持开发,及Gradle的目前状态和它的初步特性的演化.我们希望Play社区提供更多反馈以帮助G

Gradle构建SpringBoot并打包可运行的jar配置

使用Gradle构建项目,继承了Ant的灵活和Maven的生命周期管理,不再使用XML作为配置文件格式,采用了DSL格式,使得脚本更加简洁. 构建环境: jdk1.6以上,此处使用1.8 Gradle 4.4.1 SpringBoot idea 一.下载并安装Gradle Gradle官网 Gradle官网 1.下载Gradle 下载Gradle Gradle版本下载 2.解压Gradle 下载之后解压到你想存放的目录 Gradle解压 3.设置Gradle环境变量 创建一个环境变量 GRADL

基于Netty和SpringBoot实现一个轻量级RPC框架-Client篇

前提 前置文章: <基于Netty和SpringBoot实现一个轻量级RPC框架-协议篇> <基于Netty和SpringBoot实现一个轻量级RPC框架-Server篇> 前一篇文章相对简略地介绍了RPC服务端的编写,而这篇博文最要介绍服务端(Client)的实现.RPC调用一般是面向契约编程的,而Client的核心功能就是:把契约接口方法的调用抽象为使用Netty向RPC服务端通过私有协议发送一个请求.这里最底层的实现依赖于动态代理,因此动态代理是动态实现接口的最简单方式(如果

使用Gradle 构建一个SpringBoot + Spring Security + Mybatisplus的多模块系统

## 目标 - 使用 Gradle 构建一个多模块系统,熟悉脚本- 搭建 SpringBoot ,Spring Security ,Mybatis子模块,实现基本的 Hello World.可以独立运行. 总体步骤:新建父工程(gradle) - 配置maven - 新建多个子工程(SpringBoot ,Spring Security ,Mybatis) - 修改父子的build.gradle & 父的settings.gradle - xxxx  - 测试 顶顶顶 灌灌灌灌 github:

基于Jenkins的自动构建系统开发_android总结

持续集成相关理论 1.1 极限编程的概述 1.1.1 极限编程的产生 2001年,为了解决许多公司的软件团队陷入不断增长的过程泥潭,一批业界专家一起概括出了一些可以让软件开发团队具有快速工作.响应变化能力的价值观和原则,他们称自己为敏捷联盟.敏捷开发过程的方法很多,主要有:SCRUM,Crystal,特征驱动软件开发(Feature Driven Development,简称FDD),自适应软件开发(Adaptive Software Development,简称ASD),以及最重要的极限编程(

基于SpringBoot + Mybatis实现SpringMVC Web项目

一.热身 一个现实的场景是:当我们开发一个Web工程时,架构师和开发工程师可能更关心项目技术结构上的设计.而几乎所有结构良好的软件(项目)都使用了分层设计.分层设计是将项目按技术职能分为几个内聚的部分,从而将技术或接口的实现细节隐藏起来. 从另一个角度上来看,结构上的分层往往也能促进了技术人员的分工,可以使开发人员更专注于某一层业务与功能的实现,比如前端工程师只关心页面的展示与交互效果(例如专注于HTML,JS等),而后端工程师只关心数据和业务逻辑的处理(专注于Java,Mysql等).两者之间