警告信息:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (file:/C:/Users/yuhua5/.m2/repository/org/springframework/spring-core/5.0.6.RELEASE/spring-core-5.0.6.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Mon Nov 19 17:05:04 CST 2018 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.
运行springboot启动类的时候可能会报上面两个警告,其实尽是为了启动项目的话你大可以不管他们,因为他们不影响项目的启动。如果像我一样有着强迫症的伙伴可以这么改:
解决方法:对于第一个告警,我们降一下使用的jdk版本就行了,我先前用的是Java10所以才报了这个告警。
对于第二个错误,大家可以在配置文件application.yml的配置mysql的路径下加上useSSL=false就可以了。
#基本属性
url: jdbc:mysql://localhost:3306/test?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
按照上面修改完在启动项目就会发现警告没有了。
/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin/java -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=60405 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=127.0.0.1 -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=60406:/Applications/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/lib/tools.jar:/Users/huayu/Documents/workspace/springbootproject/target/classes:/Users/huayu/Documents/LocalResource/org/springframework/boot/spring-boot-starter-web/2.0.2.RELEASE/spring-boot-starter-web-2.0.2.RELEASE.jar:/Users/huayu/Documents/LocalResource/org/springframework/boot/spring-boot-starter/2.0.2.RELEASE/spring-boot-starter-2.0.2.RELEASE.jar:/Users/huayu/Documents/LocalResource/org/springframework/boot/spring-boot/2.0.2.RELEASE/spring-boot-2.0.2.RELEASE.jar:/Users/huayu/Documents/LocalResource/org/springframework/boot/spring-boot-starter-logging/2.0.2.RELEASE/spring-boot-starter-logging-2.0.2.RELEASE.jar:/Users/huayu/Documents/LocalResource/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/Users/huayu/Documents/LocalResource/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:/Users/huayu/Documents/LocalResource/org/apache/logging/log4j/log4j-to-slf4j/2.10.0/log4j-to-slf4j-2.10.0.jar:/Users/huayu/Documents/LocalResource/org/apache/logging/log4j/log4j-api/2.10.0/log4j-api-2.10.0.jar:/Users/huayu/Documents/LocalResource/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar:/Users/huayu/Documents/LocalResource/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar:/Users/huayu/Documents/LocalResource/org/yaml/snakeyaml/1.19/snakeyaml-1.19.jar:/Users/huayu/Documents/LocalResource/org/springframework/boot/spring-boot-starter-json/2.0.2.RELEASE/spring-boot-starter-json-2.0.2.RELEASE.jar:/Users/huayu/Documents/LocalResource/com/fasterxml/jackson/core/jackson-databind/2.9.5/jackson-databind-2.9.5.jar:/Users/huayu/Documents/LocalResource/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar:/Users/huayu/Documents/LocalResource/com/fasterxml/jackson/core/jackson-core/2.9.5/jackson-core-2.9.5.jar:/Users/huayu/Documents/LocalResource/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.9.5/jackson-datatype-jdk8-2.9.5.jar:/Users/huayu/Documents/LocalResource/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.9.5/jackson-datatype-jsr310-2.9.5.jar:/Users/huayu/Documents/LocalResource/com/fasterxml/jackson/module/jackson-module-parameter-names/2.9.5/jackson-module-parameter-names-2.9.5.jar:/Users/huayu/Documents/LocalResource/org/springframework/boot/spring-boot-starter-tomcat/2.0.2.RELEASE/spring-boot-starter-tomcat-2.0.2.RELEASE.jar:/Users/huayu/Documents/LocalResource/org/apache/tomcat/embed/tomcat-embed-core/8.5.31/tomcat-embed-core-8.5.31.jar:/Users/huayu/Documents/LocalResource/org/apache/tomcat/embed/tomcat-embed-el/8.5.31/tomcat-embed-el-8.5.31.jar:/Users/huayu/Documents/LocalResource/org/apache/tomcat/embed/tomcat-embed-websocket/8.5.31/tomcat-embed-websocket-8.5.31.jar:/Users/huayu/Documents/LocalResource/org/hibernate/validator/hibernate-validator/6.0.9.Final/hibernate-validator-6.0.9.Final.jar:/Users/huayu/Documents/LocalResource/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar:/Users/huayu/Documents/LocalResource/org/jboss/logging/jboss-logging/3.3.2.Final/jboss-logging-3.3.2.Final.jar:/Users/huayu/Documents/LocalResource/com/fasterxml/classmate/1.3.4/classmate-1.3.4.jar:/Users/huayu/Documents/LocalResource/org/springframework/spring-web/5.0.6.RELEASE/spring-web-5.0.6.RELEASE.jar:/Users/huayu/Documents/LocalResource/org/springframework/spring-beans/5.0.6.RELEASE/spring-beans-5.0.6.RELEASE.jar:/Users/huayu/Documents/LocalResource/org/springframework/spring-webmvc/5.0.6.RELEASE/spring-webmvc-5.0.6.RELEASE.jar:/Users/huayu/Documents/LocalResource/org/springframework/spring-aop/5.0.6.RELEASE/spring-aop-5.0.6.RELEASE.jar:/Users/huayu/Documents/LocalResource/org/springframework/spring-context/5.0.6.RELEASE/spring-context-5.0.6.RELEASE.jar:/Users/huayu/Documents/LocalResource/org/springframework/spring-expression/5.0.6.RELEASE/spring-expression-5.0.6.RELEASE.jar:/Users/huayu/Documents/LocalResource/org/mybatis/spring/boot/mybatis-spring-boot-starter/1.3.2/mybatis-spring-boot-starter-1.3.2.jar:/Users/huayu/Documents/LocalResource/org/springframework/boot/spring-boot-starter-jdbc/2.0.2.RELEASE/spring-boot-starter-jdbc-2.0.2.RELEASE.jar:/Users/huayu/Documents/LocalResource/com/zaxxer/HikariCP/2.7.9/HikariCP-2.7.9.jar:/Users/huayu/Documents/LocalResource/org/springframework/spring-jdbc/5.0.6.RELEASE/spring-jdbc-5.0.6.RELEASE.jar:/Users/huayu/Documents/LocalResource/org/springframework/spring-tx/5.0.6.RELEASE/spring-tx-5.0.6.RELEASE.jar:/Users/huayu/Documents/LocalResource/org/mybatis/spring/boot/mybatis-spring-boot-autoconfigure/1.3.2/mybatis-spring-boot-autoconfigure-1.3.2.jar:/Users/huayu/Documents/LocalResource/org/mybatis/mybatis/3.4.6/mybatis-3.4.6.jar:/Users/huayu/Documents/LocalResource/org/mybatis/mybatis-spring/1.3.2/mybatis-spring-1.3.2.jar:/Users/huayu/Documents/LocalResource/mysql/mysql-connector-java/5.1.46/mysql-connector-java-5.1.46.jar:/Users/huayu/Documents/LocalResource/org/springframework/spring-core/5.0.6.RELEASE/spring-core-5.0.6.RELEASE.jar:/Users/huayu/Documents/LocalResource/org/springframework/spring-jcl/5.0.6.RELEASE/spring-jcl-5.0.6.RELEASE.jar:/Users/huayu/Documents/LocalResource/com/alibaba/druid-spring-boot-starter/1.1.9/druid-spring-boot-starter-1.1.9.jar:/Users/huayu/Documents/LocalResource/com/alibaba/druid/1.1.9/druid-1.1.9.jar:/Users/huayu/Documents/LocalResource/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:/Users/huayu/Documents/LocalResource/org/springframework/boot/spring-boot-autoconfigure/2.0.2.RELEASE/spring-boot-autoconfigure-2.0.2.RELEASE.jar com.jd.springbootdemo.SpringbootmybatisdemoApplication
objc[40494]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin/java (0x102d3c4c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x102db64e0). One of the two will be used. Which one is undefined.
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.2.RELEASE)
2018-11-21 22:44:33.105 INFO 40494 --- [ main] c.j.s.SpringbootmybatisdemoApplication : Starting SpringbootmybatisdemoApplication on huadeMacBook-Pro.local with PID 40494 (/Users/huayu/Documents/workspace/springbootproject/target/classes started by huayu in /Users/huayu/Documents/workspace/springbootproject)
2018-11-21 22:44:33.110 INFO 40494 --- [ main] c.j.s.SpringbootmybatisdemoApplication : No active profile set, falling back to default profiles: default
2018-11-21 22:44:33.176 INFO 40494 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@6356695f: startup date [Wed Nov 21 22:44:33 CST 2018]; root of context hierarchy
2018-11-21 22:44:34.564 INFO 40494 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8181 (http)
2018-11-21 22:44:34.589 INFO 40494 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-11-21 22:44:34.589 INFO 40494 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.31
2018-11-21 22:44:34.593 INFO 40494 --- [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: [/Users/huayu/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2018-11-21 22:44:34.660 INFO 40494 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-11-21 22:44:34.660 INFO 40494 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1488 ms
2018-11-21 22:44:34.780 INFO 40494 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-11-21 22:44:34.781 INFO 40494 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet statViewServlet mapped to [/druid/*]
2018-11-21 22:44:34.784 INFO 40494 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-11-21 22:44:34.785 INFO 40494 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-11-21 22:44:34.785 INFO 40494 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-11-21 22:44:34.785 INFO 40494 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-11-21 22:44:34.785 INFO 40494 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'webStatFilter' to urls: [/*]
2018-11-21 22:44:34.847 INFO 40494 --- [ main] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource
2018-11-21 22:44:35.171 INFO 40494 --- [ main] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited
2018-11-21 22:44:35.494 INFO 40494 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-11-21 22:44:35.674 INFO 40494 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@6356695f: startup date [Wed Nov 21 22:44:33 CST 2018]; root of context hierarchy
2018-11-21 22:44:35.773 INFO 40494 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/student/add]}" onto public java.lang.String com.jd.springbootdemo.controller.StudentController.add(com.jd.springbootdemo.entity.Student)
2018-11-21 22:44:35.775 INFO 40494 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/student/update]}" onto public java.lang.String com.jd.springbootdemo.controller.StudentController.update(com.jd.springbootdemo.entity.Student)
2018-11-21 22:44:35.777 INFO 40494 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/student/delete]}" onto public java.lang.String com.jd.springbootdemo.controller.StudentController.delete(com.jd.springbootdemo.entity.Student)
2018-11-21 22:44:35.777 INFO 40494 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/student/find]}" onto public java.lang.String com.jd.springbootdemo.controller.StudentController.findStudent(com.jd.springbootdemo.entity.Student)
2018-11-21 22:44:35.782 INFO 40494 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-11-21 22:44:35.783 INFO 40494 --- [ main] 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-11-21 22:44:35.812 INFO 40494 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-11-21 22:44:35.812 INFO 40494 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-11-21 22:44:36.044 INFO 40494 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-11-21 22:44:36.046 INFO 40494 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'statFilter' has been autodetected for JMX exposure
2018-11-21 22:44:36.046 INFO 40494 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'dataSource' has been autodetected for JMX exposure
2018-11-21 22:44:36.051 INFO 40494 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located MBean 'dataSource': registering with JMX server as MBean [com.alibaba.druid.spring.boot.autoconfigure:name=dataSource,type=DruidDataSourceWrapper]
2018-11-21 22:44:36.052 INFO 40494 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located MBean 'statFilter': registering with JMX server as MBean [com.alibaba.druid.filter.stat:name=statFilter,type=StatFilter]
2018-11-21 22:44:36.100 INFO 40494 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8181 (http) with context path ''
2018-11-21 22:44:36.105 INFO 40494 --- [ main] c.j.s.SpringbootmybatisdemoApplication : Started SpringbootmybatisdemoApplication in 3.439 seconds (JVM running for 4.358)
若有问题欢迎大家与我互动交流,如果文章帮到了你,请点小手指。另外,每周我会尽量至少更新一篇博客文章,喜欢的朋友可以加一下关注。