无法运行我的Springboot / Oracle应用程序。港口问题

时间:2017-02-06 13:09:14

标签: oracle spring-boot

我试图运行我的Springboot应用程序。我需要连接到我的Oracle数据库,但是我收到了与安装它的端口相关的错误。它是Oracle 11g Express Edition安装。我应该更改我的Oracle安装的端口吗?如果是,那该怎么办?

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

Description:

The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured.

Action:

Verify the connector's configuration, identify and stop any process that's listening on port 8080, or configure this application to listen on another port.

2017-02-06 13:58:27.402  INFO 6432 --- [           main] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@45a48c09: startup date [Mon Feb 06 13:58:15 CET 2017]; root of context hierarchy
2017-02-06 13:58:27.404  INFO 6432 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2017-02-06 13:58:27.406  INFO 6432 --- [           main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2017-02-06 13:58:27.406  INFO 6432 --- [           main] .SchemaDropperImpl$DelayedDropActionImpl : HHH000477: Starting delayed drop of schema as part of SessionFactory shut-down'
Hibernate: drop table tmt.users cascade constraints
2017-02-06 13:58:27.516 ERROR 6432 --- [           main] .SchemaDropperImpl$DelayedDropActionImpl : HHH000478: Unsuccessful: drop table tmt.users cascade constraints
Hibernate: drop sequence tmt.id_seq
2017-02-06 13:58:27.528 ERROR 6432 --- [           main] .SchemaDropperImpl$DelayedDropActionImpl : HHH000478: Unsuccessful: drop sequence tmt.id_seq
[WARNING] 
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:527)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.boot.context.embedded.tomcat.ConnectorStartFailedException: Connector configured to listen on port 8080 failed to start
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.checkThatConnectorsHaveStarted(TomcatEmbeddedServletContainer.java:213)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:189)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:297)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:145)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:784)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:386)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:329)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1235)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1224)
    at cz.nnit.TmtApplication.main(TmtApplication.java:14)
    ... 6 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.689 s
[INFO] Finished at: 2017-02-06T13:58:27+01:00
[INFO] Final Memory: 56M/482M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.BUILD-SNAPSHOT:run (default-cli) on project tmt: An exception occurred while running. null: InvocationTargetException: Connector configured to listen on port 8080 failed to start -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Process finished with exit code 1

2 个答案:

答案 0 :(得分:2)

您的问题的解决方案

 两种可能的方式
 1.请将您的Oracle端口更改为8081或9080等其他端口  2.在Spring-Boot应用程序属性文件中更改Tomcat端口  3.在src / main / resources / application.properties

中添加以下以下行
server.port=8081.

答案 1 :(得分:1)

我遇到了同样的问题,因为我突然关闭了Eclipse,而我的springboot应用程序仍在运行,而JAVA进程仍在后台运行。这就是为什么我要使用该端口的原因。