Skip to content
Advertisement

Issue Converting seconds to HH:MM:SS java

I have a long variable which represents the downtime of an application in seconds. I want to display the downtime as HH:mm:ss When passing the long variable to the Date I multiplied it 1000 to get the millisecond value. The newD variable evaluates to Thu Jan 01 01:12:35 GMT 1970 The value of newD is off by 1 hour, 755

Is it possible to resume Java execution after exception?

I have a ParentClass in a JAR, but not source code. I am implementing a SubClass, but i need to handle some corner cases. Is there a way to run the //lots of code 2 part after handling the exception in the overriding method? I don’t want to duplicate code, and cannot modify the ParentClass. P.S: The NullPointerException problem wasn’t

Java Stream filter with regex not working

hope somebody can help me. I have a ArrayList of a Invoice class. What I’m trying to get is to filter this ArrayListand find the first element which one of its properties matches with a regex. The Invoiceclass looks like this: I’m filtering with this regex (\D+) in order to find if there is any value in the orderNumproperty that

Logging in AWS Lambda with slf4j

I am using a lambda function and writing it in Java. I was looking up logging for Lambda functions when I read the docs and they support log4j – http://docs.aws.amazon.com/lambda/latest/dg/java-logging.html#java-wt-logging-using-log4j. I was wondering if we could use logging using the Slf4j annotation as well since Slf4j is only a binding annotation. Has anybody tried using Slf4j before with lambda? Answer

How to change log level only for current thread with Logback

In Logback, the log level of a logger can be changed with setLevel() method. But in Logback, because the loggers are singleton, the call of setLevel() method will affect to all other threads that use same logger. Now I have a class used in a web application like this: And in Spring ApplicationConfig.xml: I want to log call of insertRecord

Advertisement