I am working on Java RMI. I am having little issue with running my rmiregistry on port 2028 as I already used that one to run my test program. I can run my program using other port but I would like to know, How we can close rmiregistry running on particular port ?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
After so much of hassle I suddenly realize that rmiregistry runs in background of shell. So all we have to do close it first bring it to foreground and then close it. And it worked.
BTW to bring it to foreground just type:
and then to close it type:
Ctrl + c
That's it. Thanks a lot everyone who tried to help me out.
If you are running rmiregistry from the shell try to close it with:
I'm not so fresh with shell commands, but I hope you get the idea.
If you want to do this in programming, we do something like:
Here's the full code for our JMXServer class. We have problems creating 2 of these and completely unregistering them so we make sure to run our unit tests on different ports.
I use this code in my SimpleJmx JMX client/service package.
If the rmi registry is already using the port and you want to rebind a service without using another port. You can try the code below