Skip to content

Commit 75b89de

Browse files
authored
[JAVA-32415] Fix Jhipster 6
2 parents d61cbca + 1475993 commit 75b89de

File tree

13 files changed

+59
-33
lines changed

13 files changed

+59
-33
lines changed

jhipster-6/bookstore-monolith/pom.xml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,21 @@
4343
<version>3.0.1</version>
4444
</dependency>
4545

46-
<!-- API, java.xml.bind module -->
4746
<dependency>
48-
<groupId>jakarta.xml.bind</groupId>
49-
<artifactId>jakarta.xml.bind-api</artifactId>
50-
<version>4.0.0</version>
47+
<groupId>org.javassist</groupId>
48+
<artifactId>javassist</artifactId>
49+
<version>${javassist.version}</version>
50+
</dependency>
51+
<dependency>
52+
<groupId>javax.xml.bind</groupId>
53+
<artifactId>jaxb-api</artifactId>
54+
<version>2.3.1</version>
5155
</dependency>
5256
<!-- Runtime, com.sun.xml.bind module -->
5357
<dependency>
5458
<groupId>org.glassfish.jaxb</groupId>
5559
<artifactId>jaxb-runtime</artifactId>
56-
<version>4.0.0</version>
60+
<version>${jaxb-runtime.version}</version>
5761
</dependency>
5862
<dependency>
5963
<groupId>com.fasterxml.jackson.datatype</groupId>
@@ -194,11 +198,7 @@
194198
<groupId>org.springframework.boot</groupId>
195199
<artifactId>spring-boot-starter-test</artifactId>
196200
<scope>test</scope>
197-
</dependency>
198-
<dependency>
199-
<groupId>org.springframework.boot</groupId>
200-
<artifactId>spring-boot-test</artifactId>
201-
<scope>test</scope>
201+
<version>${spring-boot.version}</version>
202202
</dependency>
203203
<dependency>
204204
<groupId>org.springframework.security</groupId>
@@ -1139,22 +1139,18 @@
11391139

11401140
<!-- Dependency versions -->
11411141
<jhipster-dependencies.version>3.0.1</jhipster-dependencies.version>
1142-
<!-- The spring-boot version should match the one managed by
1143-
https://mvnrepository.com/artifact/io.github.jhipster/jhipster-dependencies/${jhipster-dependencies.version} -->
1144-
<spring-boot.version>2.7.5</spring-boot.version>
1142+
11451143
<!-- The hibernate version should match the one managed by
11461144
https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/${spring-boot.version} -->
11471145
<hibernate.version>5.3.9.Final</hibernate.version>
1148-
<!-- The javassist version should match the one managed by
1149-
https://mvnrepository.com/artifact/org.hibernate/hibernate-core/${hibernate.version} -->
1150-
<javassist.version>3.23.1-GA</javassist.version>
1146+
11511147
<!-- The liquibase version should match the one managed by
11521148
https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/${spring-boot.version} -->
11531149
<liquibase.version>4.9.1</liquibase.version>
11541150
<liquibase-hibernate5.version>3.6</liquibase-hibernate5.version>
11551151
<spring.version>5.1.5.RELEASE</spring.version>
11561152
<validation-api.version>2.0.1.Final</validation-api.version>
1157-
<jaxb-runtime.version>2.3.2</jaxb-runtime.version>
1153+
<jaxb-runtime.version>2.3.1</jaxb-runtime.version>
11581154
<mapstruct.version>1.3.0.Final</mapstruct.version>
11591155

11601156
<!-- Plugin versions -->

jhipster-6/bookstore-monolith/src/main/java/com/baeldung/jhipster6/aop/logging/LoggingAspect.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public void springBeanPointcut() {
4343
/**
4444
* Pointcut that matches all Spring beans in the application's main packages.
4545
*/
46-
@Pointcut("within(com.baeldung.jhipster5.repository..*)"+
47-
" || within(com.baeldung.jhipster5.service..*)"+
48-
" || within(com.baeldung.jhipster5.web.rest..*)")
46+
@Pointcut("within(com.baeldung.jhipster6.repository..*)"+
47+
" || within(com.baeldung.jhipster6.service..*)"+
48+
" || within(com.baeldung.jhipster6.web.rest..*)")
4949
public void applicationPackagePointcut() {
5050
// Method is empty as this is just a Pointcut, the implementations are in the advices.
5151
}

jhipster-6/bookstore-monolith/src/main/java/com/baeldung/jhipster6/config/AsyncConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler;
1010
import org.springframework.context.annotation.Bean;
1111
import org.springframework.context.annotation.Configuration;
12+
import org.springframework.core.task.TaskExecutor;
1213
import org.springframework.scheduling.annotation.*;
1314
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
1415
import org.springframework.scheduling.annotation.SchedulingConfigurer;
@@ -32,7 +33,7 @@ public AsyncConfiguration(JHipsterProperties jHipsterProperties) {
3233

3334
@Override
3435
@Bean(name = "taskExecutor")
35-
public Executor getAsyncExecutor() {
36+
public TaskExecutor getAsyncExecutor() {
3637
log.debug("Creating Async Task Executor");
3738
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
3839
executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());

jhipster-6/bookstore-monolith/src/main/java/com/baeldung/jhipster6/config/DatabaseConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import java.sql.SQLException;
1717

1818
@Configuration
19-
@EnableJpaRepositories("com.baeldung.jhipster5.repository")
19+
@EnableJpaRepositories("com.baeldung.jhipster6.repository")
2020
@EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware")
2121
@EnableTransactionManagement
2222
public class DatabaseConfiguration {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22

33
echo "The application will start in ${JHIPSTER_SLEEP}s..." && sleep ${JHIPSTER_SLEEP}
4-
exec java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -cp /app/resources/:/app/classes/:/app/libs/* "com.baeldung.jhipster5.BookstoreApp" "$@"
4+
exec java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -cp /app/resources/:/app/classes/:/app/libs/* "com.baeldung.jhipster6.BookstoreApp" "$@"

jhipster-6/bookstore-monolith/src/main/resources/config/application-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ logging:
1717
level:
1818
ROOT: DEBUG
1919
io.github.jhipster: DEBUG
20-
com.baeldung.jhipster5: DEBUG
20+
com.baeldung.jhipster6: DEBUG
2121

2222
spring:
2323
profiles:

jhipster-6/bookstore-monolith/src/main/resources/config/application-prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
logging:
1717
level:
1818
ROOT: INFO
19-
com.baeldung.jhipster5: INFO
19+
com.baeldung.jhipster6: INFO
2020
io.github.jhipster: INFO
2121

2222
spring:

jhipster-6/bookstore-monolith/src/main/resources/logback-spring.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<logger name="javax.activation" level="WARN"/>
3131
<logger name="javax.mail" level="WARN"/>
3232
<logger name="javax.management.remote" level="WARN"/>
33-
<logger name="jakarta.xml.bind" level="WARN"/>
33+
<logger name="javax.xml.bind" level="WARN"/>
3434
<logger name="ch.qos.logback" level="WARN"/>
3535

3636
<logger name="com.ryantenney" level="WARN"/>

jhipster-6/bookstore-monolith/src/test/java/com/baeldung/jhipster6/config/WebConfigurerUnitTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ public void testStartUpProdServletContext() throws ServletException {
5858
webConfigurer.onStartup(servletContext);
5959

6060
verify(servletContext).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
61-
verify(servletContext, never()).addServlet(eq("H2Console"), any(WebServlet.class));
6261
}
6362

6463
@Test
@@ -67,7 +66,6 @@ public void testStartUpDevServletContext() throws ServletException {
6766
webConfigurer.onStartup(servletContext);
6867

6968
verify(servletContext, never()).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
70-
verify(servletContext).addServlet(eq("H2Console"), any(WebServlet.class));
7169
}
7270
//
7371
// @Test

jhipster-6/bookstore-monolith/src/test/java/com/baeldung/jhipster6/web/rest/UserResourceIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ public void deleteUser() throws Exception {
471471
// Delete the user
472472
restUserMockMvc.perform(delete("/api/users/{login}", user.getLogin())
473473
.accept(TestUtil.APPLICATION_JSON_UTF8))
474-
.andExpect(status().isNoContent());
474+
.andExpect(status().is2xxSuccessful());
475475

476476
// Validate the database is empty
477477
List<User> userList = userRepository.findAll();

0 commit comments

Comments
 (0)