- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试从终端在 linux 中运行一个 jar 文件(打包的),但它一直失败。它在 eclipse 中运行得很好,但是当我尝试从终端运行它时,它失败了。该应用程序只是一个小服务,因为我正在学习 spring 框架。这是我在终端中得到的:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot ::
2018-01-05 11:23:19.793 INFO 20547 --- [ main] one.demo.SpringbootApplication : Starting SpringbootApplication on mumen-S400CA with PID 20547 (/home/mumen/Downloads/demo/target/. started by mumen in /home/mumen/Downloads/demo/target)
2018-01-05 11:23:19.799 INFO 20547 --- [ main] one.demo.SpringbootApplication : No active profile set, falling back to default profiles: default
2018-01-05 11:23:20.090 INFO 20547 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@42505474: startup date [Fri Jan 05 11:23:20 GST 2018]; root of context hierarchy
2018-01-05 11:23:20.637 WARN 20547 --- [ main] .i.s.PathMatchingResourcePatternResolver : Cannot search for matching files underneath URL [rsrc:one/demo/] because it does not correspond to a directory in the file system
java.io.FileNotFoundException: URL [rsrc:one/demo/] cannot be resolved to absolute file path because it does not reside in the file system: rsrc:one/demo/
at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:217) ~[jar:rsrc:spring-core-5.0.2.RELEASE.jar!/:na]
at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:70) ~[jar:rsrc:spring-core-5.0.2.RELEASE.jar!/:na]
at org.springframework.core.io.UrlResource.getFile(UrlResource.java:225) ~[jar:rsrc:spring-core-5.0.2.RELEASE.jar!/:na]
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingFileResources(PathMatchingResourcePatternResolver.java:699) [jar:rsrc:spring-core-5.0.2.RELEASE.jar!/:na]
at org.springframework.web.context.support.ServletContextResourcePatternResolver.doFindPathMatchingFileResources(ServletContextResourcePatternResolver.java:92) [jar:rsrc:spring-web-5.0.2.RELEASE.jar!/:na]
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:512) [jar:rsrc:spring-core-5.0.2.RELEASE.jar!/:na]
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:282) [jar:rsrc:spring-core-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.support.AbstractApplicationContext.getResources(AbstractApplicationContext.java:1305) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.support.GenericApplicationContext.getResources(GenericApplicationContext.java:238) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:421) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:316) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:275) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:132) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:284) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:241) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:198) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:166) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:316) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:233) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:693) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:138) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:751) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:387) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at one.demo.SpringbootApplication.main(SpringbootApplication.java:10) [rsrc:./:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) [spring-boot.jar:na]
2018-01-05 11:23:59.663 INFO 20547 --- [ main] o.h.v.i.engine.ValidatorFactoryImpl : HV000238: Temporal validation tolerance set to 0.
2018-01-05 11:24:04.427 INFO 20547 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8085 (http)
2018-01-05 11:24:05.130 INFO 20547 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-01-05 11:24:05.198 INFO 20547 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.23
2018-01-05 11:24:05.559 INFO 20547 --- [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: [/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
2018-01-05 11:24:06.720 ERROR 20547 --- [cat-startStop-1] org.apache.catalina.core.ContainerBase : A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]
at java.util.concurrent.FutureTask.report(FutureTask.java:122) [na:1.8.0_151]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) [na:1.8.0_151]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:939) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_151]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
... 6 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.StandardRoot@6f73792a]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:113) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4860) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4995) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
... 6 common frames omitted
Caused by: java.lang.Error: factory already defined
at java.net.URL.setURLStreamHandlerFactory(URL.java:1112) ~[na:1.8.0_151]
at org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.<init>(TomcatURLStreamHandlerFactory.java:130) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.getInstanceInternal(TomcatURLStreamHandlerFactory.java:53) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.register(TomcatURLStreamHandlerFactory.java:77) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.webresources.StandardRoot.registerURLStreamHandlerFactory(StandardRoot.java:699) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.webresources.StandardRoot.initInternal(StandardRoot.java:682) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
... 10 common frames omitted
2018-01-05 11:24:06.722 ERROR 20547 --- [ main] org.apache.catalina.core.ContainerBase : A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]
at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:1.8.0_151]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[na:1.8.0_151]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:939) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:367) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:98) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:84) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:413) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:176) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:177) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:150) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) [jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:138) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:751) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:387) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at one.demo.SpringbootApplication.main(SpringbootApplication.java:10) [rsrc:./:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) [spring-boot.jar:na]
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_151]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_151]
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:948) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
... 6 common frames omitted
2018-01-05 11:24:06.723 WARN 20547 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2018-01-05 11:24:06.739 INFO 20547 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-01-05 11:24:06.743 ERROR 20547 --- [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153) ~[jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[jar:rsrc:spring-context-5.0.2.RELEASE.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:138) ~[jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:751) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:387) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233) [jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at one.demo.SpringbootApplication.main(SpringbootApplication.java:10) [rsrc:./:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) [spring-boot.jar:na]
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:117) ~[jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:84) ~[jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:413) ~[jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:176) ~[jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:177) ~[jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:150) ~[jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
... 13 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardServer[-1]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:367) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:98) ~[jar:rsrc:spring-boot-2.0.0.BUILD-SNAPSHOT.jar!/:na]
... 18 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Tomcat]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
... 20 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
... 22 common frames omitted
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:948) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[jar:rsrc:tomcat-embed-core-8.5.23.jar!/:na]
... 24 common frames omitted
这是主类:
package one.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringbootApplication {
public static void main(String[] args) {
SpringApplication.run(SpringbootApplication.class, args);
}
}
这是 Controller :
package one.demo;
import java.util.ArrayList;
import java.util.List;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class BooksController {
@GetMapping("/books")
public List<Book> GetAllBooks(){
List<Book> books = new ArrayList<Book>();
books.add(new Book(11, "mo2men book", "mo2men"));
return books;
}
}
这是书类:
package one.demo;
public class Book {
long id;
String name;
String author;
public long getId() {
return id;
}
public String getName() {
return name;
}
public String getAuthor() {
return author;
}
public Book(int id, String name, String author) {
super();
this.id = id;
this.name = name;
this.author = author;
}
@Override
public String toString() {
return "Book [id=" + id + ", name=" + name + ", author=" + author + "]";
}
}
这是 pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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>one</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.BUILD-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
最佳答案
尝试将此依赖项添加到您的 POM。
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
关于Java 终端失败,eclipse 工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48125568/
我想在文件系统上手动创建文件夹/文件,以便在 eclipse 的工作区中创建新项目,并在启动 eclipse 并选择工作区时显示在项目资源管理器中。 执行此操作需要创建哪些文件,它们需要位于何处? 请
我正在关注these instructions ,但在运行 mvn eclipse:eclipse 等命令时遇到问题。 我应该如何以及在哪里运行该命令? 我的设置: Windows 7 32 位 面向
是否有任何命令可以在不实际启动 eclipse 的情况下创建 eclipse 工作区?我希望该命令成为脚本的一部分。创建工作区后,将对其进行配置(例如文本编码),然后用于将项目导入到 RTC。我知道下
我想为 Eclipse 插件创建一个自动安装程序(即不通过“更新管理器”)。我的场景很简单:用户关闭 Eclipse,将下载的 JAR 放入 dropins 文件夹,启动 Eclipse,其余的过程是
每当我们想要使用现有源位置创建 Eclipse 项目时,我们将选择现有源位置(根)作为项目位置。 Eclipse 将在该源的根目录中创建所有项目特定文件。 现在,出于某种原因,如果我们想用不同的设置重
可能被问过多次; 有没有办法从控制台(Linux 或 Windows)刷新 Eclipse 工作区文件夹。 我知道有 Ant 任务可以做到这一点。但很想知道是否有命令行技巧。 最佳答案 不,您能做的最
我说的是工具栏上的小图标。 网络上似乎没有任何这样的问题,它们都指的是 android 或自定义应用程序,而不是与 eclipse 捆绑在一起的图标。 我想知道是否有人尝试过这个,或者可以告诉我它不值
如何使用 Eclipse 比较两个文件? (目前我正在使用 WinMerge 。) 最佳答案 要在 Eclipse 中比较两个文件,请首先在 Project Explorer/Package Expl
我正在尝试将我在一个带有数据库的 Eclipse JEE6 项目中所做的所有工作转移到另一个 Eclipse 程序。我知道我将不得不重新配置很多并重建很多库文件,但是尽可能多地传输的最简单方法是什么?
在 Eclipse 中加载我的工作台并启用 TFS 插件时,它挂起。与此类似: http://social.msdn.microsoft.com/Forums/vstudio/en-US/85c1d3
Eclipse 可以通过插件包含许多不同的功能集。您是否在一个 Eclipse 中安装所有插件?或者您是否从 spring 安装 STS,从 adobe 安装 Flex eclipse,甚至从 ecl
我错误地单击了“在 Eclipse 首选项中将目标运行标记为忽略在 Eclipse 构建中(实验)”: 在哪里/如何撤消此操作? 最佳答案 m2e 使用文件 YOUR_WORKSPACE/.metad
我是 Maven 新手。我尝试执行 >mvn eclipse:eclipse -Dwtpversion=2.0。但我收到以下错误: D:\test\CounterWebApp>mvn eclips
当我运行多个 Eclipse 实例时,操作系统不断请求上述权限。 我已经授予了该权限,并且我尝试了多次禁用和启用该权限。 我正在使用, macOS Catalina(版本:10.15.3 (19D76
我有一个 Maven 项目,其中我在项目构建期间使用 wsimport 作为目标来使用 Web 服务。 org.codehaus.mojo
当尝试使用 eclipse 新软件功能安装 eclipse 时,出现此错误: Cannot complete the install because one or more required item
我已经下载了整个 Eclipse Helios/Indigo 版本的源代码。现在我想对它进行一些修改等等。所以我导入了整个源代码,但现在我在编译时遇到了 n 个错误。此外,我正在尝试 RunAs> 插
我已经安装了 eclipse Oxygen 并且正在尝试连接到 Eclipse 市场,以安装插件,它给出了以下异常 - org.eclipse.equinox.p2.core.ProvisionExc
我的 IDE 中安装了来自 Sonatype 的 m2Eclipse 插件。它允许我通过右键单击 pom.xml 文件并导航到“运行方式”菜单来运行各种 Maven 命令(打包、安装等)。 但是,我还
我在 Windows7 64 位上运行 Maven 3 时遇到问题。当我执行maven eclipse:eclipse(我使用maven-eclipse-plugin 2.8)时,maven不会创建任
我是一名优秀的程序员,十分优秀!