Я новичок в этой теме. Я попытался открыть свой проект uni JPA, и после борьбы с зависимостями и обновления версий мне удалось запустить проект. Проблема в том, что всякий раз, когда я пытаюсь войти в консоль H2, я получаю
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Как это исправить? Кажется, у меня уже закончились темы SO.
application.properties (папка ресурсов)
server.port=8091
# H2
spring.h2.console.enabled= true
spring.h2.console.path=/h2
# Datasource
spring.datasource.url=jdbc:h2:file:~/test
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driver-class-name=org.h2.Driver
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.properties.hibernate.show_sql=true
logging.level.org.hibernate.tool.hbm2ddl=debug
pom.xml
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
com.jpacourse
wsb-jpa1
0.0.1-SNAPSHOT
jar
wsb-jpa1
Demo project for JPA
org.springframework.boot
spring-boot-starter-parent
3.4.0
UTF-8
UTF-8
11
22
22
org.springframework.boot
spring-boot-starter-data-jpa
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-validation
com.h2database
h2
runtime
org.hibernate.validator
hibernate-validator-annotation-processor
org.springframework.boot
spring-boot-starter-test
test
org.springframework.boot
spring-boot-starter-mail
2.4.3
org.springframework.boot
spring-boot-starter-aop
mysql
mysql-connector-java
8.0.28
org.springframework.boot
spring-boot-maven-plugin
Контроллер
@RestController
public class AddressController
{
private final AddressService addressService;
public AddressController(AddressService addressService) {
this.addressService = addressService;
}
@GetMapping("/address/{id}")
AddressTO findBaId(@PathVariable final Long id) {
final AddressTO address = addressService.findById(id);
if(address != null)
{
return address;
}
throw new EntityNotFoundException(id);
}
}
URL
http://localhost:8091/h2/
После попытки ввести этот URL в журналах появляется только следующее:
2024-12-05T19:57:11.256+01:00 INFO 87438 --- [nio-8091-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2024-12-05T19:57:11.256+01:00 INFO 87438 --- [nio-8091-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2024-12-05T19:57:11.258+01:00 INFO 87438 --- [nio-8091-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
Подробнее здесь: https://stackoverflow.com/questions/792 ... er-console
Получение страницы ошибки whitelabel при попытке войти в консоль ⇐ JAVA
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Постоянное получение страницы ошибки WhiteLabel - Spring boot [дубликат]
Anonymous » » в форуме JAVA - 0 Ответы
- 15 Просмотры
-
Последнее сообщение Anonymous
-