Breakpoint on 3rd lib source can't be triggered when I terminate the program in IDEA - spring-boot

I use IDEA as my java IDE and now I'm working on a program using springboot and quartz.
I set a breakpoint on the quartz-2.3.0's source code org.quartz.core.QuartzScheduler at line 585, and the breakpoint was enabled and was set to suspend on all thread without any specific trigger conditions.
(A screen shot here)
Then I started the program, and the quartz scheduler began to work. Before the quartz scheduler finished, I terminated the program by pressing the stop button. Although the log printed the message that confirmed the code where the breakpoint on it had been executed. The program didn't suspend at the breakpoint. Is there anything wrong with it?
Here is the log
22:48:13.134 [schedulerFactoryBean_Worker-1] INFO z.e.q.entity.dto.MyJob - Begin to execute job: DEFAULT.job_zyz2_1631439573107
Disconnected from the target VM, address: '127.0.0.1:57808', transport: 'socket'
22:48:23.090 [SpringApplicationShutdownHook] INFO org.quartz.core.QuartzScheduler - Scheduler schedulerFactoryBean_$_DESKTOP-F3S0BUG1631458081508 paused.
22:48:23.419 [SpringApplicationShutdownHook] INFO o.s.s.quartz.SchedulerFactoryBean - Shutting down Quartz Scheduler
22:48:23.420 [SpringApplicationShutdownHook] INFO org.quartz.core.QuartzScheduler - Scheduler schedulerFactoryBean_$_DESKTOP-F3S0BUG1631458081508 shutting down.
22:48:23.420 [SpringApplicationShutdownHook] INFO org.quartz.core.QuartzScheduler - Scheduler schedulerFactoryBean_$_DESKTOP-F3S0BUG1631458081508 paused.
22:48:32.134 [schedulerFactoryBean_Worker-1] INFO z.e.q.entity.dto.MyJob - Succeed to execute job: DEFAULT.job_zyz2_1631439573107
22:48:32.140 [SpringApplicationShutdownHook] INFO org.quartz.core.QuartzScheduler - Scheduler schedulerFactoryBean_$_DESKTOP-F3S0BUG1631458081508 shutdown complete.
22:48:32.141 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown initiated...
22:48:32.144 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown completed.
Process finished with exit code 130

Related

Spring Boot and Hikari Data Source, server shutting down

I'm writing and application (Angula Dart for front end, Spring Boot for back end) and I have a backbone of functionality already up. I'm facing an issue now, time to tome (can't say if there is a specific timing or if is pure random) the application shutdown itself.
[ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-12-14 18:11:27.551 INFO 278601 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-12-14 18:11:27.568 INFO 278601 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
Before those log line the application is working without any problems (there is a certai amount of inactivity of the server, it recives few requestes over the day).
This is the command i use to launch the app
java -Duser.country=IT -Duser.language=it -Dserver.port=4499 -jar whServer.jar > whServer.log 2> whServer-error.log&
Before the shtdown there are no applicative errors

How to disable spring batch console logging?

I'm using sprig batch with spring boot (2.5.5). How do I disable console logging created by batch jobs and steps? Is there any configuration prorerty to directly disable this
INFO 1 --- [ scheduling-1] o.s.b.c.l.support.SimpleJobOperator : Locating parameters for next instance of job with name=myJob
INFO 1 --- [ scheduling-1] o.s.b.c.l.support.SimpleJobOperator : Attempting to launch job with name=myJob and parameters={run.id=3970, now=2021-10-05T15:30:02.154224900Z}
INFO 1 --- [cTaskExecutor-3] o.s.b.c.l.support.SimpleJobLauncher : Job: [SimpleJob: [name=myJob]] launched with the following parameters: [{run.id=3970, now=2021-10-05T15:30:02.154224900Z}]
You can manage this by changing the log level to ERROR OR DEBUG
org.springframework.batch.level=ERROR

Spring / IntelliJ doesn't clear session data on stop

I ran in a weird situation I never had before.
I've got a spring boot application running on intelliJ on ubuntu 18.
My spring boot application runs in a dev environment connected to a h2 in memory database. I have a session based login with spring security.
The weird thing is if after I stopped and restarted the application I am still logged in. And even if I completely restart IntelliJ the session is not cleared. Even the database keeps its state and is not getting dropped.
Only if I restart the whole system everything will be cleared.
Inside my application.properties there are no special properties set.
Everything's on default.
If I stop the application the following console output comes up:
2018-12-22 11:11:19.385 INFO 10000 --- [ Thread-35] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#73abcbfa: startup date [Sat Dec 22 11:11:00 CET 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext#12e6f48a
2018-12-22 11:11:19.391 INFO 10000 --- [ Thread-35] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2018-12-22 11:11:19.391 INFO 10000 --- [ Thread-35] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans
2018-12-22 11:11:19.395 INFO 10000 --- [ Thread-35] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2018-12-22 11:11:19.395 INFO 10000 --- [ Thread-35] .SchemaDropperImpl$DelayedDropActionImpl : HHH000477: Starting delayed drop of schema as part of SessionFactory shut-down'
2018-12-22 11:11:19.415 WARN 10000 --- [ Thread-35] o.s.b.f.support.DisposableBeanAdapter : Invocation of destroy method failed on bean with name 'inMemoryDatabaseShutdownExecutor': org.h2.jdbc.JdbcSQLException:Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-197]
2018-12-22 11:11:19.417 INFO 10000 --- [ Thread-35] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2018-12-22 11:11:19.419 INFO 10000 --- [ Thread-35] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
Process finished with exit code 130 (interrupted by signal 2: SIGINT)
https://github.com/spring-projects/spring-boot/wiki/spring-boot-1.3.0-m3-release-notes
Update Tomcat, Jetty and Undertow to serialize session data when the
application is stopped and load it again when the application
restarts. Persistent session are opt-in; either by setting
persistentSession on the ConfigurableEmbeddedServletContainer or by
using the property server.session.persistent=true (Persistent sessions
are enabled by default with Devtools).
In spring boot 2, the property is:
server.servlet.session.persistent=false # Whether to persist session data between restarts.
I suppose you are talking about web login via browser (or REST-client). Also I suppose you're using default web security settings.
Then your login request creates a cookie with session id which is returned to browser and is being used in next requests until you close browser.

Spring Quartz integration Quartz getting initialized twice

I have been working on integration our current project with Jersey, the webapplication uses Spring for IOC and Quartz scheduling. But post getting the configuration working I notice the following in the log files during startup:
2014-08-15 05:43:10,830 INFO org.quartz.core.SchedulerSignalerImpl.<init>:63 - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
2014-08-15 05:43:10,834 INFO org.quartz.core.QuartzScheduler.<init>:215 - Quartz Scheduler v.1.6.5 created.
2014-08-15 05:43:10,838 INFO org.quartz.simpl.RAMJobStore.initialize:141 - RAMJobStore initialized.
2014-08-15 05:43:10,840 INFO org.quartz.impl.StdSchedulerFactory.instantiate:1229 - Quartz scheduler 'syncSchContext' initialized from an externally provided properties instance.
2014-08-15 05:43:10,841 INFO org.quartz.impl.StdSchedulerFactory.instantiate:1233 - Quartz scheduler version: 1.6.5
2014-08-15 05:43:10,848 INFO org.quartz.core.QuartzScheduler.setJobFactory:2094 - JobFactory set to: org.springframework.scheduling.quartz.AdaptableJobFactory#210e5887
2014-08-15 05:43:10,995 INFO org.quartz.core.SchedulerSignalerImpl.<init>:63 - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
2014-08-15 05:43:10,996 INFO org.quartz.core.QuartzScheduler.<init>:215 - Quartz Scheduler v.1.6.5 created.
2014-08-15 05:43:10,997 INFO org.quartz.simpl.RAMJobStore.initialize:141 - RAMJobStore initialized.
2014-08-15 05:43:10,997 INFO org.quartz.impl.StdSchedulerFactory.instantiate:1229 - Quartz scheduler 'org.springframework.scheduling.quartz.SchedulerFactoryBean#0' initialized from an externally provided properties instance.
2014-08-15 05:43:10,997 INFO org.quartz.impl.StdSchedulerFactory.instantiate:1233 - Quartz scheduler version: 1.6.5
2014-08-15 05:43:10,998 INFO org.quartz.core.QuartzScheduler.setJobFactory:2094 - JobFactory set to: org.springframework.scheduling.quartz.AdaptableJobFactory#cd79d78
2014-08-15 05:43:11,795 INFO org.quartz.core.QuartzScheduler.start:461 - Scheduler syncSchContext_$_NON_CLUSTERED started.
2014-08-15 05:43:11,796 INFO org.quartz.core.QuartzScheduler.start:461 - Scheduler org.springframework.scheduling.quartz.SchedulerFactoryBean#0_$_NON_CLUSTERED started.
What might be causing this initialization to happen twice?
The most common situation that would cause the scheduler to run twice is if the bean that is bean scheduled in included in multiple contexts.
Make sure that the scheduled beans belong only to the root application context.

While running a topology in storm we are getting error like this

While running a topology in storm we are getting error like this,
8983 [Thread-6] INFO com.netflix.curator.framework.imps.CuratorFrameworkImpl -
Starting
9144 [main] INFO **backtype.storm.daemon.nimbus** - Shutting down master
9199 [Thread-6-EventThread] INFO backtype.storm.zookeeper - Zookeeper state upd
ate: :connected:none
9241 [main] INFO backtype.storm.daemon.nimbus - Shut down master
9273 [Thread-6] INFO com.netflix.curator.framework.imps.CuratorFrameworkImpl -
Starting
9306 [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2000] WARN org.apache.zookeeper.serv
er.NIOServerCnxn - EndOfStreamException: Unable to read additional data from cli
ent sessionid 0x143af55728d0003, likely client has closed socket
9354 [main] INFO backtype.storm.daemon.supervisor - Shutting down c094c3b1-a378
-4c4f-af35-9278647c217a:4beddc09-4675-4fb9-8bdc-9cf5013ce9ca
9358 [main] INFO backtype.storm.daemon.supervisor - Shut down c094c3b1-a378-4c4
f-af35-9278647c217a:4beddc09-4675-4fb9-8bdc-9cf5013ce9ca
9361 [main] INFO **backtype.storm.daemon.superviso**r - Shutting down supervisor c0
94c3b1-a378-4c4f-af35-9278647c217a
9364 [Thread-5] INFO **backtype.storm.event** - Event manager interrupted
9369 [Thread-6] INFO backtype.storm.event - Event manager interrupted
9425 [main] INFO **backtype.storm.daemon.supervisor** - Shutting down supervisor 38
6d8d71-c9b5-4b51-bd6e-f9f605034ea0
9428 [Thread-8] INFO backtype.storm.event - Event manager interrupted
9429 [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2000] WARN org.apache.zookeeper.serv
er.NIOServerCnxn - EndOfStreamException: Unable to read additional data from cli
ent sessionid 0x143af55728d0007, likely client has closed socket
9429 [Thread-9] INFO backtype.storm.event - Event manager interrupted
9473 [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2000] WARN org.apache.zookeeper.serv
er.NIOServerCnxn - EndOfStreamException: Unable to read additional data from cli
ent sessionid 0x143af55728d0009, likely client has closed socket
9476 [main] INFO backtype.storm.testing - Shutting down in process zookeeper
9503 [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2000] WARN org.apache.zookeeper.serv
er.NIOServerCnxn - Ignoring exception
**java.nio.channels.ClosedChannelException**: null
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.jav
a:211) ~[na:1.7.0_03]
at org.apache.zookeeper.server.NIOServerCnxn$Factory.run(NIOServerCnxn.j
ava:242) ~[zookeeper-3.3.3.jar:3.3.3-1073969]
9510 [main] INFO **backtype.storm.testing** - Done shutting down in process zookeep
er
9513 [main] INFO backtype.storm.testing - Deleting temporary path C:\Users\sowm
iya\AppData\Local\Temp\c9b1bc1a-a950-4098-af77-f81a4d2b112f
9520 [main] INFO backtype.storm.testing - Deleting temporary path C:\Users\sowm
iya\AppData\Local\Temp\7e75c468-18ea-4787-a4ac-496fb108db71
9527 [main] INFO backtype.storm.testing - Unable to delete file: C:\Users\sowmi
ya\AppData\Local\Temp\7e75c468-18ea-4787-a4ac-496fb108db71\version-2\log.1
9529 [main] INFO backtype.storm.testing - Deleting temporary path C:\Users\sowm
iya\AppData\Local\Temp\fa7b3c9b-ac93-4090-b9e2-63f10019e61f
9543 [main] INFO backtype.storm.testing - Deleting temporary path C:\Users\sowm
iya\AppData\Local\Temp\55f1fd11-508e-43bb-b340-0d9b79f3af33
9579 [Thread-6-EventThread] INFO com.netflix.curator.framework.state.Connection
StateManager - State change: SUSPENDED
9580 [ConnectionStateManager-0] WARN com.netflix.curator.framework.state.Connec
tionStateManager - There are no ConnectionStateListeners registered.
9583 [Thread-6-EventThread] WARN backtype.storm.cluster - Received event :disco
nnected::none: with disconnected Zookeeper.
11232 [Thread-6-SendThread(localhost:2000)] WARN org.apache.zookeeper.ClientCnx
n - Session 0x143af55728d000b for server null, unexpected error, closing socket
connection and attempting reconnect
**java.net.ConnectException: Connection refused: no further information**
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.7.0_0
3]
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:701
) ~[na:1.7.0_03]
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
~[zookeeper-3.3.3.jar:3.3.3-1073969]
13992 [Thread-6-SendThread(localhost:2000)] WARN org.apache.zookeeper.ClientCnx
n - Session 0x143af55728d000b for server null, unexpected error, closing socket
connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.7.0_0
3]
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:701
) ~[na:1.7.0_03]
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
Whwn we are trying to run the topology jar file all the operation like nimbus,zookeeper and supervisor process going to dead.please help us to know why this is happened.
Please help us to rectify this error and help to proceed further.
Thank you,
Sowmiya
Priya
This looks like a zookeeper issue. It looks like your processes are not being able to connect to zookeeper. Can't say more without more information.

Resources