Как новичок в servicemix/karaf, я пытаюсь создать очень простую программу, которая принимает и возвращает REST-запрос. Класс I есть:servicemix: на каком порту мой слуховой аппарат osgi?
package (....)
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import (...).model.RSDocument;
import (...).model.RSDocumentResponse;
@RestController
public class DocumentService {
@RequestMapping(value = "/rest/document", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody ResponseEntity<RSDocumentResponse> printDocument(
@RequestBody RSDocument documentRequest)
{
System.out.println(documentRequest.getContent());
RSDocumentResponse response = new RSDocumentResponse();
response.setSuccess(true);
return new ResponseEntity<>(response, HttpStatus.OK);
}
}
У меня есть что-то подобное, работающее в Tomcat. В Tomcat вы должны указать порт, в котором он будет прослушивать входящие запросы, дважды щелкая на сервере в eclipse и устанавливая значение в разделе «Порты». Как установить порт в Servicemix или даже выяснить, какой порт он сейчас прослушивает? У меня есть пакет, который успешно запускается из командной строки в Servicemix. Мое приложение, похоже, не прослушивает 80 (Apache), 8080 (None) или 8181 (Servicemix console)
Как вы упаковываете и развертываете приложение. Я думаю, у вас есть больше, чем этот класс –