2017-06-02 68 views
1
獲得許可證

我目前面臨的「JBAS014516:未能獲取5分鐘內的許可證」問題,我的EJB-JBOSS configuration.Below是我的配置 -如何解決 - JBAS014516:無法到5分鐘內

<subsystem xmlns="urn:jboss:domain:ejb3:1.4"> 
     <session-bean> 
      <stateless> 
       <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/> 
      </stateless> 
      <stateful default-access-timeout="5000" cache-ref="simple"/> 
      <singleton default-access-timeout="5000"/> 
     </session-bean> 
     <mdb> 
      <resource-adapter-ref resource-adapter-name="hornetq-ra"/> 
      <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/> 
     </mdb> 
     <pools> 
      <bean-instance-pools> 
       <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/> 
       <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/> 
      </bean-instance-pools> 
     </pools> 
     <caches> 
      <cache name="simple" aliases="NoPassivationCache"/> 
      <cache name="passivating" passivation-store-ref="file" aliases="SimpleStatefulCache"/> 
      <cache name="clustered" passivation-store-ref="abc" aliases="StatefulTreeCache"/> 
     </caches> 

     <async thread-pool-name="default"/> 
     <timer-service thread-pool-name="default"> 
      <data-store path="timer-service-data" relative-to="jboss.server.data.dir"/> 
     </timer-service> 
     <remote connector-ref="remoting-connector" thread-pool-name="default"/> 
     <thread-pools> 
      <thread-pool name="default"> 
       <max-threads count="10"/> 
       <keepalive-time time="100" unit="milliseconds"/> 
      </thread-pool> 
     </thread-pools> 
     <iiop enable-by-default="false" use-qualified-name="false"/> 
     <default-security-domain value="other"/> 
     <default-missing-method-permissions-deny-access value="true"/> 
    </subsystem> 

要解決這個問題,我應該增加'嚴格最大池'到更高的值或增加線程池大小。

+0

是否存在與此消息相關的實際堆棧跟蹤?請把它包含在你的問題中。 –

回答

1

如果不理解你的用例,很難提出一個好的方法,但很可能你正在調用一個方法在你的EJB bean上,這需要太長的時間來執行,逐漸耗盡池中的實例,直到沒有留給來電過程。隨着越來越多的此操作請求進入,EJB容器將嘗試向客戶端提供池中的下一個免費項目。通常,如果bean實例上的操作完成,實例將返回到池並可用於下一次客戶端調用。如果操作需要很長時間,則該池將耗盡,直到沒有可用的實例用於服務客戶端調用。根據你的配置,EJB容器有20個實例;如果沒有可用的,它將嘗試等待5分鐘,以確定某些實例是否不會返回到池中。如果在那個時候它沒有獲得一個實例,它會向調用者拋出上面提到的錯誤。
那麼,這導致我們: 首先和最重要的是分析需要這麼長時間的EJB操作(將EJB簡單攔截器添加到您的部署非常有用,它將跟蹤您的EJB調用的開始和結束加上跟蹤執行時間)
確定誰調用該EJB實例 - 可能是對該bean執行了過多的調用。
如果無法避免或優化長時間運行的操作,增加池的大小,從而使這個bean的多個實例都提供給客戶端(調整max-pool-size

如果你的使用情況,需要長時間運行的操作,但不需要阻止並等待它們的結果,請考慮異步處理以及JMS隊列 - 在隊列中創建作業,然後使用MDB執行它們。您仍然可以通過數據庫存儲和查詢處理的狀態。