Quantcast
Channel: MarsHut
Viewing all articles
Browse latest Browse all 6551

REST (EJB) in WAR inside EAR publishes twice

$
0
0
I have an application which is deployed as an EAR. It contains several EJB
modules, a couple of Web modules, and some library jar files.

We added a Web Module to provide RESTful web services using a particular
context-root.

Everything was fine until we needed to access an EJB that requires a
particular role to access it.

We do our authentication and authorization using custom code within our web
services, so they don't use any standard security mechanisms and the
principal is not set. The solution I found was to use @RunAs and @Session
annotations on the web service classes. This allows us to access all of the
EJBs that we need, but causes the web services to be deployed to multiple
context-roots, and appears to attempt to deploy the EJB2.x Entity Beans that
are used by the web services twice, resulting in NameAlreadyBoundExceptions.

- Tim

Viewing all articles
Browse latest Browse all 6551

Latest Images

Trending Articles



Latest Images