Question enthuware.ocejws.v6.2.200: wrong answer?

Moderators: Site Manager, fjwalraven

Post Reply
socialguy
Posts: 12
Joined: Thu Nov 28, 2013 5:23 pm
Contact:

Question enthuware.ocejws.v6.2.200: wrong answer?

Post by socialguy »

An EJB with a remote view can't be exposed as a JAX-RS resource. The answer says otherwise.

fjwalraven
Posts: 429
Joined: Tue Jul 24, 2012 2:43 am
Contact:

Re: Question enthuware.ocejws.v6.2.200: wrong answer?

Post by fjwalraven »

Note that the EJB exposes both a remote view and a no-interface view (by the @LocalBean annotation) and therefore AdditionService is a correct JAX-RS root resource class.

socialguy
Posts: 12
Joined: Thu Nov 28, 2013 5:23 pm
Contact:

Re: Question enthuware.ocejws.v6.2.200: wrong answer?

Post by socialguy »

The spec is silent about what happens when both local view and remote view are exposed by a EJB resource. Did you have some code by chance that actually does this?

fjwalraven
Posts: 429
Joined: Tue Jul 24, 2012 2:43 am
Contact:

Re: Question enthuware.ocejws.v6.2.200: wrong answer?

Post by fjwalraven »

Yes, both Glassfish and JBoss accept an EJB exposing both remote and local views as a JAX-RS root-resource.
Note that when an EJB-container exposes multiple views it will use different proxy objects. A proxy object for a remote view has more functionality than a proxy object for a local view.

JBoss even allows an EJB with only a remote view to be a JAX-RS root resource.

Regards,
Frits

socialguy
Posts: 12
Joined: Thu Nov 28, 2013 5:23 pm
Contact:

Re: Question enthuware.ocejws.v6.2.200: wrong answer?

Post by socialguy »

fjwalraven wrote:Yes, both Glassfish and JBoss accept an EJB exposing both remote and local views as a JAX-RS root-resource.
OK, thank you.
fjwalraven wrote: JBoss even allows an EJB with only a remote view to be a JAX-RS root resource.
That's probably not required by the spec but no one's complaining :)

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests