Debug Eclipse: Class File Editor source not found - spring
Output:
The JAR file C:\Users\segreteria.m2\repository\org\springframework\boot\spring-boot\2.7.4.jar has no source attachment. You can attach the source by clicking Attach Source below:
Perhaps, I suppose the mistake lies in the fact that
A few days ago I excluded some files from the pom that were not used, but now I would like to re-insert them, but there is no typing "< exclusions > " in the pom file. I reintegrated the 'spring-boot-devtools.2.7.4.jar' file but nothing has changed.
I tried to reintegrate it in all ways, from the pom, importing the jar, I also imported the jar sources file, the file is also present in the jdk, I imported it from a folder outside the repository, but the result remained unchanged.
thanks to who helps me.
test debug without breakpoint:
OUTPUT CONSOLE:
09:40:27.682 [Thread-0] DEBUG org.springframework.boot.devtools.restart.classloa
der.RestartClassLoader - Created RestartClassLoader org.springframework.boot.dev
tools.restart.classloader.RestartClassLoader#ff00a5
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.7.4)
2022-10-26 09:40:33.069 INFO 2868 --- [ restartedMain] com.giuggiola.Parlament
oApplication : Starting ParlamentoApplication using Java 18.0.2.1 on UTENTE
-4KLNCD55 with PID 2868 (C:\Users\segreteria\Desktop\BACKUP pARLAMENTO\Parlament
o\target\classes started by segreteria in C:\Users\segreteria\Desktop\BACKUP pAR
LAMENTO\Parlamento)
2022-10-26 09:40:33.080 INFO 2868 --- [ restartedMain] com.giuggiola.Parlament
oApplication : The following 1 profile is active: "#spring.profiles.active#
"
2022-10-26 09:40:33.714 INFO 2868 --- [ restartedMain] .e.DevToolsPropertyDefa
ultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-
properties' to 'false' to disable
2022-10-26 09:40:33.715 INFO 2868 --- [ restartedMain] .e.DevToolsPropertyDefa
ultsPostProcessor : For additional web related logging consider setting the 'log
ging.level.web' property to 'DEBUG'
2022-10-26 09:40:42.859 INFO 2868 --- [ restartedMain] .s.d.r.c.RepositoryConf
igurationDelegate : Multiple Spring Data modules found, entering strict reposito
ry configuration mode
2022-10-26 09:40:42.877 INFO 2868 --- [ restartedMain] .s.d.r.c.RepositoryConf
igurationDelegate : Bootstrapping Spring Data Elasticsearch repositories in DEFA
ULT mode.
2022-10-26 09:40:43.401 INFO 2868 --- [ restartedMain] .RepositoryConfiguratio
nExtensionSupport : Spring Data Elasticsearch - Could not safely identify store
assignment for repository candidate interface com.giuggiola.repository.Parlament
areRepository; If you want this repository to be a Elasticsearch repository, con
sider annotating your entities with one of these annotations: org.springframewor
k.data.elasticsearch.annotations.Document (preferred), or consider extending one
of the following types with your repository: org.springframework.data.elasticse
arch.repository.ElasticsearchRepository, org.springframework.data.elasticsearch.
repository.ElasticsearchRepository
2022-10-26 09:40:43.419 INFO 2868 --- [ restartedMain] .RepositoryConfiguratio
nExtensionSupport : Spring Data Elasticsearch - Could not safely identify store
assignment for repository candidate interface com.giuggiola.repository.RangeRepo
sitory; If you want this repository to be a Elasticsearch repository, consider a
nnotating your entities with one of these annotations: org.springframework.data.
elasticsearch.annotations.Document (preferred), or consider extending one of the
following types with your repository: org.springframework.data.elasticsearch.re
pository.ElasticsearchRepository, org.springframework.data.elasticsearch.reposit
ory.ElasticsearchRepository
2022-10-26 09:40:43.432 INFO 2868 --- [ restartedMain] .s.d.r.c.RepositoryConf
igurationDelegate : Finished Spring Data repository scanning in 544 ms. Found 0
Elasticsearch repository interfaces.
2022-10-26 09:40:43.446 INFO 2868 --- [ restartedMain] .s.d.r.c.RepositoryConf
igurationDelegate : Multiple Spring Data modules found, entering strict reposito
ry configuration mode
2022-10-26 09:40:43.449 INFO 2868 --- [ restartedMain] .s.d.r.c.RepositoryConf
igurationDelegate : Bootstrapping Spring Data Reactive Elasticsearch repositorie
s in DEFAULT mode.
2022-10-26 09:40:43.465 INFO 2868 --- [ restartedMain] .RepositoryConfiguratio
nExtensionSupport : Spring Data Reactive Elasticsearch - Could not safely identi
fy store assignment for repository candidate interface com.giuggiola.repository.
ParlamentareRepository; If you want this repository to be a Reactive Elasticsear
ch repository, consider annotating your entities with one of these annotations:
org.springframework.data.elasticsearch.annotations.Document (preferred), or cons
ider extending one of the following types with your repository: org.springframew
ork.data.elasticsearch.repository.ReactiveElasticsearchRepository
2022-10-26 09:40:43.477 INFO 2868 --- [ restartedMain] .RepositoryConfiguratio
nExtensionSupport : Spring Data Reactive Elasticsearch - Could not safely identi
fy store assignment for repository candidate interface com.giuggiola.repository.
RangeRepository; If you want this repository to be a Reactive Elasticsearch repo
sitory, consider annotating your entities with one of these annotations: org.spr
ingframework.data.elasticsearch.annotations.Document (preferred), or consider ex
tending one of the following types with your repository: org.springframework.dat
a.elasticsearch.repository.ReactiveElasticsearchRepository
2022-10-26 09:40:43.481 INFO 2868 --- [ restartedMain] .s.d.r.c.RepositoryConf
igurationDelegate : Finished Spring Data repository scanning in 31 ms. Found 0 R
eactive Elasticsearch repository interfaces.
2022-10-26 09:40:43.564 INFO 2868 --- [ restartedMain] .s.d.r.c.RepositoryConf
igurationDelegate : Multiple Spring Data modules found, entering strict reposito
ry configuration mode
2022-10-26 09:40:43.580 INFO 2868 --- [ restartedMain] .s.d.r.c.RepositoryConf
igurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-10-26 09:40:43.826 INFO 2868 --- [ restartedMain] .s.d.r.c.RepositoryConf
igurationDelegate : Finished Spring Data repository scanning in 216 ms. Found 2
JPA repository interfaces.
2022-10-26 09:40:51.212 INFO 2868 --- [ restartedMain] o.s.b.w.embedded.tomcat
.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2022-10-26 09:40:51.458 INFO 2868 --- [ restartedMain] o.apache.catalina.core.
StandardService : Starting service [Tomcat]
2022-10-26 09:40:51.459 INFO 2868 --- [ restartedMain] org.apache.catalina.cor
e.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.65]
2022-10-26 09:40:53.824 INFO 2868 --- [ restartedMain] org.apache.jasper.servl
et.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 scan
ned but no TLDs were found in them. Skipping unneeded JARs during scanning can i
mprove startup time and JSP compilation time.
2022-10-26 09:40:54.091 INFO 2868 --- [ restartedMain] o.a.c.c.C.[Tomcat].[loc
alhost].[/] : Initializing Spring embedded WebApplicationContext
2022-10-26 09:40:54.096 INFO 2868 --- [ restartedMain] w.s.c.ServletWebServerA
pplicationContext : Root WebApplicationContext: initialization completed in 2037
5 ms
2022-10-26 09:40:56.402 INFO 2868 --- [ restartedMain] o.hibernate.jpa.interna
l.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-10-26 09:40:57.038 INFO 2868 --- [ restartedMain] org.hibernate.Version
: HHH000412: Hibernate ORM core version 5.6.11.Final
2022-10-26 09:40:58.075 INFO 2868 --- [ restartedMain] o.hibernate.annotations
.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2022-10-26 09:40:58.834 INFO 2868 --- [ restartedMain] com.zaxxer.hikari.Hikar
iDataSource : HikariPool-1 - Starting...
2022-10-26 09:41:00.384 INFO 2868 --- [ restartedMain] com.zaxxer.hikari.Hikar
iDataSource : HikariPool-1 - Start completed.
2022-10-26 09:41:00.560 INFO 2868 --- [ restartedMain] org.hibernate.dialect.D
ialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL10
Dialect
2022-10-26 09:41:03.835 INFO 2868 --- [ restartedMain] Hibernate Types
: This framework is proudly powered by:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_ _ _ _
| | | | (_) | |
| |__| |_ _ _ __ ___ _ __ ___ _ ___| |_ ___ _ __ ___ ___
| __ | | | | '_ \ / _ \ '__/ __| / __| __/ _ \ '_ \ / __/ _ \
| | | | |_| | |_) | __/ | \__ \ \__ \ || __/ | | | (_| __/
|_| |_|\__, | .__/ \___|_| |___/_|___/\__\___|_| |_|\___\___|
__/ | |
|___/|_|
At Hypersistence, we only build amazing tools, like Hibernate Types, Flexy Pool,
or Hypersistence Optimizer.
What if there were a tool that could automatically detect JPA and Hibernate perf
ormance issues?
Hypersistence Optimizer is that tool! For more details, go to:
https://vladmihalcea.com/hypersistence-optimizer/
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2022-10-26 09:41:06.840 INFO 2868 --- [ restartedMain] o.h.e.t.j.p.i.JtaPlatfo
rmInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.
engine.transaction.jta.platform.internal.NoJtaPlatform]
2022-10-26 09:41:06.883 INFO 2868 --- [ restartedMain] j.LocalContainerEntityM
anagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'd
efault'
2022-10-26 09:41:08.996 WARN 2868 --- [ restartedMain] JpaBaseConfiguration$Jp
aWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, da
tabase queries may be performed during view rendering. Explicitly configure spri
ng.jpa.open-in-view to disable this warning
2022-10-26 09:41:09.700 DEBUG 2868 --- [ restartedMain] s.w.s.m.m.a.RequestMapp
ingHandlerAdapter : ControllerAdvice beans: 0 #ModelAttribute, 0 #InitBinder, 1
RequestBodyAdvice, 1 ResponseBodyAdvice
2022-10-26 09:41:10.148 DEBUG 2868 --- [ restartedMain] s.w.s.m.m.a.RequestMapp
ingHandlerMapping : 12 mappings in 'requestMappingHandlerMapping'
2022-10-26 09:41:10.249 DEBUG 2868 --- [ restartedMain] o.s.w.s.handler.SimpleU
rlHandlerMapping : Patterns [/webjars/**, /**] in 'resourceHandlerMapping'
2022-10-26 09:41:10.299 DEBUG 2868 --- [ restartedMain] .m.m.a.ExceptionHandler
ExceptionResolver : ControllerAdvice beans: 0 #ExceptionHandler, 1 ResponseBodyA
dvice
2022-10-26 09:41:14.389 INFO 2868 --- [ restartedMain] o.s.b.d.a.OptionalLiveR
eloadServer : LiveReload server is running on port 35729
2022-10-26 09:41:15.248 INFO 2868 --- [ restartedMain] o.s.b.w.embedded.tomcat
.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2022-10-26 09:41:15.302 INFO 2868 --- [ restartedMain] com.giuggiola.Parlament
oApplication : Started ParlamentoApplication in 47.464 seconds (JVM running
for 61.457)
OUTPUT STACKTRACE:
// Compiled from SilentExitExceptionHandler.java (version 1.8 : 52.0, super bit)
class org.springframework.boot.devtools.restart.SilentExitExceptionHandler implements java.lang.Thread$UncaughtExceptionHandler {
// Field descriptor #33 Ljava/lang/Thread$UncaughtExceptionHandler;
private final java.lang.Thread$UncaughtExceptionHandler delegate;
// Method descriptor #35 (Ljava/lang/Thread$UncaughtExceptionHandler;)V
// Stack: 2, Locals: 2
SilentExitExceptionHandler(java.lang.Thread.UncaughtExceptionHandler delegate);
0 aload_0 [this]
1 invokespecial java.lang.Object() [1]
4 aload_0 [this]
5 aload_1 [delegate]
6 putfield org.springframework.boot.devtools.restart.SilentExitExceptionHandler.delegate : java.lang.Thread.UncaughtExceptionHandler [2]
9 return
Line numbers:
[pc: 0, line: 33]
[pc: 4, line: 34]
[pc: 9, line: 35]
Local variable table:
[pc: 0, pc: 10] local: this index: 0 type: org.springframework.boot.devtools.restart.SilentExitExceptionHandler
[pc: 0, pc: 10] local: delegate index: 1 type: java.lang.Thread.UncaughtExceptionHandler
Method Parameters:
delegate
// Method descriptor #43 (Ljava/lang/Thread;Ljava/lang/Throwable;)V
// Stack: 3, Locals: 3
public void uncaughtException(java.lang.Thread thread, java.lang.Throwable exception);
0 aload_2 [exception]
1 instanceof org.springframework.boot.devtools.restart.SilentExitExceptionHandler$SilentExitException [3]
4 ifne 27
7 aload_2 [exception]
8 instanceof java.lang.reflect.InvocationTargetException [4]
11 ifeq 40
14 aload_2 [exception]
15 checkcast java.lang.reflect.InvocationTargetException [4]
18 invokevirtual java.lang.reflect.InvocationTargetException.getTargetException() : java.lang.Throwable [5]
21 instanceof org.springframework.boot.devtools.restart.SilentExitExceptionHandler$SilentExitException [3]
24 ifeq 40
27 aload_0 [this]
28 aload_1 [thread]
29 invokespecial org.springframework.boot.devtools.restart.SilentExitExceptionHandler.isJvmExiting(java.lang.Thread) : boolean [6]
32 ifeq 39
35 aload_0 [this]
36 invokevirtual org.springframework.boot.devtools.restart.SilentExitExceptionHandler.preventNonZeroExitCode() : void [7]
39 return
40 aload_0 [this]
41 getfield org.springframework.boot.devtools.restart.SilentExitExceptionHandler.delegate : java.lang.Thread.UncaughtExceptionHandler [2]
44 ifnull 58
47 aload_0 [this]
48 getfield org.springframework.boot.devtools.restart.SilentExitExceptionHandler.delegate : java.lang.Thread.UncaughtExceptionHandler [2]
51 aload_1 [thread]
52 aload_2 [exception]
53 invokeinterface java.lang.Thread$UncaughtExceptionHandler.uncaughtException(java.lang.Thread, java.lang.Throwable) : void [8] [nargs: 3]
58 return
Line numbers:
[pc: 0, line: 39]
[pc: 18, line: 40]
[pc: 27, line: 41]
[pc: 35, line: 42]
[pc: 39, line: 44]
[pc: 40, line: 46]
[pc: 47, line: 47]
[pc: 58, line: 49]
Local variable table:
[pc: 0, pc: 59] local: this index: 0 type: org.springframework.boot.devtools.restart.SilentExitExceptionHandler
[pc: 0, pc: 59] local: thread index: 1 type: java.lang.Thread
[pc: 0, pc: 59] local: exception index: 2 type: java.lang.Throwable
Stack map table: number of frames 4
[pc: 27, same]
[pc: 39, same]
[pc: 40, same]
[pc: 58, same]
Method Parameters:
thread
exception
// Method descriptor #50 (Ljava/lang/Thread;)Z
// Stack: 2, Locals: 6
private boolean isJvmExiting(java.lang.Thread exceptionThread);
0 aload_0 [this]
1 invokevirtual org.springframework.boot.devtools.restart.SilentExitExceptionHandler.getAllThreads() : java.lang.Thread[] [9]
4 astore_2
5 aload_2
6 arraylength
7 istore_3
8 iconst_0
9 istore 4
11 iload 4
13 iload_3
14 if_icmpge 53
17 aload_2
18 iload 4
20 aaload
21 astore 5 [thread]
23 aload 5 [thread]
25 aload_1 [exceptionThread]
26 if_acmpeq 47
29 aload 5 [thread]
31 invokevirtual java.lang.Thread.isAlive() : boolean [10]
34 ifeq 47
37 aload 5 [thread]
39 invokevirtual java.lang.Thread.isDaemon() : boolean [11]
42 ifne 47
45 iconst_0
46 ireturn
47 iinc 4 1
50 goto 11
53 iconst_1
54 ireturn
Line numbers:
[pc: 0, line: 52]
[pc: 23, line: 53]
[pc: 45, line: 54]
[pc: 47, line: 52]
[pc: 53, line: 57]
Local variable table:
[pc: 23, pc: 47] local: thread index: 5 type: java.lang.Thread
[pc: 0, pc: 55] local: this index: 0 type: org.springframework.boot.devtools.restart.SilentExitExceptionHandler
[pc: 0, pc: 55] local: exceptionThread index: 1 type: java.lang.Thread
Stack map table: number of frames 3
[pc: 11, append: {java.lang.Thread[], int, int}]
[pc: 47, same]
[pc: 53, chop 3 local(s)]
Method Parameters:
exceptionThread
// Method descriptor #53 ()[Ljava/lang/Thread;
// Stack: 2, Locals: 4
protected java.lang.Thread[] getAllThreads();
0 aload_0 [this]
1 invokespecial org.springframework.boot.devtools.restart.SilentExitExceptionHandler.getRootThreadGroup() : java.lang.ThreadGroup [12]
4 astore_1 [rootThreadGroup]
5 bipush 32
7 anewarray java.lang.Thread [13]
10 astore_2 [threads]
11 aload_1 [rootThreadGroup]
12 aload_2 [threads]
13 invokevirtual java.lang.ThreadGroup.enumerate(java.lang.Thread[]) : int [14]
16 istore_3 [count]
17 iload_3 [count]
18 aload_2 [threads]
19 arraylength
20 if_icmpne 40
23 aload_2 [threads]
24 arraylength
25 iconst_2
26 imul
27 anewarray java.lang.Thread [13]
30 astore_2 [threads]
31 aload_1 [rootThreadGroup]
32 aload_2 [threads]
33 invokevirtual java.lang.ThreadGroup.enumerate(java.lang.Thread[]) : int [14]
36 istore_3 [count]
37 goto 17
40 aload_2 [threads]
41 iload_3 [count]
42 invokestatic java.util.Arrays.copyOf(java.lang.Object[], int) : java.lang.Object[] [15]
45 checkcast java.lang.Thread[] [16]
48 areturn
Line numbers:
[pc: 0, line: 61]
[pc: 5, line: 62]
[pc: 11, line: 63]
[pc: 17, line: 64]
[pc: 23, line: 65]
[pc: 31, line: 66]
[pc: 40, line: 68]
Local variable table:
[pc: 0, pc: 49] local: this index: 0 type: org.springframework.boot.devtools.restart.SilentExitExceptionHandler
[pc: 5, pc: 49] local: rootThreadGroup index: 1 type: java.lang.ThreadGroup
[pc: 11, pc: 49] local: threads index: 2 type: java.lang.Thread[]
[pc: 17, pc: 49] local: count index: 3 type: int
Stack map table: number of frames 2
[pc: 17, append: {java.lang.ThreadGroup, java.lang.Thread[], int}]
[pc: 40, same]
// Method descriptor #62 ()Ljava/lang/ThreadGroup;
// Stack: 1, Locals: 2
private java.lang.ThreadGroup getRootThreadGroup();
0 invokestatic java.lang.Thread.currentThread() : java.lang.Thread [17]
3 invokevirtual java.lang.Thread.getThreadGroup() : java.lang.ThreadGroup [18]
6 astore_1 [candidate]
7 aload_1 [candidate]
8 invokevirtual java.lang.ThreadGroup.getParent() : java.lang.ThreadGroup [19]
11 ifnull 22
14 aload_1 [candidate]
15 invokevirtual java.lang.ThreadGroup.getParent() : java.lang.ThreadGroup [19]
18 astore_1 [candidate]
19 goto 7
22 aload_1 [candidate]
23 areturn
Line numbers:
[pc: 0, line: 72]
[pc: 7, line: 73]
[pc: 14, line: 74]
[pc: 22, line: 76]
Local variable table:
[pc: 0, pc: 24] local: this index: 0 type: org.springframework.boot.devtools.restart.SilentExitExceptionHandler
[pc: 7, pc: 24] local: candidate index: 1 type: java.lang.ThreadGroup
Stack map table: number of frames 2
[pc: 7, append: {java.lang.ThreadGroup}]
[pc: 22, same]
// Method descriptor #65 ()V
// Stack: 1, Locals: 1
protected void preventNonZeroExitCode();
0 iconst_0
1 invokestatic java.lang.System.exit(int) : void [20]
4 return
Line numbers:
[pc: 0, line: 80]
[pc: 4, line: 81]
Local variable table:
[pc: 0, pc: 5] local: this index: 0 type: org.springframework.boot.devtools.restart.SilentExitExceptionHandler
// Method descriptor #67 (Ljava/lang/Thread;)V
// Stack: 3, Locals: 2
static void setup(java.lang.Thread thread);
0 aload_0 [thread]
1 invokevirtual java.lang.Thread.getUncaughtExceptionHandler() : java.lang.Thread$UncaughtExceptionHandler [21]
4 astore_1 [handler]
5 aload_1 [handler]
6 instanceof org.springframework.boot.devtools.restart.SilentExitExceptionHandler [22]
9 ifne 26
12 new org.springframework.boot.devtools.restart.SilentExitExceptionHandler [22]
15 dup
16 aload_1 [handler]
17 invokespecial org.springframework.boot.devtools.restart.SilentExitExceptionHandler(java.lang.Thread$UncaughtExceptionHandler) [23]
20 astore_1 [handler]
21 aload_0 [thread]
22 aload_1 [handler]
23 invokevirtual java.lang.Thread.setUncaughtExceptionHandler(java.lang.Thread$UncaughtExceptionHandler) : void [24]
26 return
Line numbers:
[pc: 0, line: 84]
[pc: 5, line: 85]
[pc: 12, line: 86]
[pc: 21, line: 87]
[pc: 26, line: 89]
Local variable table:
[pc: 0, pc: 27] local: thread index: 0 type: java.lang.Thread
[pc: 5, pc: 27] local: handler index: 1 type: java.lang.Thread.UncaughtExceptionHandler
Stack map table: number of frames 1
[pc: 26, append: {java.lang.Thread$UncaughtExceptionHandler}]
Method Parameters:
thread
// Method descriptor #65 ()V
// Stack: 3, Locals: 0
static void exitCurrentThread();
0 new org.springframework.boot.devtools.restart.SilentExitExceptionHandler$SilentExitException [3]
3 dup
4 aconst_null
5 invokespecial org.springframework.boot.devtools.restart.SilentExitExceptionHandler$SilentExitException(org.springframework.boot.devtools.restart.SilentExitExceptionHandler$1) [25]
8 athrow
Line numbers:
[pc: 0, line: 92]
Inner classes:
[inner class info: #28 org/springframework/boot/devtools/restart/SilentExitExceptionHandler$1, outer class info: #0
inner name: #0, accessflags: 4104 static],
[inner class info: #3 org/springframework/boot/devtools/restart/SilentExitExceptionHandler$SilentExitException, outer class info: #22 org/springframework/boot/devtools/restart/SilentExitExceptionHandler
inner name: #30 SilentExitException, accessflags: 10 private static],
[inner class info: #27 java/lang/Thread$UncaughtExceptionHandler, outer class info: #13 java/lang/Thread
inner name: #32 UncaughtExceptionHandler, accessflags: 1545 public abstract static]
}
test debug with 4 breackpoints:
Related
How to Suspend/Delay java unit tests
Is there a way to suspend java ( springboot ) unit tests execution when running mvn test and resume them later ? So I have this test class : #SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT) class JavaAppApplicationTests { #Test void contextLoads() {} #Test #RepeatedTest(10) public void testApplication() { JavaAppApplication javaApp = new JavaAppApplication(); String result = javaApp.sanitize(); assertEquals(result, "{\"key1\":\"value1\",\"type\":\"Booking\",\"sid\":\"A435211\",\"region\":\"ASIA\",\"fetchFromFile\":\"false\",\"service\":\"true\",\"isEom\":\"true\"}"); } } And when I run mvn test, I see in the console logs the following : /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.6.6) 2022-05-17 11:00:29.481 INFO 58143 --- [ main] c.e.javaapp.JavaAppApplicationTests : Starting JavaAppApplicationTests using Java 17-internal on neo-VirtualBox with PID 58143 (started by neo in /home/neo/Desktop/spring-vulnerable-app) 2022-05-17 11:00:29.483 INFO 58143 --- [ main] c.e.javaapp.JavaAppApplicationTests : No active profile set, falling back to 1 default profile: "default" 2022-05-17 11:00:30.542 INFO 58143 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2022-05-17 11:00:30.561 INFO 58143 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2022-05-17 11:00:30.561 INFO 58143 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.60] 2022-05-17 11:00:30.749 INFO 58143 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2022-05-17 11:00:30.749 INFO 58143 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1230 ms 2022-05-17 11:00:31.497 INFO 58143 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2022-05-17 11:00:31.507 INFO 58143 --- [ main] c.e.javaapp.JavaAppApplicationTests : Started JavaAppApplicationTests in 2.452 seconds (JVM running for 3.887) [INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4 s - in com.elastisys.javaapp.JavaAppApplicationTests [INFO] [INFO] Results: [INFO] [INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0 The JavaApplicationTests is started with a specific PID and a defined port and then tests are executed. What I am looking for is a way to start the application and wait for a specific period before executing all the tests ( like it's suspended ) Thanks in advance
Running Spring Native Application with Spring Data needs for startup about 2-3 seconds
I have created a Spring Boot Application with Spring Initializr. I use Spring Data with MySQL JDBC Connection. I created an docker image with gradle bootBuildImage and start this docker image with docker run --rm -p 8080:80 buchschrank:0.0.1-SNAPSHOT. But startup needs about 2-3 seconds instead of milliseconds: 2021-11-09 16:03:32.238 INFO 1 --- [ main] o.s.nativex.NativeListener : This application is bootstrapped with code generated with Spring AOT . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.5.6) 2021-11-09 16:03:32.277 INFO 1 --- [ main] o.s.boot.SpringApplication : Starting application using Java 11.0.13 on 2b2e5a51334b with PID 1 (started by cnb in /workspace) 2021-11-09 16:03:32.277 INFO 1 --- [ main] o.s.boot.SpringApplication : No active profile set, falling back to default profiles: default 2021-11-09 16:03:32.326 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2021-11-09 16:03:32.329 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 2 ms. Found 1 JPA repository interfaces. 2021-11-09 16:03:32.388 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 80 (http) 2021-11-09 16:03:32.389 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2021-11-09 16:03:32.389 INFO 1 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.54] 2021-11-09 16:03:32.395 INFO 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2021-11-09 16:03:32.395 INFO 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 116 ms 2021-11-09 16:03:32.412 INFO 1 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2021-11-09 16:03:32.414 INFO 1 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.32.Final 2021-11-09 16:03:32.415 INFO 1 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final} 2021-11-09 16:03:32.417 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2021-11-09 16:03:33.840 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2021-11-09 16:03:33.842 INFO 1 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect 2021-11-09 16:03:34.973 INFO 1 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2021-11-09 16:03:34.974 INFO 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2021-11-09 16:03:35.033 WARN 1 --- [ main] 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 2021-11-09 16:03:35.077 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 80 (http) with context path '' 2021-11-09 16:03:35.078 INFO 1 --- [ main] o.s.boot.SpringApplication : Started application in 2.852 seconds (JVM running for 2.854) The sourcecode of my example application: https://github.com/lesestunden/buchschrank-backend Any idea what is wrong with my application setup? Thanks a lot!
Reason was slow initial connection to database. With local running mysql database startup is around 200ms.
ConfigServletWebServerApplicationContext : How to uninstall Flyway from Spring Maven Project
The goal: Uninstall flyway from my Spring Maven project ! Maybe my question is more global and consists of how to get rid of dependecies or libraries.... The context: My project is called "Meetzicker" it will be a restfull API to meet musicians. I will dockerize it and use docker-compose with many services: my API postgres db pgAdmin to manage DB and later flyway but not for now ! If you have advices I accept them gladly ! enter image description here First I build an image of my project with the 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.3.4.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.praline40</groupId> <artifactId>meetzicker</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>${project.artifactId}</name> <description>MeetZicker REST API</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.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.hibernate.validator</groupId> <artifactId>hibernate-validator</artifactId> <version>6.0.18.Final</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-hateoas</artifactId> </dependency> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </dependency> <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <version> 2.0.1.Final </version> </dependency> </dependencies> <build> <finalName>${project.artifactId}</finalName> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> <version>0.20.1</version> <configuration> <images> <image> <name>${project.artifactId}</name> <build> <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir> <assembly> <mode>dir</mode> <targetDir>/var/lib/${project.artifactId}</targetDir> <descriptor>${project.basedir}/src/main/docker/assembly.xml</descriptor> </assembly> </build> </image> </images> </configuration> <executions> <execution> <id>build</id> <phase>install</phase> <goals> <goal>build</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project> The last part of the pom (between ... ) builds my image automatically when I call: ~/Documents/MeetZicker/BACK/MeetZicker/MeetZicker$ mvn clean install -DskipTests=true I am using docker-composed with 3 services: # meetzicker/docker-compose.yml version: "3.3" services: db: image: postgres:${POSTGRES_VERSION} container_name: db network_mode: bridge volumes: - db-data:/var/lib/postgresql/data expose: - 5432 ports: - 5432:5432 environment: - POSTGRES_DB=${POSTGRES_DB} - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} restart: unless-stopped pgadmin: image: dpage/pgadmin4 network_mode: bridge container_name: pgadmin4 volumes: - pgadmin-data:/var/lib/pgadmin expose: - 5050 ports: - 5051:5050 links: - db:pgsql-server environment: PGADMIN_DEFAULT_EMAIL: praline40#hotmail.fr PGADMIN_DEFAULT_PASSWORD: ${POSTGRES_PASSWORD} PGADMIN_PORT: 5050 restart: unless-stopped meetzicker: image: meetzicker network_mode: bridge container_name: meetzicker volumes: - meetzicker-data:/var/lib/meetzicker expose: - 8080 ports: - 8080:8080 restart: unless-stopped depends_on: - db volumes: db-data: pgadmin-data: meetzicker-data: When I call docker-compose: jules#jules-MS-7B51:~/Documents/MeetZicker/BACK/MeetZicker/MeetZicker/src/main/docker$ docker-compose up I have this error: jules#jules-MS-7B51:~/Documents/MeetZicker/BACK/MeetZicker/MeetZicker/src/main/docker$ docker-compose up WARNING: Found orphan containers (my-flyway) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. db is up-to-date Starting pgadmin4 ... done Starting meetzicker ... done Attaching to db, meetzicker, pgadmin4 meetzicker | wait-for-it.sh: waiting 15 seconds for db:5432 db | db | PostgreSQL Database directory appears to contain a database; Skipping initialization db | db | LOG: database system was shut down at 2021-05-14 13:52:50 UTC db | LOG: MultiXact member wraparound protections are now enabled db | LOG: database system is ready to accept connections db | LOG: autovacuum launcher started pgadmin4 | [2021-05-14 14:16:16 +0000] [1] [INFO] Starting gunicorn 20.1.0 pgadmin4 | [2021-05-14 14:16:16 +0000] [1] [INFO] Listening at: http://[::]:80 (1) pgadmin4 | [2021-05-14 14:16:16 +0000] [1] [INFO] Using worker: threads pgadmin4 | [2021-05-14 14:16:16 +0000] [82] [INFO] Booting worker with pid: 82 meetzicker | wait-for-it.sh: timeout occurred after waiting 15 seconds for db:5432 meetzicker | meetzicker | . ____ _ __ _ _ meetzicker | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ meetzicker | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ meetzicker | \\/ ___)| |_)| | | | | || (_| | ) ) ) ) meetzicker | ' |____| .__|_| |_|_| |_\__, | / / / / meetzicker | =========|_|==============|___/=/_/_/_/ meetzicker | :: Spring Boot :: (v2.3.4.RELEASE) meetzicker | meetzicker | 2021-05-14 14:16:29.399 INFO 43 --- [ main] c.p.MeetZicker.MeetZickerApplication : Starting MeetZickerApplication v0.0.1-SNAPSHOT on c9ed3b2b0bd9 with PID 43 (/var/lib/meetzicker/meetzicker.jar started by root in /var/lib/meetzicker) meetzicker | 2021-05-14 14:16:29.401 INFO 43 --- [ main] c.p.MeetZicker.MeetZickerApplication : The following profiles are active: dev meetzicker | 2021-05-14 14:16:29.849 INFO 43 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode. meetzicker | 2021-05-14 14:16:29.918 INFO 43 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 62ms. Found 12 JPA repository interfaces. meetzicker | 2021-05-14 14:16:30.323 INFO 43 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) meetzicker | 2021-05-14 14:16:30.331 INFO 43 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] meetzicker | 2021-05-14 14:16:30.331 INFO 43 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.38] meetzicker | 2021-05-14 14:16:30.368 INFO 43 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext meetzicker | 2021-05-14 14:16:30.368 INFO 43 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 936 ms meetzicker | 2021-05-14 14:16:30.445 WARN 43 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Unsatisfied dependency expressed through method 'flywayInitializer' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flyway' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.flywaydb.core.Flyway]: Factory method 'flyway' threw exception; nested exception is org.springframework.boot.autoconfigure.flyway.FlywayMigrationScriptMissingException: Cannot find migration scripts in: [classpath:db/migration] (please add migration scripts or check your Flyway configuration) meetzicker | 2021-05-14 14:16:30.447 INFO 43 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] meetzicker | 2021-05-14 14:16:30.453 INFO 43 --- [ main] ConditionEvaluationReportLoggingListener : meetzicker | meetzicker | Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. meetzicker | 2021-05-14 14:16:30.454 ERROR 43 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : meetzicker | meetzicker | *************************** meetzicker | APPLICATION FAILED TO START meetzicker | *************************** meetzicker | meetzicker | Description: meetzicker | meetzicker | Flyway failed to initialize: none of the following migration scripts locations could be found: meetzicker | meetzicker | - classpath:db/migration meetzicker | meetzicker | meetzicker | Action: meetzicker | meetzicker | Review the locations above or check your Flyway configuration meetzicker | meetzicker | wait-for-it.sh: waiting 15 seconds for db:5432 meetzicker | wait-for-it.sh: timeout occurred after waiting 15 seconds for db:5432 meetzicker | meetzicker | . ____ _ __ _ _ meetzicker | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ meetzicker | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ meetzicker | \\/ ___)| |_)| | | | | || (_| | ) ) ) ) meetzicker | ' |____| .__|_| |_|_| |_\__, | / / / / meetzicker | =========|_|==============|___/=/_/_/_/ meetzicker | :: Spring Boot :: (v2.3.4.RELEASE) meetzicker | meetzicker | 2021-05-14 14:16:46.742 INFO 44 --- [ main] c.p.MeetZicker.MeetZickerApplication : Starting MeetZickerApplication v0.0.1-SNAPSHOT on c9ed3b2b0bd9 with PID 44 (/var/lib/meetzicker/meetzicker.jar started by root in /var/lib/meetzicker) meetzicker | 2021-05-14 14:16:46.743 INFO 44 --- [ main] c.p.MeetZicker.MeetZickerApplication : The following profiles are active: dev meetzicker | 2021-05-14 14:16:47.199 INFO 44 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode. meetzicker | 2021-05-14 14:16:47.268 INFO 44 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 63ms. Found 12 JPA repository interfaces. meetzicker | 2021-05-14 14:16:47.673 INFO 44 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) meetzicker | 2021-05-14 14:16:47.681 INFO 44 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] meetzicker | 2021-05-14 14:16:47.681 INFO 44 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.38] meetzicker | 2021-05-14 14:16:47.719 INFO 44 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext meetzicker | 2021-05-14 14:16:47.719 INFO 44 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 945 ms meetzicker | 2021-05-14 14:16:47.811 WARN 44 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Unsatisfied dependency expressed through method 'flywayInitializer' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flyway' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.flywaydb.core.Flyway]: Factory method 'flyway' threw exception; nested exception is org.springframework.boot.autoconfigure.flyway.FlywayMigrationScriptMissingException: Cannot find migration scripts in: [classpath:db/migration] (please add migration scripts or check your Flyway configuration) meetzicker | 2021-05-14 14:16:47.813 INFO 44 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] meetzicker | 2021-05-14 14:16:47.819 INFO 44 --- [ main] ConditionEvaluationReportLoggingListener : meetzicker | meetzicker | Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. meetzicker | 2021-05-14 14:16:47.820 ERROR 44 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : meetzicker | meetzicker | *************************** meetzicker | APPLICATION FAILED TO START meetzicker | *************************** meetzicker | meetzicker | Description: meetzicker | meetzicker | Flyway failed to initialize: none of the following migration scripts locations could be found: meetzicker | meetzicker | - classpath:db/migration meetzicker | meetzicker | meetzicker | Action: meetzicker | meetzicker | Review the locations above or check your Flyway configuration meetzicker | meetzicker exited with code 1 meetzicker | wait-for-it.sh: waiting 15 seconds for db:5432 ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ I removed orphans: jules#jules-MS-7B51:~/Documents/MeetZicker/BACK/MeetZicker/MeetZicker/src/main/docker$ docker-compose up --remove-orphans Removing orphan container "my-flyway" Starting db ... done Starting meetzicker ... done Starting pgadmin4 ... done Attaching to db, meetzicker, pgadmin4 db | db | PostgreSQL Database directory appears to contain a database; Skipping initialization db | db | LOG: database system was interrupted; last known up at 2021-05-16 12:21:00 UTC db | LOG: database system was not properly shut down; automatic recovery in progress db | LOG: invalid record length at 0/14F1D38: wanted 24, got 0 db | LOG: redo is not required meetzicker | wait-for-it.sh: waiting 15 seconds for db:5432 db | LOG: MultiXact member wraparound protections are now enabled db | LOG: database system is ready to accept connections db | LOG: autovacuum launcher started pgadmin4 | [2021-05-17 11:09:31 +0000] [1] [INFO] Starting gunicorn 20.1.0 pgadmin4 | [2021-05-17 11:09:31 +0000] [1] [INFO] Listening at: http://[::]:80 (1) pgadmin4 | [2021-05-17 11:09:31 +0000] [1] [INFO] Using worker: threads pgadmin4 | [2021-05-17 11:09:31 +0000] [83] [INFO] Booting worker with pid: 83 meetzicker | wait-for-it.sh: timeout occurred after waiting 15 seconds for db:5432 meetzicker | meetzicker | . ____ _ __ _ _ meetzicker | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ meetzicker | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ meetzicker | \\/ ___)| |_)| | | | | || (_| | ) ) ) ) meetzicker | ' |____| .__|_| |_|_| |_\__, | / / / / meetzicker | =========|_|==============|___/=/_/_/_/ meetzicker | :: Spring Boot :: (v2.3.4.RELEASE) meetzicker | meetzicker | 2021-05-17 11:09:44.061 INFO 43 --- [ main] c.p.MeetZicker.MeetZickerApplication : Starting MeetZickerApplication v0.0.1-SNAPSHOT on d256a05b5f82 with PID 43 (/var/lib/meetzicker/meetzicker.jar started by root in /var/lib/meetzicker) meetzicker | 2021-05-17 11:09:44.062 INFO 43 --- [ main] c.p.MeetZicker.MeetZickerApplication : The following profiles are active: dev meetzicker | 2021-05-17 11:09:44.512 INFO 43 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode. meetzicker | 2021-05-17 11:09:44.581 INFO 43 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 63ms. Found 12 JPA repository interfaces. meetzicker | 2021-05-17 11:09:44.988 INFO 43 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) meetzicker | 2021-05-17 11:09:44.996 INFO 43 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] meetzicker | 2021-05-17 11:09:44.996 INFO 43 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.38] meetzicker | 2021-05-17 11:09:45.032 INFO 43 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext meetzicker | 2021-05-17 11:09:45.032 INFO 43 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 939 ms meetzicker | 2021-05-17 11:09:45.123 WARN 43 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Unsatisfied dependency expressed through method 'flywayInitializer' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flyway' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.flywaydb.core.Flyway]: Factory method 'flyway' threw exception; nested exception is org.springframework.boot.autoconfigure.flyway.FlywayMigrationScriptMissingException: Cannot find migration scripts in: [classpath:db/migration] (please add migration scripts or check your Flyway configuration) meetzicker | 2021-05-17 11:09:45.125 INFO 43 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] meetzicker | 2021-05-17 11:09:45.131 INFO 43 --- [ main] ConditionEvaluationReportLoggingListener : meetzicker | meetzicker | Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. meetzicker | 2021-05-17 11:09:45.133 ERROR 43 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : meetzicker | meetzicker | *************************** meetzicker | APPLICATION FAILED TO START meetzicker | *************************** meetzicker | meetzicker | Description: meetzicker | meetzicker | Flyway failed to initialize: none of the following migration scripts locations could be found: meetzicker | meetzicker | - classpath:db/migration meetzicker | meetzicker | meetzicker | Action: meetzicker | meetzicker | Review the locations above or check your Flyway configuration meetzicker | Here is my public project: https://github.com/praline40/MeetZickerAPI
not able to access the maven spring boot application running in docker container
I have created a docker file from maven spring boot application and created a docker image and pushed it to my docker registry. FROM openjdk:8 ADD target/spring-boot-lazy-init-example-0.0.1-SNAPSHOT.jar spring-boot-lazy-init-example-0.0.1-SNAPSHOT.jar EXPOSE 8080 ENTRYPOINT ["java", "-jar", "spring-boot-lazy-init-example-0.0.1-SNAPSHOT.jar"] this is the content what I have written inside docker file and created a docker image. I have changed the tag and pushed it to my docker hub repository which I will use for deployment purpose in Kubernetes cluster but before that I have used this docker image for testing purpose. I have used this docker image to run a container and I have also done the port forwarding as application was running on 8080 port by default. ubuntu#dockerimage-vm:~/spring-boot-lazy-init-example$ sudo docker images REPOSITORY TAG IMAGE ID CREATED SIZE 96963/spring-boot-new v1 1e4a8aab28f8 3 days ago 526MB 96963/docker-spring-boot v1 2f2a3b1c23e8 8 days ago 526MB docker-spring-boot-new latest 2f2a3b1c23e8 8 days ago 526MB openjdk 8 f8146facf376 2 weeks ago 488MB ubuntu#dockerimage-vm:~$ sudo docker run -it 96963/spring-boot-new:v1 -p 8085:8080 . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.2.0.M1) 2020-01-17 11:38:21.417 INFO 1 --- [ main] t.l.SpringBootLazyInitExampleApplication : Starting SpringBootLazyInitExampleApplication v0.0.1-SNAPSHOT on 03ab2d24c370 with PID 1 (/spring-boot-lazy-init-example-0.0.1-SNAPSHOT.jar started by root in /) 2020-01-17 11:38:21.426 INFO 1 --- [ main] t.l.SpringBootLazyInitExampleApplication : No active profile set, falling back to default profiles: default 2020-01-17 11:38:23.355 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode. 2020-01-17 11:38:23.451 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 67ms. Found 0 repository interfaces. 2020-01-17 11:38:24.391 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$cf2fe8c5] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-17 11:38:25.625 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2020-01-17 11:38:26.191 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2020-01-17 11:38:26.192 INFO 1 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.16] 2020-01-17 11:38:26.258 INFO 1 --- [ main] 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: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib] 2020-01-17 11:38:26.486 INFO 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2020-01-17 11:38:26.489 INFO 1 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 4929 ms 2020-01-17 11:38:27.532 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2020-01-17 11:38:28.182 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2020-01-17 11:38:28.398 INFO 1 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [ name: default ...] 2020-01-17 11:38:28.627 INFO 1 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.4.0.Final} 2020-01-17 11:38:28.640 INFO 1 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found 2020-01-17 11:38:29.171 INFO 1 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final} 2020-01-17 11:38:29.438 INFO 1 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect 2020-01-17 11:38:30.312 INFO 1 --- [ main] o.h.t.schema.internal.SchemaCreatorImpl : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl#1b11171f' 2020-01-17 11:38:30.337 INFO 1 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2020-01-17 11:38:30.339 INFO 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2020-01-17 11:38:30.694 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2020-01-17 11:38:30.701 INFO 1 --- [ main] t.l.SpringBootLazyInitExampleApplication : Started SpringBootLazyInitExampleApplication in 10.338 seconds (JVM running for 11.976) 2020-01-17 12:08:38.990 WARN 1 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=28m10s615ms885µs724ns) I have also tried to run the application from local machine and I am able to reach the url but while I am trying to reach the application which is running inside docker container I am not able to reach. I am accessing that from 192.168.64.3:8085/lazy, (8085 because I have done the port forwarding at that port).
spring-boot:run fails after ctrl-c
I am trying to get a spring-boot application to run. However with my current settings I keep getting errors. Java 8 Maven 3.6.1 Environment Variables checked As of the new version 2.2.1 of spring-boot I keep getting the same error on closing the built-in tomcat. I have a sample Spring-Boot Application which I can't seem to run properly. Took a clean version from spring initializr. [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 6.547 s [INFO] Finished at: 2019-11-07T22:28:54+01:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.1.RELEASE:run (default-cli) on project java13-app: Application finished with exit code: 1 -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException When I go back to Spring 2.1.10 I get the following output.: . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.1.10.RELEASE) 2019-11-07 22:38:33.194 INFO 2572 --- [ main] test.Application : Starting Application on DP-BTO-Tom with PID 2572 (Y:\tbrx\java-13-spring-boot\target\classes started by Tom in Y:\tbrx\java-13-spring-boot) 2019-11-07 22:38:33.196 INFO 2572 --- [ main] test.Application : No active profile set, falling back to default profiles: default 2019-11-07 22:38:33.966 INFO 2572 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2019-11-07 22:38:33.986 INFO 2572 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-11-07 22:38:33.986 INFO 2572 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.27] 2019-11-07 22:38:34.053 INFO 2572 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2019-11-07 22:38:34.054 INFO 2572 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 832 ms 2019-11-07 22:38:34.221 INFO 2572 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2019-11-07 22:38:34.361 INFO 2572 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2019-11-07 22:38:34.364 INFO 2572 --- [ main] test.Application : Started Application in 1.542 seconds (JVM running for 4.547) 2019-11-07 22:38:35.652 INFO 2572 --- [ Thread-5] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor' [Terminate batch job (Y/N)? y Instead of a build failure.
Asked, fixed and closed as a bug in Spring Boot - 2.2.1 https://github.com/spring-projects/spring-boot/issues/18936#event-2782909196