WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

WAS8.5 - EJB3.1 - Rest-View does not work, if @Local and/or @Remote-interface

  • 1.  WAS8.5 - EJB3.1 - Rest-View does not work, if @Local and/or @Remote-interface

    Posted Wed May 14, 2014 07:03 AM
    Hello community,

    I really want to have an EJB 3.1 (stateless) with a RESTful-View deployed in an single WebSphere 8.5.

    So, I annotate my EJB with @Path, a business method with @GET/@Path.
    I register com.ibm.websphere.jaxrs.server.IBMRestServlet in my webapplication web.xml and tell Weld to use my EJB (Impl-Class) as an RESTful-Web-Service.

    That fails! The service gets deployed, but my bean works as an simple POJO (confirmed in debugger/no EJBContainer involved; @EJB not working; @Resource SessionContext not injected).
    So - WAS is a certified AppServer... I tried... Always a good idea is to keep it simple.
    I've removed all interfaces to have a LocalBean with no-interface-view.
    That does it's job! I even be able to use this EJB deployed in a JAR, that is referenced by my WAR (keep the layers clean).

    But: how can I use that bean for a different client. I need remoting! What am I doing wrong or where is the hidden "do it right" flag?

    Thank you for your help.
    Carsten