1. 程式人生 > >IDEA 開發spring boot後面陸續整理的內容。。。。

IDEA 開發spring boot後面陸續整理的內容。。。。

"C:\Program Files\Java\jdk1.8.0_121\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:63785,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=63779 -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:\programs\ideaIU-2018.1.4.win\plugins\Groovy\lib\agent\gragent.jar -javaagent:C:\programs\ideaIU-2018.1.4.win\lib\rt\debugger-agent.jar=file:/C:/Users/Administrator/AppData/Local/Temp/capture.props -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_121\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\rt.jar;C:\burns\springboot_project\gradle_project\masterspringmvc\out\production\classes;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-web\2.1.0.RELEASE\5bb07547b965e84edd8abb49c1431d17926e2c6b\spring-boot-starter-web-2.1.0.RELEASE.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-json\2.1.0.RELEASE\704c38f5c3ad5205701391110dd4c6f5623fb2cc\spring-boot-starter-json-2.1.0.RELEASE.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter\2.1.0.RELEASE\54eab30f1be3dd2f1e833e26143f6243246d878d\spring-boot-starter-2.1.0.RELEASE.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-tomcat\2.1.0.RELEASE\e3d4a04f0e678f65d5bb283fbef67bfbd05b5ca1\spring-boot-starter-tomcat-2.1.0.RELEASE.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.springframework\spring-webmvc\5.1.2.RELEASE\46e1db300d855ddef6b71816bb52856f46d6003f\spring-webmvc-5.1.2.RELEASE.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.springframework\spring-web\5.1.2.RELEASE\3ff2a93b072da42c3930225e3dceeabb0678eb0b\spring-web-5.1.2.RELEASE.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-autoconfigure\2.1.0.RELEASE\8898af6accfab65ac6e232c1535abbc33cfa5fcb\spring-boot-autoconfigure-2.1.0.RELEASE.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot\2.1.0.RELEASE\a78c97c771856f7690b9308886c75affe9295b12\spring-boot-2.1.0.RELEASE.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-logging\2.1.0.RELEASE\d1bd872e05961f30bc122ad14f3e9ae12388e873\spring-boot-starter-logging-2.1.0.RELEASE.jar;C:\Users\Administrator\.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\Administrator\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context\5.1.2.RELEASE\5c85bc522a5adac9b09b7204fa20708519ab6a11\spring-context-5.1.2.RELEASE.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aop\5.1.2.RELEASE\bc3cdf3c81bc0a3482cc7f6b9e00ab76847056a7\spring-aop-5.1.2.RELEASE.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.springframework\spring-beans\5.1.2.RELEASE\5d513701a79c92f0549574f5170a05c4af7c893d\spring-beans-5.1.2.RELEASE.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.springframework\spring-expression\5.1.2.RELEASE\3c16b062785e4c101db6b754fcb34a77c1e912c\spring-expression-5.1.2.RELEASE.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.springframework\spring-core\5.1.2.RELEASE\b9b00d4075c92761cfd4e527e0bdce1931b4f3dc\spring-core-5.1.2.RELEASE.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.yaml\snakeyaml\1.23\ec62d74fe50689c28c0ff5b35d3aebcaa8b5be68\snakeyaml-1.23.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jdk8\2.9.7\98d8f190db07f97c64c0ea3af5792f718a6c2cc1\jackson-datatype-jdk8-2.9.7.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jsr310\2.9.7\cbd919f1ce67533e07b98dd493247e8dbabc26b2\jackson-datatype-jsr310-2.9.7.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.module\jackson-module-parameter-names\2.9.7\f2bdd7696beffa2dbc5dc62cd24c3906a40ffcff\jackson-module-parameter-names-2.9.7.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-websocket\9.0.12\b55259721a6f872107e0299a19bd1ed3998168ef\tomcat-embed-websocket-9.0.12.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-core\9.0.12\136c8dc5c84e82bf2d68bb10648d4fa8b402184\tomcat-embed-core-9.0.12.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-el\9.0.12\8ee44bee76043321860cde871cf6343de1483ff5\tomcat-embed-el-9.0.12.jar;C:\Users\Administrator\.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\Administrator\.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\Administrator\.gradle\caches\modules-2\files-2.1\com.fasterxml\classmate\1.4.0\291658ac2ce2476256c7115943652c0accb5c857\classmate-1.4.0.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.2.3\7c4f3c474fb2c041d8028740440937705ebb473a\logback-classic-1.2.3.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-to-slf4j\2.11.1\1097acadf76aa4dd721ec5807566003ae9d975de\log4j-to-slf4j-2.11.1.jar;C:\Users\Administrator\.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\Administrator\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jcl\5.1.2.RELEASE\f0d7165b6cfb90356da4f25b14a6437fdef1ec8a\spring-jcl-5.1.2.RELEASE.jar;C:\Users\Administrator\.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\Administrator\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.9.7\4b7f0e0dc527fab032e9800ed231080fdc3ac015\jackson-core-2.9.7.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-core\1.2.3\864344400c3d4d92dfeb0a305dc87d953677c03c\logback-core-1.2.3.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api\1.7.25\da76ca59f6a57ee3102f8f9bd9cee742973efa8a\slf4j-api-1.7.25.jar;C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-api\2.11.1\268f0fe4df3eefe052b57c87ec48517d64fb2a10\log4j-api-2.11.1.jar;C:\programs\ideaIU-2018.1.4.win\lib\idea_rt.jar" masterspringmvc.MasterspringmvcApplication
Connected to the target VM, address: '127.0.0.1:63785', transport: 'socket'

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

2018-11-19 10:46:45.267  INFO 48048 --- [           main] m.MasterspringmvcApplication             : Starting MasterspringmvcApplication on DESKTOP-FJENO5H with PID 48048 (C:\burns\springboot_project\gradle_project\masterspringmvc\out\production\classes started by Administrator in C:\burns\springboot_project\gradle_project\masterspringmvc)
2018-11-19 10:46:45.272  INFO 48048 --- [           main] m.MasterspringmvcApplication             : No active profile set, falling back to default profiles: default
2018-11-19 10:46:46.511  INFO 48048 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2018-11-19 10:46:46.526  INFO 48048 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2018-11-19 10:46:46.526  INFO 48048 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/9.0.12
2018-11-19 10:46:46.533  INFO 48048 --- [           main] 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_121\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\MentorGraphics\CHS2017\bin;C:\MentorGraphics\CHS2017\jre\bin;C:\MentorGraphics\CHS2017\jre\bin\client;C:\MentorGraphics\CHS2011\bin;C:\MentorGraphics\CHS2011\jre\bin;C:\MentorGraphics\CHS2011\jre\bin\client;C:\MentorGraphics\CHS2012\bin;C:\MentorGraphics\CHS2012\jre\bin;C:\MentorGraphics\CHS2012\jre\bin\client;C:\MentorGraphics\CHS2014\bin;C:\MentorGraphics\CHS2014\jre\bin;C:\MentorGraphics\CHS2014\jre\bin\client;C:\app\Administrator\product\11.2.0\dbhome_1\bin;C:\Program Files\Java\jdk1.8.0_121\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\MENTOR~1\LICENS~1;D:\program\apache-ant-1.8.2\bin;D:\Program Files\nodejs;C:\Users\Administrator\AppData\Roaming\npm;C:\programs\spring-boot-cli-1.4.3.RELEASE-bin\spring-1.4.3.RELEASE\bin;C:\programs\apache-maven-3.3.9-bin\apache-maven-3.3.9\bin;D:\Program Files\mysql-5.7.18-winx64\bin;D:\oracle\instantclient_11_2;C:\WINDOWS\System32\OpenSSH\;C:\programs\gradle-2.14.1\bin;C:\Program Files\Git\cmd;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\Docker Toolbox;.]
2018-11-19 10:46:46.681  INFO 48048 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2018-11-19 10:46:46.681  INFO 48048 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1301 ms
2018-11-19 10:46:46.746  INFO 48048 --- [           main] o.s.b.w.servlet.ServletRegistrationBean  : Servlet dispatcherServlet mapped to [/]
2018-11-19 10:46:46.767  INFO 48048 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-11-19 10:46:46.767  INFO 48048 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-11-19 10:46:46.767  INFO 48048 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'formContentFilter' to: [/*]
2018-11-19 10:46:46.767  INFO 48048 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2018-11-19 10:46:46.901  WARN 48048 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerAdapter' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Factory method 'requestMappingHandlerAdapter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcValidator' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.validation.Validator]: Factory method 'mvcValidator' threw exception; nested exception is javax.validation.NoProviderFoundException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
2018-11-19 10:46:46.905  INFO 48048 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2018-11-19 10:46:46.915  INFO 48048 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-11-19 10:46:46.921 ERROR 48048 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

The Bean Validation API is on the classpath but no implementation could be found

Action:

Add an implementation, such as Hibernate Validator, to the classpath

Disconnected from the target VM, address: '127.0.0.1:63785', transport: 'socket'

Process finished with exit code 1

1、在IDEA中建立spring boot專案,使用gradle構建,並且推送到github上的例子過程

 

2、spring boot關鍵類說明:

3、application.properties檔案內容總結。

 

4、thymeleaf的應用:

參考學習書籍《精通Spring+MVC+4+Geoffroy+Warin》