I am using slf4j logger in my application. But I don't the see the logs in the console
This is my application class
#SpringBootApplication
public class InternalReplacerServiceApplication {
public static void main(String[] args) {
SpringApplication.run(InternalReplacerServiceApplication.class, args);
Logger LOG = LoggerFactory.getLogger(InternalReplacerServiceApplication.class);
LOG.debug("inside app");
}
}
When I run the app these are the logs I see
022-08-29 13:00:21.570 INFO 17420 --- [ restartedMain] c.j.j.InternalReplacerServiceApplication : Starting InternalReplacerServiceApplication using Java 17.0.4 on W10-lTkFoL0JX1t with PID 17420 (C:\Users\wgupta\Backend\internal_replacer_service\target\classes started by wgupta in C:\Users\wgupta\Backend\internal_replacer_service)
2022-08-29 13:00:21.572 INFO 17420 --- [ restartedMain] c.j.j.InternalReplacerServiceApplication : No active profile set, falling back to 1 default profile: "default"
2022-08-29 13:00:21.648 INFO 17420 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2022-08-29 13:00:21.648 INFO 17420 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2022-08-29 13:00:22.480 INFO 17420 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
2022-08-29 13:00:22.484 INFO 17420 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2022-08-29 13:00:22.519 INFO 17420 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 15 ms. Found 0 Redis repository interfaces.
2022-08-29 13:00:23.409 INFO 17420 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http)
2022-08-29 13:00:23.430 INFO 17420 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-08-29 13:00:23.431 INFO 17420 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.64]
2022-08-29 13:00:23.559 INFO 17420 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2022-08-29 13:00:23.559 INFO 17420 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1910 ms
2022-08-29 13:00:24.807 INFO 17420 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2022-08-29 13:00:24.861 INFO 17420 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path ''
2022-08-29 13:00:24.879 INFO 17420 --- [ restartedMain] c.j.j.InternalReplacerServiceApplication : Started InternalReplacerServiceApplication in 3.832 seconds (JVM running for 4.524)
This is the application properties
server.port=8081
# Redis Config
spring.cache.type=redis
spring.redis.host=127.0.0.1
spring.redis.port=6379
This is pom.xml dependencies
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.lindstrom</groupId>
<artifactId>m3u8-parser</artifactId>
<version>0.22</version>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- Parameter names -->
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-parameter-names</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
</dependency>
</dependencies>
As Dirk mentioned, the default level is INFO.
You can enable debug for a logger in application.properties:
logging.level.com.example=debug
Where com.example is the name of the logger.
Related
I am trying to launch a simple Eureka server via Spring Cloud Netflix and in Kotlin, but I keep receiving Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:8761/eureka/}, exception=java.net.ConnectException: Connection refused stacktrace=com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused, no matter how many times I change my application.properties in a variety of different ways, with the help of multiple posts on here. How can I fix this?
My 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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2021.0.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<artifactId>discovery-server</artifactId>
<groupId>org.shopping</groupId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>discovery-server</name>
<properties>
<java.version>11</java.version>
<kotlin.version>1.6.21</kotlin.version>
<spring-cloud.version>2021.0.4</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<configuration>
<args>
<arg>-Xjsr305=strict</arg>
</args>
<compilerPlugins>
<plugin>spring</plugin>
</compilerPlugins>
</configuration>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-allopen</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
My DiscoveryServerApplication:
package com.shopping.discoveryserver
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer
#SpringBootApplication
#EnableEurekaServer
class DiscoveryServerApplication
fun main(args: Array<String>) {
runApplication<DiscoveryServerApplication>(*args)
}
My application.properties:
server.port=8761
spring.application.name=eureka-server
eureka.instance.hostname=localhost
eureka.server.maxThreadsForPeerReplication=0
eureka.client.registerWithEureka=false
eureka.client.fetchRegistry=false
Spring Boot log:
2022-10-17 00:17:38.665 INFO 81886 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : http://localhost:8888
2022-10-17 00:17:38.743 INFO 81886 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Connect Timeout Exception on Url - http://localhost:8888. Will be trying the next url if available
2022-10-17 00:17:38.743 WARN 81886 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/application/default": Connection refused; nested exception is java.net.ConnectException: Connection refused
2022-10-17 00:17:38.745 INFO 81886 --- [ main] c.s.d.DiscoveryServerApplicationKt : No active profile set, falling back to 1 default profile: "default"
2022-10-17 00:17:39.393 INFO 81886 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=c3bbf1c6-4eb5-3807-b805-19115a4714b1
2022-10-17 00:17:39.606 INFO 81886 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2022-10-17 00:17:39.613 INFO 81886 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-10-17 00:17:39.614 INFO 81886 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.65]
2022-10-17 00:17:39.723 INFO 81886 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2022-10-17 00:17:39.723 INFO 81886 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 963 ms
2022-10-17 00:17:40.044 INFO 81886 --- [ main] c.s.j.s.i.a.WebApplicationImpl : Initiating Jersey application, version 'Jersey: 1.19.4 05/24/2017 03:20 PM'
2022-10-17 00:17:40.093 INFO 81886 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2022-10-17 00:17:40.093 INFO 81886 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2022-10-17 00:17:40.192 INFO 81886 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2022-10-17 00:17:40.192 INFO 81886 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2022-10-17 00:17:40.882 INFO 81886 --- [ main] DiscoveryClientOptionalArgsConfiguration : Eureka HTTP Client uses Jersey
2022-10-17 00:17:40.927 WARN 81886 --- [ main] iguration$LoadBalancerCaffeineWarnLogger : Spring Cloud LoadBalancer is currently working with the default cache. While this cache implementation is useful for development and tests, it's recommended to use Caffeine cache in production.You can switch to using Caffeine cache, by adding it and org.springframework.cache.caffeine.CaffeineCacheManager to the classpath.
2022-10-17 00:17:40.939 INFO 81886 --- [ main] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
2022-10-17 00:17:40.972 INFO 81886 --- [ main] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1
2022-10-17 00:17:41.089 INFO 81886 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2022-10-17 00:17:41.089 INFO 81886 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2022-10-17 00:17:41.089 INFO 81886 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2022-10-17 00:17:41.089 INFO 81886 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2022-10-17 00:17:41.172 INFO 81886 --- [ main] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
2022-10-17 00:17:41.183 INFO 81886 --- [ main] com.netflix.discovery.DiscoveryClient : Disable delta property : false
2022-10-17 00:17:41.183 INFO 81886 --- [ main] com.netflix.discovery.DiscoveryClient : Single vip registry refresh property : null
2022-10-17 00:17:41.184 INFO 81886 --- [ main] com.netflix.discovery.DiscoveryClient : Force full registry fetch : false
2022-10-17 00:17:41.184 INFO 81886 --- [ main] com.netflix.discovery.DiscoveryClient : Application is null : false
2022-10-17 00:17:41.184 INFO 81886 --- [ main] com.netflix.discovery.DiscoveryClient : Registered Applications size is zero : true
2022-10-17 00:17:41.184 INFO 81886 --- [ main] com.netflix.discovery.DiscoveryClient : Application version is -1: true
2022-10-17 00:17:41.184 INFO 81886 --- [ main] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server
2022-10-17 00:17:41.228 INFO 81886 --- [ main] c.n.d.s.t.d.RedirectingEurekaHttpClient : Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:8761/eureka/}, exception=java.net.ConnectException: Connection refused stacktrace=com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused
...
at com.shopping.discoveryserver.DiscoveryServerApplicationKt.main(DiscoveryServerApplication.kt:15)
Caused by: java.net.ConnectException: Connection refused
I figured it out, and since this seems to be an unanswered & common question on here, I will post my pom & properties file on here (adapted from Cannot connect to Eureka server. Exception: java.net.ConnectException: Connection refused: connect):
My 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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<artifactId>api-discovery</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>discovery-server</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
<kotlin.version>1.6.21</kotlin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</dependency>
<dependency>
<!-- Setup Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<!-- Setup Spring MVC & REST, use Embedded Tomcat -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<!-- Spring Cloud starter -->
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
<version>1.4.6.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
<!-- Spring Cloud dependencies -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Finchley.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<configuration>
<args>
<arg>-Xjsr305=strict</arg>
</args>
<compilerPlugins>
<plugin>spring</plugin>
</compilerPlugins>
</configuration>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-allopen</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
My application.properties:
server.port=8761
spring.application.name=eureka-server
eureka.instance.hostname=localhost
eureka.server.maxThreadsForPeerReplication=0
eureka.client.registerWithEureka=false
eureka.client.fetchRegistry=false
I ended up not using spring-cloud-starter-netflix-eureka-server as a dependency, and instead opted for the (deprecated) spring-cloud-starter-eureka-server. Eureka is accessible from localhost:8761.
I check Spring boot project from start.spring.io
When I start IntelliJIDEA I get whitelabel message in browser by address http://localhost:8080/: This application has no explicit mapping for /error, so you are seeing this as a fallback.
Is it ok?
Structure of my project:
My application.properties:
MySQL properties
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasource.username=root
spring.datasource.password=admin
Hibernate properties
hibernate.show_sql=true
hibernate.hbm2ddl.auto=update
hibernate.dialect.MySQLDialect=org.hibernate.dialect.MySQL5Dialect
#Thymeleaf properties
spring.thymeleaf.cache=false
spring.thymeleaf.enabled=true
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.mvc.hiddenmethod.filter.enabled=true
spring.profiles.active=#spring.profiles.active#
My pom.xml:
4.0.0
org.springframework.boot
spring-boot-starter-parent
3.0.0-M4
com.example
springbootdem
0.0.1-SNAPSHOT
war
springbootdem
Demo project for Spring Boot
<java.version>17</java.version>
org.springframework.boot
spring-boot-starter-data-jpa
org.springframework.boot
spring-boot-starter-thymeleaf
org.springframework.boot
spring-boot-starter-web
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</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-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
My run log:
C:\Users\admin.jdks\openjdk-18.0.1.1\bin\java.exe -XX:TieredStopAtLevel=1 -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2022.2\lib\idea_rt.jar=56741:C:\Program Files\JetBrains\IntelliJ IDEA 2022.2\bin" -Dfile.encoding=UTF-8 -classpath C:\java\springbootdem\target\classes;C:\Users\admin.m2\repository\org\springframework\boot\spring-boot-starter-data-jpa\3.0.0-M4\spring-boot-starter-data-jpa-3.0.0-M4.jar;C:\Users\admin.m2\repository\org\springframework\boot\spring-boot-starter-aop\3.0.0-M4\spring-boot-starter-aop-3.0.0-M4.jar;C:\Users\admin.m2\repository\org\springframework\spring-aop\6.0.0-M5\spring-aop-6.0.0-M5.jar;C:\Users\admin.m2\repository\org\aspectj\aspectjweaver\1.9.9.1\aspectjweaver-1.9.9.1.jar;C:\Users\admin.m2\repository\org\springframework\boot\spring-boot-starter-jdbc\3.0.0-M4\spring-boot-starter-jdbc-3.0.0-M4.jar;C:\Users\admin.m2\repository\com\zaxxer\HikariCP\5.0.1\HikariCP-5.0.1.jar;C:\Users\admin.m2\repository\org\springframework\spring-jdbc\6.0.0-M5\spring-jdbc-6.0.0-M5.jar;C:\Users\admin.m2\repository\org\hibernate\orm\hibernate-core\6.1.1.Final\hibernate-core-6.1.1.Final.jar;C:\Users\admin.m2\repository\jakarta\persistence\jakarta.persistence-api\3.0.0\jakarta.persistence-api-3.0.0.jar;C:\Users\admin.m2\repository\jakarta\transaction\jakarta.transaction-api\2.0.1\jakarta.transaction-api-2.0.1.jar;C:\Users\admin.m2\repository\org\jboss\logging\jboss-logging\3.5.0.Final\jboss-logging-3.5.0.Final.jar;C:\Users\admin.m2\repository\org\hibernate\common\hibernate-commons-annotations\6.0.2.Final\hibernate-commons-annotations-6.0.2.Final.jar;C:\Users\admin.m2\repository\org\jboss\jandex\2.4.2.Final\jandex-2.4.2.Final.jar;C:\Users\admin.m2\repository\com\fasterxml\classmate\1.5.1\classmate-1.5.1.jar;C:\Users\admin.m2\repository\net\bytebuddy\byte-buddy\1.12.12\byte-buddy-1.12.12.jar;C:\Users\admin.m2\repository\org\glassfish\jaxb\jaxb-runtime\3.0.2\jaxb-runtime-3.0.2.jar;C:\Users\admin.m2\repository\org\glassfish\jaxb\jaxb-core\3.0.2\jaxb-core-3.0.2.jar;C:\Users\admin.m2\repository\org\glassfish\jaxb\txw2\3.0.2\txw2-3.0.2.jar;C:\Users\admin.m2\repository\com\sun\istack\istack-commons-runtime\4.0.1\istack-commons-runtime-4.0.1.jar;C:\Users\admin.m2\repository\jakarta\inject\jakarta.inject-api\2.0.0\jakarta.inject-api-2.0.0.jar;C:\Users\admin.m2\repository\org\antlr\antlr4-runtime\4.10\antlr4-runtime-4.10.jar;C:\Users\admin.m2\repository\org\springframework\data\spring-data-jpa\3.0.0-M5\spring-data-jpa-3.0.0-M5.jar;C:\Users\admin.m2\repository\org\springframework\data\spring-data-commons\3.0.0-M5\spring-data-commons-3.0.0-M5.jar;C:\Users\admin.m2\repository\org\springframework\spring-orm\6.0.0-M5\spring-orm-6.0.0-M5.jar;C:\Users\admin.m2\repository\org\springframework\spring-context\6.0.0-M5\spring-context-6.0.0-M5.jar;C:\Users\admin.m2\repository\org\springframework\spring-tx\6.0.0-M5\spring-tx-6.0.0-M5.jar;C:\Users\admin.m2\repository\org\springframework\spring-beans\6.0.0-M5\spring-beans-6.0.0-M5.jar;C:\Users\admin.m2\repository\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;C:\Users\admin.m2\repository\org\springframework\spring-aspects\6.0.0-M5\spring-aspects-6.0.0-M5.jar;C:\Users\admin.m2\repository\org\springframework\boot\spring-boot-starter-thymeleaf\3.0.0-M4\spring-boot-starter-thymeleaf-3.0.0-M4.jar;C:\Users\admin.m2\repository\org\springframework\boot\spring-boot-starter\3.0.0-M4\spring-boot-starter-3.0.0-M4.jar;C:\Users\admin.m2\repository\org\springframework\boot\spring-boot-starter-logging\3.0.0-M4\spring-boot-starter-logging-3.0.0-M4.jar;C:\Users\admin.m2\repository\ch\qos\logback\logback-classic\1.2.11\logback-classic-1.2.11.jar;C:\Users\admin.m2\repository\ch\qos\logback\logback-core\1.2.11\logback-core-1.2.11.jar;C:\Users\admin.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.18.0\log4j-to-slf4j-2.18.0.jar;C:\Users\admin.m2\repository\org\apache\logging\log4j\log4j-api\2.18.0\log4j-api-2.18.0.jar;C:\Users\admin.m2\repository\org\slf4j\jul-to-slf4j\1.7.36\jul-to-slf4j-1.7.36.jar;C:\Users\admin.m2\repository\org\yaml\snakeyaml\1.30\snakeyaml-1.30.jar;C:\Users\admin.m2\repository\org\thymeleaf\thymeleaf-spring6\3.1.0.M2\thymeleaf-spring6-3.1.0.M2.jar;C:\Users\admin.m2\repository\org\thymeleaf\thymeleaf\3.1.0.M2\thymeleaf-3.1.0.M2.jar;C:\Users\admin.m2\repository\org\attoparser\attoparser\2.0.5.RELEASE\attoparser-2.0.5.RELEASE.jar;C:\Users\admin.m2\repository\org\unbescape\unbescape\1.1.6.RELEASE\unbescape-1.1.6.RELEASE.jar;C:\Users\admin.m2\repository\org\thymeleaf\extras\thymeleaf-extras-java8time\3.0.4.RELEASE\thymeleaf-extras-java8time-3.0.4.RELEASE.jar;C:\Users\admin.m2\repository\org\springframework\boot\spring-boot-starter-web\3.0.0-M4\spring-boot-starter-web-3.0.0-M4.jar;C:\Users\admin.m2\repository\org\springframework\boot\spring-boot-starter-json\3.0.0-M4\spring-boot-starter-json-3.0.0-M4.jar;C:\Users\admin.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.13.3\jackson-databind-2.13.3.jar;C:\Users\admin.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.13.3\jackson-annotations-2.13.3.jar;C:\Users\admin.m2\repository\com\fasterxml\jackson\core\jackson-core\2.13.3\jackson-core-2.13.3.jar;C:\Users\admin.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.13.3\jackson-datatype-jdk8-2.13.3.jar;C:\Users\admin.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.13.3\jackson-datatype-jsr310-2.13.3.jar;C:\Users\admin.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.13.3\jackson-module-parameter-names-2.13.3.jar;C:\Users\admin.m2\repository\org\springframework\spring-web\6.0.0-M5\spring-web-6.0.0-M5.jar;C:\Users\admin.m2\repository\org\springframework\spring-webmvc\6.0.0-M5\spring-webmvc-6.0.0-M5.jar;C:\Users\admin.m2\repository\org\springframework\spring-expression\6.0.0-M5\spring-expression-6.0.0-M5.jar;C:\Users\admin.m2\repository\org\springframework\boot\spring-boot-devtools\3.0.0-M4\spring-boot-devtools-3.0.0-M4.jar;C:\Users\admin.m2\repository\org\springframework\boot\spring-boot\3.0.0-M4\spring-boot-3.0.0-M4.jar;C:\Users\admin.m2\repository\org\springframework\boot\spring-boot-autoconfigure\3.0.0-M4\spring-boot-autoconfigure-3.0.0-M4.jar;C:\Users\admin.m2\repository\mysql\mysql-connector-java\8.0.29\mysql-connector-java-8.0.29.jar;C:\Users\admin.m2\repository\org\springframework\boot\spring-boot-starter-tomcat\3.0.0-M4\spring-boot-starter-tomcat-3.0.0-M4.jar;C:\Users\admin.m2\repository\jakarta\annotation\jakarta.annotation-api\2.0.0\jakarta.annotation-api-2.0.0.jar;C:\Users\admin.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\10.0.22\tomcat-embed-core-10.0.22.jar;C:\Users\admin.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\10.0.22\tomcat-embed-el-10.0.22.jar;C:\Users\admin.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\10.0.22\tomcat-embed-websocket-10.0.22.jar;C:\Users\admin.m2\repository\jakarta\xml\bind\jakarta.xml.bind-api\3.0.1\jakarta.xml.bind-api-3.0.1.jar;C:\Users\admin.m2\repository\com\sun\activation\jakarta.activation\2.0.1\jakarta.activation-2.0.1.jar;C:\Users\admin.m2\repository\org\springframework\spring-core\6.0.0-M5\spring-core-6.0.0-M5.jar;C:\Users\admin.m2\repository\org\springframework\spring-jcl\6.0.0-M5\spring-jcl-6.0.0-M5.jar com.example.springbootdem.SpringbootdemApplication
. ____ _ __ _ _
/\ / ' __ _ () __ __ _ \ \ \
( ( )__ | '_ | '| | ' / ` | \ \ \
\/ __)| |)| | | | | || (| | ) ) ) )
' || .__|| ||| |_, | / / / /
=========||==============|/=////
:: Spring Boot :: (v3.0.0-M4)
2022-07-31T15:26:36.805+03:00 INFO 1700 --- [ restartedMain] c.e.s.SpringbootdemApplication : Starting SpringbootdemApplication using Java 18.0.1.1 on DESKTOP-AAKSGJM with PID 1700 (C:\java\springbootdem\target\classes started by admin in C:\java\springbootdem)
2022-07-31T15:26:36.810+03:00 INFO 1700 --- [ restartedMain] c.e.s.SpringbootdemApplication : The following 1 profile is active: "#spring.profiles.active#"
2022-07-31T15:26:36.929+03:00 INFO 1700 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2022-07-31T15:26:36.929+03:00 INFO 1700 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2022-07-31T15:26:38.046+03:00 INFO 1700 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-07-31T15:26:38.074+03:00 INFO 1700 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 15 ms. Found 0 JPA repository interfaces.
2022-07-31T15:26:39.132+03:00 INFO 1700 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2022-07-31T15:26:39.157+03:00 INFO 1700 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-07-31T15:26:39.157+03:00 INFO 1700 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.0.22]
2022-07-31T15:26:39.288+03:00 INFO 1700 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2022-07-31T15:26:39.289+03:00 INFO 1700 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2358 ms
2022-07-31T15:26:39.582+03:00 INFO 1700 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2022-07-31T15:26:40.573+03:00 INFO 1700 --- [ restartedMain] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl#10d967f8
2022-07-31T15:26:40.578+03:00 INFO 1700 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2022-07-31T15:26:40.654+03:00 INFO 1700 --- [ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-07-31T15:26:40.805+03:00 INFO 1700 --- [ restartedMain] org.hibernate.Version : HHH000412: Hibernate ORM core version 6.1.1.Final
2022-07-31T15:26:41.283+03:00 WARN 1700 --- [ restartedMain] org.hibernate.orm.deprecation : HHH90000021: Encountered deprecated setting [javax.persistence.sharedCache.mode], use [jakarta.persistence.sharedCache.mode] instead
2022-07-31T15:26:41.720+03:00 INFO 1700 --- [ restartedMain] SQL dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
2022-07-31T15:26:42.197+03:00 INFO 1700 --- [ restartedMain] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2022-07-31T15:26:42.212+03:00 INFO 1700 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2022-07-31T15:26:42.295+03:00 WARN 1700 --- [ restartedMain] JpaBaseConfiguration$JpaWebConfiguration : 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
2022-07-31T15:26:42.663+03:00 WARN 1700 --- [ restartedMain] ion$DefaultTemplateResolverConfiguration : Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)
2022-07-31T15:26:42.804+03:00 INFO 1700 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2022-07-31T15:26:42.864+03:00 INFO 1700 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2022-07-31T15:26:42.877+03:00 INFO 1700 --- [ restartedMain] c.e.s.SpringbootdemApplication : Started SpringbootdemApplication in 6.829 seconds (process running for 8.4)
2022-07-31T15:29:28.139+03:00 INFO 1700 --- [nio-8080-exec-3] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-07-31T15:29:28.213+03:00 INFO 1700 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2022-07-31T15:29:28.770+03:00 INFO 1700 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : Completed initialization in 555 ms
Yes, it's ok.
One should add controller #RequestMapping - to point url for application.
I used Spring Initializr to set up my Spring Application. The application exits without any error as soon as I run it. The console logs this:
2021-02-22 13:31:20.206 INFO 68562 --- [extShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-02-22 13:31:20.216 INFO 68562 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-02-22 13:31:20.294 INFO 68562 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
I tried changing the spring-boot-starter-parent version but that still doesn't seem to work. I tried rebuilding the project but that didn't work as well. Could you tell me what I'm doing wrong here? It doesn't even return any error. It just doesn't run on the server.
Here is my 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.manjitmentor.sms</groupId>
<artifactId>sms</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>sms</name>
<description>Student Management System project by Java Full Stack Mentor Manjit Shakya.</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>logback-classic</groupId>
<artifactId>ch.qos.logback</artifactId>
</exclusion>
<exclusion>
<groupId>log4j-over-slf4j</groupId>
<artifactId>org.slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.modelmapper/modelmapper -->
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<version>2.3.9</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!--Logging-->
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.30</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
Here's my yml file:
server:
port: 8080
servlet:
context-path: /sms
spring:
application:
name: sms
datasource:
url: jdbc:mysql://localhost:3306/SMS
username: root
password: idrunkh2o
driver-class-name: com.mysql.cj.jdbc.Driver
hikari:
maximum-pool-size: 100
minimum-idel: 50
jpa:
database-platfrom: org.hibernate.dialect.MySQL5InnoDBDialect
generate-ddl: true
show-sql: true
hibernate:
ddl-auto: update
COMPLETE LOG:
/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home/bin/java -javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=56405:/Applications/IntelliJ IDEA CE.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Users/aakashthakur-work/Documents/F1SoftManjitShakyaTraining/sms/target/classes:/Users/aakashthakur-work/.m2/repository/org/springframework/boot/spring-boot-starter-data-jpa/2.4.2/spring-boot-starter-data-jpa-2.4.2.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/boot/spring-boot-starter-aop/2.4.2/spring-boot-starter-aop-2.4.2.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/spring-aop/5.3.3/spring-aop-5.3.3.jar:/Users/aakashthakur-work/.m2/repository/org/aspectj/aspectjweaver/1.9.6/aspectjweaver-1.9.6.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/boot/spring-boot-starter-jdbc/2.4.2/spring-boot-starter-jdbc-2.4.2.jar:/Users/aakashthakur-work/.m2/repository/com/zaxxer/HikariCP/3.4.5/HikariCP-3.4.5.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/spring-jdbc/5.3.3/spring-jdbc-5.3.3.jar:/Users/aakashthakur-work/.m2/repository/jakarta/transaction/jakarta.transaction-api/1.3.3/jakarta.transaction-api-1.3.3.jar:/Users/aakashthakur-work/.m2/repository/jakarta/persistence/jakarta.persistence-api/2.2.3/jakarta.persistence-api-2.2.3.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/data/spring-data-jpa/2.4.3/spring-data-jpa-2.4.3.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/data/spring-data-commons/2.4.3/spring-data-commons-2.4.3.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/spring-orm/5.3.3/spring-orm-5.3.3.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/spring-context/5.3.3/spring-context-5.3.3.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/spring-tx/5.3.3/spring-tx-5.3.3.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/spring-beans/5.3.3/spring-beans-5.3.3.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/spring-aspects/5.3.3/spring-aspects-5.3.3.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/boot/spring-boot-starter-web/2.4.2/spring-boot-starter-web-2.4.2.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/boot/spring-boot-starter/2.4.2/spring-boot-starter-2.4.2.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/boot/spring-boot-starter-logging/2.4.2/spring-boot-starter-logging-2.4.2.jar:/Users/aakashthakur-work/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/Users/aakashthakur-work/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:/Users/aakashthakur-work/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.13.3/log4j-to-slf4j-2.13.3.jar:/Users/aakashthakur-work/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar:/Users/aakashthakur-work/.m2/repository/org/slf4j/jul-to-slf4j/1.7.30/jul-to-slf4j-1.7.30.jar:/Users/aakashthakur-work/.m2/repository/org/yaml/snakeyaml/1.27/snakeyaml-1.27.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/boot/spring-boot-starter-json/2.4.2/spring-boot-starter-json-2.4.2.jar:/Users/aakashthakur-work/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.11.4/jackson-databind-2.11.4.jar:/Users/aakashthakur-work/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.11.4/jackson-annotations-2.11.4.jar:/Users/aakashthakur-work/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.11.4/jackson-core-2.11.4.jar:/Users/aakashthakur-work/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.11.4/jackson-datatype-jdk8-2.11.4.jar:/Users/aakashthakur-work/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.11.4/jackson-datatype-jsr310-2.11.4.jar:/Users/aakashthakur-work/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.11.4/jackson-module-parameter-names-2.11.4.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/spring-web/5.3.3/spring-web-5.3.3.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/spring-webmvc/5.3.3/spring-webmvc-5.3.3.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/spring-expression/5.3.3/spring-expression-5.3.3.jar:/Users/aakashthakur-work/.m2/repository/org/modelmapper/modelmapper/2.3.9/modelmapper-2.3.9.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/boot/spring-boot-devtools/2.4.2/spring-boot-devtools-2.4.2.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/boot/spring-boot/2.4.2/spring-boot-2.4.2.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.4.2/spring-boot-autoconfigure-2.4.2.jar:/Users/aakashthakur-work/.m2/repository/mysql/mysql-connector-java/8.0.22/mysql-connector-java-8.0.22.jar:/Users/aakashthakur-work/.m2/repository/org/projectlombok/lombok/1.18.16/lombok-1.18.16.jar:/Users/aakashthakur-work/.m2/repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar:/Users/aakashthakur-work/.m2/repository/jakarta/xml/bind/jakarta.xml.bind-api/2.3.3/jakarta.xml.bind-api-2.3.3.jar:/Users/aakashthakur-work/.m2/repository/jakarta/activation/jakarta.activation-api/1.2.2/jakarta.activation-api-1.2.2.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/spring-core/5.3.3/spring-core-5.3.3.jar:/Users/aakashthakur-work/.m2/repository/org/springframework/spring-jcl/5.3.3/spring-jcl-5.3.3.jar:/Users/aakashthakur-work/.m2/repository/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar:/Users/aakashthakur-work/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar:/Users/aakashthakur-work/.m2/repository/org/hibernate/hibernate-core/5.4.27.Final/hibernate-core-5.4.27.Final.jar:/Users/aakashthakur-work/.m2/repository/org/jboss/logging/jboss-logging/3.4.1.Final/jboss-logging-3.4.1.Final.jar:/Users/aakashthakur-work/.m2/repository/javax/persistence/javax.persistence-api/2.2/javax.persistence-api-2.2.jar:/Users/aakashthakur-work/.m2/repository/org/javassist/javassist/3.27.0-GA/javassist-3.27.0-GA.jar:/Users/aakashthakur-work/.m2/repository/net/bytebuddy/byte-buddy/1.10.19/byte-buddy-1.10.19.jar:/Users/aakashthakur-work/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar:/Users/aakashthakur-work/.m2/repository/org/jboss/spec/javax/transaction/jboss-transaction-api_1.2_spec/1.1.1.Final/jboss-transaction-api_1.2_spec-1.1.1.Final.jar:/Users/aakashthakur-work/.m2/repository/org/jboss/jandex/2.1.3.Final/jandex-2.1.3.Final.jar:/Users/aakashthakur-work/.m2/repository/com/fasterxml/classmate/1.5.1/classmate-1.5.1.jar:/Users/aakashthakur-work/.m2/repository/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar:/Users/aakashthakur-work/.m2/repository/org/dom4j/dom4j/2.1.3/dom4j-2.1.3.jar:/Users/aakashthakur-work/.m2/repository/org/hibernate/common/hibernate-commons-annotations/5.1.2.Final/hibernate-commons-annotations-5.1.2.Final.jar:/Users/aakashthakur-work/.m2/repository/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar:/Users/aakashthakur-work/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.3/jaxb-runtime-2.3.3.jar:/Users/aakashthakur-work/.m2/repository/org/glassfish/jaxb/txw2/2.3.3/txw2-2.3.3.jar:/Users/aakashthakur-work/.m2/repository/com/sun/istack/istack-commons-runtime/3.0.11/istack-commons-runtime-3.0.11.jar:/Users/aakashthakur-work/.m2/repository/com/sun/activation/jakarta.activation/1.2.2/jakarta.activation-1.2.2.jar:/Users/aakashthakur-work/.m2/repository/org/hibernate/hibernate-entitymanager/5.4.27.Final/hibernate-entitymanager-5.4.27.Final.jar com.manjitmentor.sms.SmsApplication
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.4.2)
2021-02-22 15:03:29.750 INFO 74414 --- [ restartedMain] com.manjitmentor.sms.SmsApplication : Starting SmsApplication using Java 11.0.9.1 on Aakashs-MacBook-Air.local with PID 74414 (/Users/aakashthakur-work/Documents/F1SoftManjitShakyaTraining/sms/target/classes started by aakashthakur-work in /Users/aakashthakur-work/Documents/F1SoftManjitShakyaTraining/sms)
2021-02-22 15:03:29.757 INFO 74414 --- [ restartedMain] com.manjitmentor.sms.SmsApplication : No active profile set, falling back to default profiles: default
2021-02-22 15:03:29.949 INFO 74414 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2021-02-22 15:03:31.312 INFO 74414 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-02-22 15:03:31.431 INFO 74414 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 97 ms. Found 1 JPA repository interfaces.
2021-02-22 15:03:32.292 INFO 74414 --- [ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-02-22 15:03:32.448 INFO 74414 --- [ restartedMain] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.27.Final
2021-02-22 15:03:32.841 INFO 74414 --- [ restartedMain] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-02-22 15:03:33.179 INFO 74414 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-02-22 15:03:33.817 INFO 74414 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-02-22 15:03:33.930 INFO 74414 --- [ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
2021-02-22 15:03:35.897 INFO 74414 --- [ restartedMain] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-02-22 15:03:35.922 INFO 74414 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-02-22 15:03:35.959 INFO 74414 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2021-02-22 15:03:36.963 INFO 74414 --- [ restartedMain] com.manjitmentor.sms.SmsApplication : Started SmsApplication in 8.539 seconds (JVM running for 10.162)
2021-02-22 15:03:36.968 INFO 74414 --- [ restartedMain] com.manjitmentor.sms.SmsApplication :
,d88~~\ e e ,d88~~\
8888 d8b d8b 8888
`Y88b d888bdY88b `Y88b
`Y88b, / Y88Y Y888b `Y88b,
8888 / YY Y888b 8888
\__88P' / Y888b \__88P'
2021-02-22 15:03:36.975 INFO 74414 --- [extShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-02-22 15:03:36.982 INFO 74414 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-02-22 15:03:37.037 INFO 74414 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
Process finished with exit code 0
I think that this is causing trouble and you should remove it
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
You have this one that has the Tomcat already embedded
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
So a brief overview on why you faced the issue:
You tried to use an external tomcat and specified to your application that you will provide it to it by the runtime <scope>provided</scope> check it here. But the application already has it embedded in it, and spring-boot by default creates a jar file, the tomcat needs a war file. In addition, the tomcat server won't launch your main method, you need to start your application as a normal spring app.
To use an external tomcat server follow these steps:
Set the packing to generate war
<packaging>war</packaging>
Add the external tomcat dependency
<dependency>
<groupid>org.springframework.boot</groupid>
<artifactid>spring-boot-starter-tomcat</artifactid>
<scope>provided</scope>
</dependency>
Exclude the embedded tomcat from the spring-boot-starter-web
<dependency>
<groupid>org.springframework.boot</groupid>
<artifactid>spring-boot-starter-web</artifactid>
<exclusions>
<exclusion>
<groupid>org.springframework.boot</groupid>
<artifactid>spring-boot-starter-tomcat</artifactid>
</exclusion>
</exclusions>
</dependency>
And make a bunch of configurations to make it start as a Spring app and add the external configuration of your spring boot app on tomcat.
Check this article here I think it will complete the whole idea. link
I used to have a similar problem. I don't precisely know how It works, I am a beginner, as you might have guessed.
Here's how I solved mine.
Right click the project and update Maven project.
Then close your Builder and restart your device.
Run the project again.
Please Keep me posted on how it works out.
It's my first Spring boot application and having some issues getting it to run. I don't understand what I'm doing wrong.
The output from the console is:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.2.1.RELEASE)
2019-11-27 09:46:46.029 INFO 13638 --- [ restartedMain] com.example.rdm.App : Starting App on nmigeo-VirtualBox with PID 13638 (/home/nmigeo/arch_repo/RDM/RDM_backend/target/classes started by nmigeo in /home/nmigeo/arch_repo/RDM/RDM_backend)
2019-11-27 09:46:46.031 INFO 13638 --- [ restartedMain] com.example.rdm.App : The following profiles are active: michel
2019-11-27 09:46:46.074 INFO 13638 --- [ restartedMain] o.s.b.devtools.restart.ChangeableUrls : The Class-Path manifest attribute in /home/nmigeo/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jaxb-runtime-2.3.2.jar referenced one or more files that do not exist: file:/home/nmigeo/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.xml.bind-api-2.3.2.jar,file:/home/nmigeo/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/txw2-2.3.2.jar,file:/home/nmigeo/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/istack-commons-runtime-3.0.8.jar,file:/home/nmigeo/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/stax-ex-1.8.1.jar,file:/home/nmigeo/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/FastInfoset-1.2.16.jar,file:/home/nmigeo/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.activation-api-1.2.1.jar
2019-11-27 09:46:46.074 INFO 13638 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2019-11-27 09:46:46.075 INFO 13638 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2019-11-27 09:46:46.964 INFO 13638 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-11-27 09:46:46.986 INFO 13638 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 14ms. Found 0 repository interfaces.
2019-11-27 09:46:47.339 INFO 13638 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.ws.config.annotation.DelegatingWsConfiguration' of type [org.springframework.ws.config.annotation.DelegatingWsConfiguration$$EnhancerBySpringCGLIB$$7556ff8b] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-27 09:46:47.385 INFO 13638 --- [ restartedMain] .w.s.a.s.AnnotationActionEndpointMapping : Supporting [WS-Addressing August 2004, WS-Addressing 1.0]
2019-11-27 09:46:47.411 INFO 13638 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-27 09:46:47.763 INFO 13638 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-11-27 09:46:47.771 INFO 13638 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-11-27 09:46:47.771 INFO 13638 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.27]
2019-11-27 09:46:47.831 INFO 13638 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-11-27 09:46:47.831 INFO 13638 --- [ restartedMain] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1756 ms
2019-11-27 09:46:48.456 INFO 13638 --- [ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2019-11-27 09:46:48.659 INFO 13638 --- [ restartedMain] org.hibernate.Version : HHH000412: Hibernate Core {5.4.8.Final}
2019-11-27 09:46:48.876 INFO 13638 --- [ restartedMain] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2019-11-27 09:46:48.991 INFO 13638 --- [ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL9Dialect
2019-11-27 09:46:49.025 INFO 13638 --- [ restartedMain] o.h.e.boot.internal.EnversServiceImpl : Envers integration enabled? : true
2019-11-27 09:46:50.725 INFO 13638 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2019-11-27 09:46:50.839 INFO 13638 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2019-11-27 09:46:51.375 INFO 13638 --- [ restartedMain] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2019-11-27 09:46:51.382 INFO 13638 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-11-27 09:46:51.484 INFO 13638 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2019-11-27 09:46:51.767 WARN 13638 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'repositorySearchController' defined in URL [jar:file:/home/nmigeo/.m2/repository/org/springframework/data/spring-data-rest-webmvc/3.2.1.RELEASE/spring-data-rest-webmvc-3.2.1.RELEASE.jar!/org/springframework/data/rest/webmvc/RepositorySearchController.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityLinks' defined in class path resource [org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.rest.webmvc.support.RepositoryEntityLinks]: Factory method 'entityLinks' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'backendIdConverterRegistry' defined in class path resource [org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.plugin.core.PluginRegistry]: Factory method 'backendIdConverterRegistry' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.plugin.core.PluginRegistry.of(Ljava/util/List;)Lorg/springframework/plugin/core/PluginRegistry;
2019-11-27 09:46:51.768 INFO 13638 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2019-11-27 09:46:51.774 INFO 13638 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2019-11-27 09:46:51.791 INFO 13638 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2019-11-27 09:46:51.794 INFO 13638 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2019-11-27 09:46:51.819 INFO 13638 --- [ restartedMain] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-11-27 09:46:51.825 ERROR 13638 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.backendIdConverterRegistry(RepositoryRestMvcConfiguration.java:721)
The following method did not exist:
org.springframework.plugin.core.PluginRegistry.of(Ljava/util/List;)Lorg/springframework/plugin/core/PluginRegistry;
The method's class, org.springframework.plugin.core.PluginRegistry, is available from the following locations:
jar:file:/home/nmigeo/.m2/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar!/org/springframework/plugin/core/PluginRegistry.class
It was loaded from the following location:
file:/home/nmigeo/.m2/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.plugin.core.PluginRegistry
and from what I can see in the description of the error, it seems that /home/nmigeo/.m2/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar is being loaded twice. and that's where the issue is.
Other than that, here are my dependencies in the pom.xml although I double checked them and I do not have any duplicates dependencies which according to other stackoverflow posts might be the source of the error.
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.1.RELEASE</version>
<relativePath />
<!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>RDM_backend</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>RDM_backend</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>javax.interceptor</groupId>
<artifactId>javax.interceptor-api</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>com.vladmihalcea</groupId>
<artifactId>hibernate-types-52</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
What's causing the error and as a future reference, what are the steps that I should take when trying to debug errors like those? Thank you very much.
EDIT:
The error says to check my classpath but as I have generated the spring boot project on eclipse I have a feeling that that's not the error
EDIT 2:
added the whole pom.xml instead of just the dependencies
The version of spring-plugin-core that you are using is incompatible with the version of Spring Data REST that you are using. Spring Boot 2.2 uses Spring Data REST 3.2 which requires spring-plugin-core 2.0.
When Maven encounters the same dependency multiple times in the dependency tree, the version of the dependency nearest the root of the tree wins. You can run mvn dependency:tree to see the tree. If you do so, you'll see that spring-plugin-core is listed as a dependency of io.springfox:springfox-swagger2 and it's using version 1.2.0.
You need to use 2.0 if you want to use Spring Data REST. Adding your own dependency on spring-plugin-core with the version 2.0.0.RELEASE will do that. However, I believe it will also break Springfox as it is not yet compatible. Please see this issue for some further details.
In short, you can either use Spring Boot 2.1.x and use Springfox or you can use Spring Boot 2.2.x but you'll have to stop using Springfox until the they've had a chance to restore compatibility and release a new version.
I am new to Spring Boot, trying to build a web application using JSP with Spring Boot, getting the fallback error I have given the path exactly.
Please refer the below link. where I created the WEb_INF and path
https://drive.google.com/file/d/1-qkoy49zIZe-Y6-zPeAn9g2aRGaDHt01/view?usp=sharing
File CustomerContoller.java
package com.javabrains.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
#Controller
#RequestMapping("/customer")
public class CustomerController {
public String hello(ModelMap Model) {
return "list";
}
}
File application.properties
spring.mvc.view.prefix: /WEB-INF/jsp/
spring.mvc.view.suffix: .jsp
File porn.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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.8.RELEASE</version>
<relativePath/> <!-- Look up parent from repository -->
</parent>
<groupId>com.javabrains</groupId>
<artifactId>javabrains</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>WebDemo</name>
<description>Demo project for Spring Boot</description>
<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.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</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>
</project>
Stack trace
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.8.RELEASE)
2019-09-08 11:32:00.571 INFO 6484 --- [ restartedMain] com.javabrains.WebDemoApplication : Starting WebDemoApplication on NagaTeja with PID 6484 (C:\Users\nagat\workspace1\WebDemo\target\classes started by nagat in C:\Users\nagat\workspace1\WebDemo)
2019-09-08 11:32:00.575 INFO 6484 --- [ restartedMain] com.javabrains.WebDemoApplication : No active profile set, falling back to default profiles: default
2019-09-08 11:32:00.626 INFO 6484 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2019-09-08 11:32:00.626 INFO 6484 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2019-09-08 11:32:01.644 INFO 6484 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.ws.config.annotation.DelegatingWsConfiguration' of type [org.springframework.ws.config.annotation.DelegatingWsConfiguration$$EnhancerBySpringCGLIB$$b5bc3870] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-09-08 11:32:01.699 INFO 6484 --- [ restartedMain] .w.s.a.s.AnnotationActionEndpointMapping : Supporting [WS-Addressing August 2004, WS-Addressing 1.0]
2019-09-08 11:32:02.286 INFO 6484 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-09-08 11:32:02.321 INFO 6484 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-09-08 11:32:02.322 INFO 6484 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.24]
2019-09-08 11:32:02.605 INFO 6484 --- [ 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-09-08 11:32:02.612 INFO 6484 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-09-08 11:32:02.613 INFO 6484 --- [ restartedMain] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1987 ms
2019-09-08 11:32:02.904 INFO 6484 --- [ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-09-08 11:32:03.235 INFO 6484 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2019-09-08 11:32:03.310 INFO 6484 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2019-09-08 11:32:03.313 INFO 6484 --- [ restartedMain] com.javabrains.WebDemoApplication : Started WebDemoApplication in 3.191 seconds (JVM running for 3.903)
2019-09-08 11:32:16.663 INFO 6484 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2019-09-08 11:32:16.663 INFO 6484 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2019-09-08 11:32:16.671 INFO 6484 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 8 ms
I expect the list.jsp file should run successfully without any problems. How can I resolve this problem?
Nothing is happening because you haven't added any map on your method inside your controller. So add a map on a method like
#GetMapping(value="")
public String hello(ModelMap Model) {
return "list";
}
After running the project, open your browser and hit localhost:8080/customer.