0

我们在我们的应用程序中使用这些技术。Java、JBoss、JMS、EJB。

Package com/net/config/server/security/AccessController.java

public void checkGlobalPermissions throws NotAuthorizedException {

throw new NotAuthorizedException();
}

Package com/net/config/server/services/ejb/jboss/ServiceSecurityProxy.java

void checkCreatePermission(){
AccessController ac = AccessController.getInstance();
ac.checkGlobalPermissions();
}

Package com/net/config/server/services/ejb/ServiceBean.java
try {
        securityProxy.checkCreatePermission(type, folderId);
    } catch (Exception ex) {
        Log.error(this, "Exception in check readonly permission for     type:"+type, ex);
        return true;
    }
    return false;

当我们在 jboss 服务器上运行我们的应用程序时,我们会从这段代码中得到无限的异常。这是异常堆栈跟踪。

2012-09-20 11:55:17,792 ERROR [com.powerup.configmgr.server.services.ejb.ServiceBean]        (http-0.0.0.0-8881-4)     
Exception in check readonly permission for type:Folder
com.net.config.server.security.NotAuthorizedException: securityException.authenFailed
       at       com.net.config.server.security.AccessController.checkGlobalResourcePermissions(AccessController.java:168)
       at com.net.config.server.services.ejb.jboss.ServiceSecurityProxy.checkCreatePermission(ServiceSecurityProxy.java:219)
    at com.net.config.server.services.ejb.ServiceBean.checkReadOnlyPermission(ServiceBean.java:92)
    at com.net.config.server.services.ejb.ServiceBean.getItemDetails(ServiceBean.java:491)
    at com.net.config.server.services.ejb.ServiceBean.getAllItemDetails(ServiceBean.java:395)
at sun.reflect.GeneratedMethodAccessor2272.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
    at org.jboss.ejb.plugins.SecurityProxyInterceptor.invoke(SecurityProxyInterceptor.java:175)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
    at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
    at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
    at org.jboss.ejb.plugins.AbstractInterceptor.invoke(AbstractInterceptor.java:96)
    at com.powerup.service.jboss.plugins.RetryInterceptor.invoke(RetryInterceptor.java:81)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
    at org.jboss.ejb.Container.invoke(Container.java:873)
at sun.reflect.GeneratedMethodAccessor319.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    at org.jboss.invocation.http.servlet.InvokerServlet.processRequest(InvokerServlet.java:147)
    at org.jboss.invocation.http.servlet.InvokerServlet.doPost(InvokerServlet.java:209)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    at java.lang.Thread.run(Thread.java:619)

此异常在 6 小时内抛出 2000 次。我无法确定这可能是什么原因。但注意到ServiceSecurity class不处理这个NotAuthorized Exception。它在生产盒中,因此无法在内部重现该问题。这会导致更多数量的JMSspyobject 异常并最终Out of memory出现错误。所以有人可以帮忙吗?

4

1 回答 1

1

但注意到ServiceSecurity[Proxy]该类不处理这个NotAuthorizedException

我怀疑NotAuthorizedException是 a RuntimeException,因此ServiceSecurityProxy不需要处理或声明它。

对我来说,您的代码看起来完全符合我的预期。也许您期望ServiceSecurityProxy注射不同的药物?

于 2012-10-04T12:19:47.810 回答