Skip to content
Advertisement

Tag: java

How tomcat handle multiple concurrent request at the same time?

How tomcat handle multiple concurrent request at the same time ? Does it queues up the requests or processes some of the requests in parallel ? If it processes requests in parallel , how does it returns the asynchronous response ? Does it keeps the connection open with client until response comes ? If the tomcat uses a multi threaded

OSGi declarative service is active, but bind() is not called

I’m facing an issue in OSGi context with declarative services which I don’t understand. I try to explain: I have a FooService which needs the FooManagerService (1..1 static). The FooManagerService references the FooService, but it’s optional (0..n dynamic). The goal is, if a FooService becomes available, it registers (bind() method is called) at the FooManagerService, so that the FooManagerService always

Need to run .jar from console for it to work

I have a java application. I’m using eclipse to write, compile and create a runnable .jar. The program is used to discover OCF devices. It uses UDP and multicast. Multicast code The code works when I start it from eclipse. It also works when I run the .jar from console on Linux. But when I start it with a double

Linux time conversion fail

My program will take the current system time in HH:MM:SS and convert it into seconds. The reason i convert it into second is because i want to find out the time that was 90 seconds ago. For example :Current time : 12:30:30Time 90 sec ago : 12:29:00 But i can’t make it to the correct timestamp. Here are the output

`spring.config.location` is ignored

Fairly straight forward. I have a configuration file: I run my application as a follows: And logging indicates the setting is visible to the application: 04:28:16.919 [main] WARNING CONFIG- [–spring.config.location=file:///etc/my-application] But my settings are ignored: The following yields the same outcome: So does: This doesn’t work either, the arguments don’t come through as well: Curiously enough if I specify the

Linux top output unrealistic?

I’m having a weird issue with a java process which is consuming a lot of resources on a linux VM. The output of top for the process is the below : So this shows that the process is actually consuming 21G of physical memory ? When checking the process in more detail I can see it was started with -Xmx4G

java.lang.NullPointerException and return code

I’m running some java binary from bash like: run_me.sh but inside application I get java.lang.NullPointerException, howewer return code is 0, but I need some non zero exit code to understand from bash that application failed. What is the proper way to handle such cases? Update: Here is an exxample of ‘nested’ try catch blocks, when I throw exception in inner_package_class

Advertisement