How to enable CDI inject in web service (jaxrs/jersey) on java se running grizzly?

After seeing this stackoverflow post, I implemented the following solution. Not sure if it is the best route to take, but it worked. I created an hk2 Binder and registered the Binder: public class WebServiceBinder extends AbstractBinder { @Override protected void configure() { BeanManager bm = getBeanManager(); bind(getBean(bm, StudentRepository.class)) .to(StudentRepository.class); } private BeanManager getBeanManager() { … Read more

Can not deserialize instance of java.lang.String out of START_OBJECT token

You’re mapping this JSON { “id”: 2, “socket”: “0c317829-69bf-43d6-b598-7c0c550635bb”, “type”: “getDashboard”, “data”: { “workstationUuid”: “ddec1caa-a97f-4922-833f-632da07ffc11” }, “reply”: true } that contains an element named data that has a JSON object as its value. You are trying to deserialize the element named workstationUuid from that JSON object into this setter. @JsonProperty(“workstationUuid”) public void setWorkstation(String workstationUUID) { … Read more