2012-10-04 49 views
0

我們在我們的應用程序中使用這些技術。 Java,JBoss,JMS,EJB。Java應用程序拋出這麼多次例外

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。它在生產箱中,所以不能在內部重現問題。 這導致更多數量的JMS spyobject異常,並最終得到Out of memory錯誤。 所以任何人都可以幫忙嗎?

+0

6小時內無限次和2000次不一樣 – assylias

+0

'在6小時內拋出2000次異常' - 這實在是一個有限的例外。 –

+0

添加一些您正在使用的環境的更多相關信息? – gks

回答

1

但注意到ServiceSecurity[Proxy]類不列入處理這個NotAuthorizedException

我懷疑NotAuthorizedExceptionRuntimeException,因此ServiceSecurityProxy並不需要處理或聲明。

對我來說,它看起來像你的代碼工作正是我所期望的。也許你期待注入不同的ServiceSecurityProxy

+0

感謝您的回覆。 NotAuthorizedException擴展java.lang.SecurityException,它擴展了java.lang.RuntimeException。 – user1631072

相關問題