我目前面临的是'JBAS014516:在5分钟内没能获得许可‘的问题-JBOSS configuration.Below是我的配置-
<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>要解决这个问题,我应该将“严格-最大-池”增加到更高的值或增加线程池大小。
发布于 2017-06-02 08:03:04
在不了解用例的情况下,很难提出一个好的方法,但很可能是在您的EJB bean上调用一个方法,这个方法要花费太长时间才能执行,逐渐耗尽池中的实例,直到调用程序没有剩馀的实例。随着对此操作的请求越来越多,EJB容器将尝试在池中为客户端提供下一个空闲项。通常,如果对bean实例的操作完成,则实例将返回到池中,并可用于下一个客户端调用。如果操作需要很长时间,池将耗尽,直到没有可用的实例来服务客户端调用为止。根据您的配置,EJB容器有20个实例;如果没有可用实例,它将尝试等待5分钟,以确保某些实例不会返回到池中。如果在这段时间内无法获取实例,它将向调用方抛出上述错误。
那么,这会给我们带来什么呢?首先,分析了花费那么长的的EJB操作(在部署中添加一个简单的拦截器非常有用,这将跟踪您的EJB调用的开始和完成,再加上跟踪执行时间)
确定是谁调用了EJB实例--也许它对该bean执行了过多的调用。
如果无法避免或优化长时间运行的操作,请增加池大小,以便更多的bean实例可供客户端使用(调整max-pool-size)
如果用例需要长时间运行的操作,但不需要阻止和等待它们的结果,请考虑异步处理以及JMS队列--在队列中创建作业,然后使用MDB执行它们。您仍然可以通过DB存储和查询处理的状态。
https://stackoverflow.com/questions/44321590
复制相似问题