Topic
  • 1 reply
  • Latest Post - ‏2013-04-26T17:52:22Z by MJonker
UniqueScreenName
UniqueScreenName
2 Posts

Pinned topic No-interface view EJBs throw EJBAccessException when web-app security is on

‏2013-02-11T18:04:50Z |
When I activate web-app form based security in an application with EJBs, my no-interface view SSBs throw EJBAccessExceptions as soon as they are looked up. Some of them are @Startup beans, so they throw exceptions when the app is started (there is no principal) and some throw the exceptions when they are injected into JSF 2.0 ManagedBeans (when there is a principal).

When I remove web security from my web.xml, they work again. This is both programmatic and declarative web security with no constraints on the EJBs at all (no DDs are defined, they are all annotation based)

When I add an @Local interface to a previously no-interface bean, the exceptions are not thrown and I can successfully access the beans and login to the app. Any beans that do not have a @Local interface will still throw exceptions.

Am I missing something on how this should work? It sounds like a bug/EJB integration problem to me?

Version: WASCE 3.0.0.2
IBM JDK java version "1.7.0"
Java(TM) SE Runtime Environment (build pwi3270sr1-20120405_01(SR1))
IBM J9 VM (build 2.6, JRE 1.7.0 Windows 7 x86-32 20120322_106209 (JIT enabled, AOT enabled)

All of my no-interface view beans do this, but here is a prototypical example of the code:

The bean I'm using for testing this problem:
@Stateless(name="cm/mailservice",mappedName="cm/mailservice")
public class MailServiceBean {
@Resource(name="mail/MailSession")
Session mailSession;

...

}

The injection:

@ManagedBean(name="portList")
@RequestScoped
public class PortsListBean {
@EJB(name="cm/mailservice")
MailServiceBean mailService;

...
}

The exceptions:
2013-02-11 11:55:06,247 INFO Holder Could not look up comp/env/cm/mailservice
javax.naming.NamingException: could not look up openejb/Deployment/CommonServices.jar/MailServiceBean/com.antlerhill.mail.service.MailServiceBean!LocalBean [Root exception is javax.naming.NamingException: openejb/Deployment/CommonServices.jar/MailServiceBean/com.antlerhill.mail.service.MailServiceBean!LocalBean http://Root exception is java.lang.reflect.UndeclaredThrowableException]
at org.apache.openejb.core.ivm.naming.IntraVmJndiReference.getObject(IntraVmJndiReference.java:45)
at org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
at org.apache.xbean.naming.context.ContextUtil.resolve(ContextUtil.java:61)
at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:116)
at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:619)
at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:156)
at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:619)
at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:156)
at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:605)
at org.apache.geronimo.j2ee.annotation.Holder.addInjections(Holder.java:210)
at org.apache.geronimo.j2ee.annotation.Holder.newInstance(Holder.java:172)
at org.apache.geronimo.myfaces.LifecycleProviderGBean.newInstance(LifecycleProviderGBean.java:65)
at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:155)
at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.createManagedBean(ManagedBeanResolver.java:332)
at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.getValue(ManagedBeanResolver.java:295)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:58)
at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:171)
at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:65)
at org.apache.myfaces.el.convert.VariableResolverToELResolver.getValue(VariableResolverToELResolver.java:116)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:58)
at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:171)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:72)
at org.apache.el.parser.AstValue.getValue(AstValue.java:147)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
at org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.getValue(ContextAwareTagValueExpression.java:94)
at javax.faces.component._DeltaStateHelper.eval(_DeltaStateHelper.java:243)
at javax.faces.component.UIData.getValue(UIData.java:1456)
at javax.faces.component.UIData.createDataModel(UIData.java:1404)
at javax.faces.component.UIData.getDataModel(UIData.java:1381)
at javax.faces.component.UIData.getRowCount(UIData.java:469)
at org.apache.myfaces.shared.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:308)
at org.apache.myfaces.shared.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:191)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:508)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:630)
at org.apache.myfaces.shared.renderkit.RendererUtils.renderChildren(RendererUtils.java:526)
at org.apache.myfaces.shared.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:115)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:641)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:637)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:637)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1526)
at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:264)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:90)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.geronimo.tomcat.security.SecurityValve.invoke(SecurityValve.java:89)
at org.apache.geronimo.tomcat.security.jacc.JACCSecurityValve.invoke(JACCSecurityValve.java:54)
at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:730)
at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:48)
at org.apache.geronimo.tomcat.valve.ProtectedTargetValve.invoke(ProtectedTargetValve.java:53)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:243)
at org.apache.geronimo.pool.ThreadPool$ContextClassLoaderRunnable.run(ThreadPool.java:373)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1121)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
at java.lang.Thread.run(Thread.java:777)
Caused by: javax.naming.NamingException: openejb/Deployment/CommonServices.jar/MailServiceBean/com.antlerhill.mail.service.MailServiceBean!LocalBean http://Root exception is java.lang.reflect.UndeclaredThrowableException
at org.apache.xbean.naming.context.ContextUtil.resolve(ContextUtil.java:65)
at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:116)
at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:605)
at org.apache.geronimo.openejb.DeepBindableContext$ContextWrapper.lookup(DeepBindableContext.java:97)
at org.apache.openejb.core.ivm.naming.IntraVmJndiReference.getObject(IntraVmJndiReference.java:41)
... 66 more
Caused by: java.lang.reflect.UndeclaredThrowableException
at $Proxy114.create(Unknown Source)
at org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference.getObject(BusinessLocalBeanReference.java:33)
at org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
at org.apache.xbean.naming.context.ContextUtil.resolve(ContextUtil.java:61)
... 70 more
Caused by: java.rmi.AccessException: Unauthorized Access by Principal Denied; nested exception is:
javax.ejb.EJBAccessException: Unauthorized Access by Principal Denied
at org.apache.openejb.core.ivm.EjbHomeProxyHandler._invoke(EjbHomeProxyHandler.java:245)
at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:284)
... 74 more
Caused by: javax.ejb.EJBAccessException: Unauthorized Access by Principal Denied
at org.apache.openejb.core.singleton.SingletonContainer.invoke(SingletonContainer.java:175)
at org.apache.openejb.core.ivm.EjbHomeProxyHandler.create(EjbHomeProxyHandler.java:284)
at org.apache.openejb.core.ivm.EjbHomeProxyHandler._invoke(EjbHomeProxyHandler.java:171)

Ex
  • MJonker
    MJonker
    26 Posts

    Re: No-interface view EJBs throw EJBAccessException when web-app security is on

    ‏2013-04-26T17:52:22Z  

    plus+ voor me