我正在尝试一些性能调整并遵循 Jboss 性能调整指南。所以我读了第 3 章,我想打开缓存连接管理器。但有人提到它的配置在 server.xml 中。我在任何地方都找不到 server.xml。我在 Windows 7 上使用 jboss-eap-6.1。所以我的问题是在哪里可以找到 server.xml 或者如何关闭缓存连接管理器?
以下是 tunning guide 中的文字:
配置在 JBOSS_EAP_DIST/jboss-as/server//deploy/jbossweb.sar 目录下的 server.xml 文件中。请注意,最小配置不包括 JBoss Web。下面是启用了 CachedConnectionManager 的 server.xml 的摘录。
<!-- Check for unclosed connections and transaction terminated checks in servlets/jsps. Important: The dependency on the CachedConnectionManager in META-INF/jboss-service.xml must be uncommented, too -->
<Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve" cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager" transactionManagerObjectName="jboss:service=TransactionManager" />
要禁用 CachedConnectionManager,请按照以下示例注释最后三行:
<!-- Check for unclosed connections and transaction terminated checks in servlets/jsps. Important: The dependency on the CachedConnectionManager in META-INF/jboss-service.xml must be uncommented, too
<Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve" cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager" transactionManagerObjectName="jboss:service=TransactionManager" /> -->
另一个配置文件也需要编辑:JBOSS_EAP_DIST/jboss-as/server//deploy/jbossweb.sar/META-INF目录下的jboss-beans.xml。请注意,最小配置不包括 JBoss Web。该文件由微容器用于 JBoss Web 与其集成,它指定依赖组件之间的连接。在这种情况下,CachedConnectionManager 的阀门依赖于事务管理器。所以,为了正确地摆脱阀门,我们必须从这个配置文件中删除依赖信息。相关信息位于文件顶部,如下所示:
<!-- Only needed if the org.jboss.web.tomcat.service.jca.CachedConnectionValve is enabled in the tomcat server.xml file. -?
<depends>jboss.jca:service=CachedConnectionManager</depends>
<!-- Transaction manager for unfinished transaction checking in the CachedConnectionValve -->
<depends>jboss:service=TransactionManager</depends>
注释这些行,如下例所示: jboss.jca:service=CachedConnectionManager -? jboss:service=TransactionManager</depends>-->