I have an application that just gets/puts RESTful stuff all day, written
completely in CDI. I don't have a use for the JSF/JSP/EJB side of TomEE in
this particular app.
Here is what I've put into an EJB project, then included that in an EAR
that's being deployed /apps. The server starts fine, but it's not deploying
the JAX-RS Application.
@ApplicationPath("/api")
public class FormsApplication extends Application {
/**
* {@inheritDoc}
*/
@Override
public Set<Class<?>> getClasses() {
return new HashSet<Class<?>>(Arrays.asList(JSONEndpoint.class,
XMLEndpoint.class, RestExceptionMapper.class));
}
}
@Path("json/forms")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class JSONEndpoint extends FormsRestController {
}
@ApplicationScoped
public abstract class FormsRestController {
@Inject
private Logger log;
@Inject
private Event<LifeInsuranceForm> lifeBus;
@POST
@Path("lifeInsurance/submit")
public void submit(LifeInsuranceForm lifeInsuranceForm) throws Exception
{
log.debug("create() invoked LifeInsuranceForm:{}",
lifeInsuranceForm);
validate(lifeInsuranceForm, LifeInsuranceGroup.class);
lifeBus.fire(lifeInsuranceForm);
}
}
I feel like I'm missing something painfully obvious and stupid.
--
View this message in context:
http://openejb.979440.n4.nabble.com/JAX-RS-and-OpenEJB-Standalone-tp4663308.html
Sent from the OpenEJB User mailing list archive at Nabble.com.