JIRA 10 (Help Needed) -> Getting port error and 500 error

import java.net.DatagramSocket;
import java.net.InetAddress;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;

import org.json.simple.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

import com.thed.je.zbot.ZbotProperties;
import com.thed.je.zbot.util.Messages;


@Component
public class AgentServiceImpl {
RestTemplate restTemplate = new RestTemplate();
 ResponseEntity<JSONObject> result = restTemplate.postForEntity(URL, requestEntity, JSONObject.class);
}

Below are the values while debugging

When I am trying to run above code, I am getting following error
500 error-> “Unable to start the agent. The port is in use by some other process.”

But same code when i run with Jira9, it is working.
Can anyone help me with this

Below is code for Server Start


import java.util.Locale;
import java.util.ResourceBundle;
import java.util.Scanner;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import org.json.simple.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ExitCodeGenerator;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.embedded.tomcat.ConnectorStartFailedException;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.ResourceAccessException;
import org.springframework.web.client.RestTemplate;

import com.thed.je.zbot.service.impl.AgentServiceImpl;
import com.thed.je.zbot.util.Messages;
import com.thed.je.zbot.util.PropertyUtils;
import com.thed.je.zbot.util.ZbotConstants;
import com.thed.je.zbot.util.Zbotutils;


public class ServerStartApplication {

	public void run() {
				try {
AgentServiceImpl agentServiceImpl = new AgentServiceImpl();
					agentServiceImpl.registerAgent(zbotProperties);
else if(e instanceof ResourceAccessException) {
						logger.error("Unable to connect to server, check configuration url from \"zbot.properties\" file");
						appendToConsoleNL("Unable to connect to server, check configuration url from \"zbot.properties\" file");
						stopSpringApp();
						agentRegistered = false;
						return;
					}else if(e instanceof ConnectorStartFailedException){
						logger.error("Cant start agent either already running or port is in use", e);
						appendToConsoleNL("Unable to start the agent. The port is in use by some other process.");
						appStarted = false;
						agentRegistered = false;
						return;
					}else {
						logger.error("Cant start agent either already running or port is in use", e);
						appendToConsoleNL("Unable to start the agent. The port is in use by some other process.");
						agentRegistered = false;
						return;

Hello RaghunandanTata,
have you tried this steps?

  1. Check for Running Processes: Ensure that no other process is using the port you’re trying to use. You can use the lsof command on macOS to check which process is using the port:
lsof -i :<port_number>

Replace <port_number> with the port number you’re trying to use. This will list the process using that port.
2. Change the Port: If another process is using the port, you can change the port number in your code to a different one that is not in use.
3. Restart Your Application: Sometimes, simply restarting your application or your machine can resolve port conflicts.
4. Check Jira Configuration: Ensure that your Jira instance is configured to use the correct port. You can check the Jira configuration files or the Jira administration settings to verify the port settings.
5. Update Dependencies: With Jira10 comes Java17. Make sure all your dependencies are up to date and compatible with Jira 10. Sometimes, outdated dependencies can cause conflicts.

Best regards
Daniel