Linked Questions

0 votes
0 answers
12 views

tomcat jdbc - ScheduledExecutre inserts work initially then fail, without error [duplicate]

My ScheduledExecutorService runs a few jobs. Initially all inserts to Oracle work fine but they eventually start to fail silently (no errors in tomcat logs). On shutdown of tomcat, I get these ...
mrcrag's user avatar
  • 342
31 votes
1 answer
26k views

Spawning threads in a JSF managed bean for scheduled tasks using a timer

I would like to know if it's ok to use Timer inside application scoped beans. Example, lets say that I want to create a timer task that sends out a bunch of emails to every registered member one ...
Dimman's user avatar
  • 1,186
11 votes
2 answers
8k views

ScheduledExecutorService only runs once

I want a process to run after I start my webservice, and then every 30 minutes or so afterwards, (I'm testing it with a smaller delay for now, just to see if it works), but my process never runs more ...
MMAdams's user avatar
  • 1,508
3 votes
2 answers
617 views

Maintaining a time gap with post vs postDelayed

There are two functions I need to run with a minimum time gap between them. For reasons beyond the scope of this question, at first I was trying to control the timing from a process running in the ...
drmrbrewer's user avatar
  • 12.2k
4 votes
3 answers
647 views

Java garbage collection in multithreaded application for local variable

I have following use-case: Need a single background thread which maintains a set of accountIDs in memory and it fetches the latest accountIds every 1 second Other multiple parallel running process ...
mihir S's user avatar
  • 627
0 votes
1 answer
998 views

java ScheduledExecutorService runnable exception handling

I am realizing that if a exception are raised inside(or not, but should be related to) my runnable's run method, all my future tasks will not be run. So my question is: How can I recover from such a ...
Johnyy's user avatar
  • 2,086
-2 votes
1 answer
462 views

NoSuchMethod Error in Java-Solved: Multiple projects added in POM.xml as dependencies had same class name and same method. Renamed them

I have a listener program that triggers a main program based on the below conditions If the database has new records If the time from last run is 10 minutes. This is done using ...
pnv's user avatar
  • 1,463
0 votes
2 answers
509 views

How do i get ScheduledExecutorService to keep executing other subsequent tasks when one task throws an exception

I have got an executor that executes a task every 5 sec public class ScheduledTaskExecutor { public int execute(){ ScheduledExecutorService executor = Executors.newScheduledThreadPool(4); ...
theyCallMeJun's user avatar
0 votes
6 answers
280 views

Create one file per week

I have a java program which is gonna be manually run every day. Now I want to create an excel file per wek to write in it all tasks of the week I know how to create a file every day like this: if(!...
Amadou Beye's user avatar
  • 2,748
1 vote
1 answer
442 views

Using Java stream forEach() in ScheduledExecutorService freezes

The general idea is to have a Runnable running every 10 seconds in background to check some data and if needed make changes in an object. ScheduledExecutorService is instantiated in method main() and ...
Miłosz's user avatar
  • 17
0 votes
2 answers
91 views

Why doesn't my Thread create a new one when it catches an Exception?

So I have a thread running like this: Runnable runnable = new Runnable() { @Override public void run() { System.out.println(&...
aqwertyyyz's user avatar
0 votes
0 answers
76 views

Java [Peer-To-Peer]: Runnable stops/blocks unexpectedly

I am developing a simple distributed ledger. I want to be able to start nodes on different ports, that could communicate with eachother. Each programme then would have a file, where it would write ...
Jaroslav Gorshkov's user avatar
0 votes
1 answer
42 views

i want to run my code block again by the minute

I want to run my code block again every minute. Because I need to pull data from a site continuously gradually. Even if the site crashes or the machine crashes, I want it to run the data withdrawal ...
Quadante's user avatar