spring boot hello Double 7 Day
来源:互联网 发布:文明6 for mac 下载 编辑:程序博客网 时间:2024/06/07 13:52
package test;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.EnableAutoConfiguration;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;/** * Hello Spring boot! * * @author ZengWenFeng * @date 2017.08.28 */@RestController@EnableAutoConfigurationpublic class App{@RequestMapping(value = "/")String anyMethod(){//http://127.0.0.1:8080return "hello Double 7 Day!";}/** * test * * @param args */public static void main(String[] args){SpringApplication.run(App.class, args);}}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.lz</groupId><artifactId>test</artifactId><version>0.0.1-SNAPSHOT</version><properties><spring.boot.version>1.1.4.RELEASE</spring.boot.version></properties><repositories><repository><id>com.springsource.repository.bundles.release</id><name>Spring Maven Repository Repository</name><url>http://repo2.maven.org/maven2/</url></repository><repository><id>jboss</id><url>https://repository.jboss.org/nexus/content/groups/public/</url></repository><repository><id>sonatype</id><name>Sonatype Repository</name><url>http://repository.sonatype.org/content/groups/public/</url></repository></repositories><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><version>${spring.boot.version}</version></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><version>${spring.boot.version}</version><executions><execution><goals><goal>repackage</goal></goals></execution></executions></plugin></plugins></build></project>
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v1.1.4.RELEASE)2017-08-28 19:08:27.926 INFO 6548 --- [ main] test.App : Starting App on USER-20170823VM with PID 6548 (D:\Eclipse-jee-luna-SR2-win32-x86_64_workspace\test\target\classes started by Administrator in D:\Eclipse-jee-luna-SR2-win32-x86_64_workspace\test)2017-08-28 19:08:27.957 INFO 6548 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@239a029e: startup date [Mon Aug 28 19:08:27 CST 2017]; root of context hierarchy2017-08-28 19:08:28.288 INFO 6548 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'beanNameViewResolver': replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]2017-08-28 19:08:28.893 INFO 6548 --- [ main] .t.TomcatEmbeddedServletContainerFactory : Server initialized with port: 80802017-08-28 19:08:29.064 INFO 6548 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat2017-08-28 19:08:29.065 INFO 6548 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/7.0.542017-08-28 19:08:29.136 INFO 6548 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext2017-08-28 19:08:29.136 INFO 6548 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1181 ms2017-08-28 19:08:29.476 INFO 6548 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]2017-08-28 19:08:29.477 INFO 6548 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]2017-08-28 19:08:29.589 INFO 6548 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]2017-08-28 19:08:29.635 INFO 6548 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto java.lang.String test.App.anyMethod()2017-08-28 19:08:29.638 INFO 6548 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)2017-08-28 19:08:29.639 INFO 6548 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[text/html],custom=[]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)2017-08-28 19:08:29.652 INFO 6548 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]2017-08-28 19:08:29.653 INFO 6548 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]2017-08-28 19:08:29.778 INFO 6548 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup2017-08-28 19:08:29.831 INFO 6548 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080/http2017-08-28 19:08:29.832 INFO 6548 --- [ main] test.App : Started App in 2.203 seconds (JVM running for 2.404)2017-08-28 19:09:22.035 INFO 6548 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet'2017-08-28 19:09:22.035 INFO 6548 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started2017-08-28 19:09:22.043 INFO 6548 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 8 ms
==============================================================
转换非Maven普通JAVA工程 报错:先酱紫吧,有空补充
==============================================================
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v1.1.4.RELEASE)2017-08-28 19:13:48.043 INFO 7136 --- [ main] App : Starting App on USER-20170823VM with PID 7136 (D:\Eclipse-jee-luna-SR2-win32-x86_64_workspace\PrjSpringBoot\WebContent\bin\classes started by Administrator in D:\Eclipse-jee-luna-SR2-win32-x86_64_workspace\PrjSpringBoot)2017-08-28 19:13:48.073 INFO 7136 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@5421e554: startup date [Mon Aug 28 19:13:48 CST 2017]; root of context hierarchy2017-08-28 19:13:48.400 INFO 7136 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'beanNameViewResolver': replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]2017-08-28 19:13:48.998 INFO 7136 --- [ main] .t.TomcatEmbeddedServletContainerFactory : Server initialized with port: 80802017-08-28 19:13:49.155 INFO 7136 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat2017-08-28 19:13:49.156 INFO 7136 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/7.0.632017-08-28 19:13:49.581 INFO 7136 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext2017-08-28 19:13:49.581 INFO 7136 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1510 ms2017-08-28 19:13:49.903 INFO 7136 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]2017-08-28 19:13:49.905 INFO 7136 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]2017-08-28 19:13:49.916 INFO 7136 --- [ost-startStop-1] org.apache.catalina.startup.TldConfig : 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-28 19:13:49.994 INFO 7136 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]2017-08-28 19:13:50.041 INFO 7136 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto java.lang.String App.home()2017-08-28 19:13:50.043 INFO 7136 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)2017-08-28 19:13:50.044 INFO 7136 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[text/html],custom=[]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)2017-08-28 19:13:50.309 INFO 7136 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]2017-08-28 19:13:50.309 INFO 7136 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]2017-08-28 19:13:50.418 INFO 7136 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startupException in thread "main" java.lang.NoSuchMethodError: org.apache.catalina.core.StandardContext.loadOnStartup([Lorg/apache/catalina/Container;)Vat org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedContext.deferredLoadOnStartup(TomcatEmbeddedContext.java:52)at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.startConnector(TomcatEmbeddedServletContainer.java:185)at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:152)at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:376)at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:143)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:485)at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120)at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)at org.springframework.boot.SpringApplication.run(SpringApplication.java:952)at org.springframework.boot.SpringApplication.run(SpringApplication.java:941)at App.main(App.java:23)
阅读全文
0 0
- spring boot hello Double 7 Day
- spring-boot-hello-world
- Hello Spring Boot应用程序
- spring-boot Hello World
- Hello spring boot!
- hello World Spring Boot
- spring boot一步一步-Hello word
- spring boot 之 hello world !
- Spring boot之hello word
- Spring Boot:简单Hello World
- Spring Boot 的 Hello World
- Spring Boot 之Hello World
- spring boot(1)-Hello World
- spring boot之Hello World
- Spring-boot 第一章 hello world
- Spring Boot之Hello World
- Spring boot (一) Hello World
- spring-boot 之 Hello World
- [kuangbin带你飞]专题一 简单搜索 N
- JAVA互联网架构学习之Spring其二数据库连接池及注解配置bean等
- scala自定义控制结构
- Macaca-python-iOS/Android环境搭建
- Go环境搭建:ubuntu+liteide
- spring boot hello Double 7 Day
- linux下Samba的安装和配置
- 正确的得到Mac地址
- fgets()函数
- JAVA面试经验基础篇---制胜宝典
- 程序员必须掌握的8种排序算法(六):快速排序
- Windows Server2012R2 FTP服务器配置
- Shrio授权验证详解
- 算法服务平台-Project Set Up