Hi @Session?
*Romain Manni-Bucau* *Twitter: @rmannibucau <https://twitter.com/rmannibucau>* *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/8/6 ymaraner <[email protected]> > 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 > -- > View this message in context: > http://openejb.979440.n4.nabble.com/REST-EJB-in-WAR-inside-EAR-publishes-twice-tp4664545.html > Sent from the OpenEJB User mailing list archive at Nabble.com. >
