-2

I have tried to solve this from yesterday but failed to solve. please help me to solve. How can I solve this? I am trying to deploy my first ever springboot web application

what are you expecting to get out i got error in console. i tried the entire application from every aspect. i think it is a server problem

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

    2019-03-14 14:22:33.105  INFO 4640 --- [  restartedMain] 
    com.application.StudentApplication       : Starting StudentApplication on A- 
    PC with PID 4640 
    (C:\Users\A\Desktop\sushovan_java\apringhibernatejpademo\target\classes 
    started by A in C:\Users\A\Desktop\sushovan_java\apringhibernatejpademo)
    2019-03-14 14:22:33.115  INFO 4640 --- [  restartedMain] 
    com.application.StudentApplication       : No active profile set, falling 
    back to default profiles: default
    2019-03-14 14:22:33.246  INFO 4640 --- [  restartedMain] 
    .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults 
    active! Set 'spring.devtools.add-properties' to 'false' to disable
2019-03-14 14:22:33.246  INFO 4640 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2019-03-14 14:22:35.509  INFO 4640 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-03-14 14:22:35.549  INFO 4640 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 26ms. Found 0 repository interfaces.
2019-03-14 14:22:36.717  INFO 4640 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$6f75cc55] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-03-14 14:22:37.776  INFO 4640 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2019-03-14 14:22:37.846  INFO 4640 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-03-14 14:22:37.853  INFO 4640 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.16]
2019-03-14 14:22:37.878  INFO 4640 --- [  restartedMain] 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\jre1.8.0_202\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_202/bin/server;C:/Program Files/Java/jre1.8.0_202/bin;C:/Program Files/Java/jre1.8.0_202/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\eclipse;;.]
2019-03-14 14:22:38.553  INFO 4640 --- [  restartedMain] org.apache.jasper.servlet.TldScanner     : 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.
2019-03-14 14:22:38.565  INFO 4640 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-03-14 14:22:38.567  INFO 4640 --- [  restartedMain] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 5320 ms
2019-03-14 14:22:39.148  INFO 4640 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2019-03-14 14:22:39.529  INFO 4640 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2019-03-14 14:22:39.668  INFO 4640 --- [  restartedMain] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
    name: default
    ...]
2019-03-14 14:22:39.834  INFO 4640 --- [  restartedMain] org.hibernate.Version                    : HHH000412: Hibernate Core {5.3.7.Final}
2019-03-14 14:22:39.837  INFO 4640 --- [  restartedMain] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
2019-03-14 14:22:40.215  INFO 4640 --- [  restartedMain] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
2019-03-14 14:22:40.524  INFO 4640 --- [  restartedMain] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
2019-03-14 14:22:41.156  INFO 4640 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-03-14 14:22:41.200  INFO 4640 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2019-03-14 14:22:41.812  INFO 4640 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2019-03-14 14:22:41.933  WARN 4640 --- [  restartedMain] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2019-03-14 14:22:42.154  WARN 4640 --- [  restartedMain] ion$DefaultTemplateResolverConfiguration : Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)
2019-03-14 14:22:42.698 ERROR 4640 --- [  restartedMain] org.apache.catalina.util.LifecycleBase   : Failed to start component [Connector[HTTP/1.1-8080]]

org.apache.catalina.LifecycleException: Protocol handler start failed
    at org.apache.catalina.connector.Connector.startInternal(Connector.java:1008) ~[catalina.jar:9.0.16]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[catalina.jar:9.0.16]
    at org.apache.catalina.core.StandardService.addConnector(StandardService.java:226) [catalina.jar:9.0.16]
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:259) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:197) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:311) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:164) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at com.application.StudentApplication.main(StudentApplication.java:13) [classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_202]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_202]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_202]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_202]
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.1.3.RELEASE.jar:2.1.3.RELEASE]
Caused by: java.net.BindException: Address already in use: bind
    at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_202]
    at sun.nio.ch.Net.bind(Unknown Source) ~[na:1.8.0_202]
    at sun.nio.ch.Net.bind(Unknown Source) ~[na:1.8.0_202]
    at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) ~[na:1.8.0_202]
    at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) ~[na:1.8.0_202]
    at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:236) ~[tomcat-coyote.jar:9.0.16]
    at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:210) ~[tomcat-coyote.jar:9.0.16]
    at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1085) ~[tomcat-coyote.jar:9.0.16]
    at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1171) ~[tomcat-coyote.jar:9.0.16]
    at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:568) ~[tomcat-coyote.jar:9.0.16]
    at org.apache.catalina.connector.Connector.startInternal(Connector.java:1005) ~[catalina.jar:9.0.16]
    ... 19 common frames omitted

2019-03-14 14:22:42.723  INFO 4640 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2019-03-14 14:22:42.747  INFO 4640 --- [  restartedMain] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-03-14 14:22:42.751 ERROR 4640 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
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.

2019-03-14 14:22:42.762  INFO 4640 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
2019-03-14 14:22:42.766  INFO 4640 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2019-03-14 14:22:42.771  INFO 4640 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2019-03-14 14:22:42.789  INFO 4640 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
  • Address already in use: bind. port 8080 is already used by another process. Either stop that process or make your spring boot app to listen on different port – Harshit Mar 14 '19 at 09:29
  • 3
    Possible duplicate of ["Address already in use: bind" when running Spring Boot application](https://stackoverflow.com/questions/34804685/address-already-in-use-bind-when-running-spring-boot-application) – Harshit Mar 14 '19 at 09:31
  • Possible duplicate of [8080 port already taken issue when trying to redeploy project from Spring Tool Suite IDE](https://stackoverflow.com/questions/40118878/8080-port-already-taken-issue-when-trying-to-redeploy-project-from-spring-tool-s) – Javierif Mar 14 '19 at 10:05

3 Answers3

0

According to you exception stacktrace,

Caused by: java.net.BindException: Address already in use: bind

the port 8080 on your machine is already used by another process.

Solutions

  • You need to use another port for your application
  • You can find this other process and stop it
Mickael
  • 4,003
  • 2
  • 25
  • 37
0

Solution:1 Set the port which doesn't have any running process.

Set Different Port for your application.properties

server.port=8088

Solution2: Kill the Process on a particular port

  1. find a process with port 8080

  2. Kill the Process using the Process ID You can see PID on the rightmost side. Here 12345


netstat -ano | findstr :8080
taskkill /PID 12345 /F
Patel Romil
  • 9,276
  • 7
  • 27
  • 56
0

8080 port is already used by some other process.

  1. go to resource monitor. please find screenshot , you can find which process using this port.
  2. or change port in application.properties in /src/main/resources/ with server.port=7788

enter image description here