0

在我们的 WebLogic 应用程序(Spring 2.5x)中,我想通过 Java 代码确定我们在服务器上打开的活动和空闲数据库连接的数量。

应用程序的 WL 域具有已注册的 JDBCSystemResource。该应用程序使用 JNDI 访问它,例如:

<bean id="dataSource"
    class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="myJDBC.tx.ds" />
</bean>

但是,DataSource 不会公开有关连接池状态的任何信息。

在 WL 控制台中,我已将连接池配置为跟踪活动连接的数量。我可以看到正在收集信息;但是,我不知道如何在我的应用程序代码中获取此信息。我必须做什么才能从 WebLogic 获取有关连接池的诊断信息?我对使用应用程序代码而不是通过 WL 控制台感兴趣。

我们小组花了一些时间试图弄清楚如何通过 JMX 获取信息,但到目前为止我们还没有运气。任何指导将不胜感激。

更新:

我确定 JDBCDataSourceRuntimeMBean(如 +JoseK 所述)提供了我需要的详细信息。我可以在禁用 JMX 身份验证的情况下连接;但是,当我启用 JMX 身份验证时,我得到:

Error: Password file not found: C:\bea\JROCKI~1\jre\lib\management\jmxremote.password
[JRockit] Failed to start the management agent. Note that the management agent requires that you either explicitly disable security or that you configure and enable security. Please see the documentation for details.
java.lang.RuntimeException: Password file not found
4

0 回答 0