2017-06-02 51 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执行它们。您仍然可以通过数据库存储和查询处理的状态。

相关问题