1

I am trying to get proxool's MBeans available so that I can see/manipulate them with jconsole. I have jconsole working, but I don't see anything related to proxool.

The system is using Sun Java 1.5.0_17 (I know, I know... I'm working with the developers to upgrade). JMX is enabled by modifying $JAVA_OPTS in my tomcat 5.5 startup script:

SJO="$SJO -Dcom.sun.management.jmxremote"
SJO="$SJO -Dcom.sun.management.jmxremote.port=4998"
SJO="$SJO -Dcom.sun.management.jmxremote.authenticate=false"
SJO="$SJO -Dcom.sun.management.jmxremote.ssl=false"

JAVA_OPTS="$JAVA_OPTS $SJO"

I have proxool configured with JNDI in server.xml:

  <GlobalNamingResources>
    <Resource
        name="jdbc/database"
        auth="Container"
        type="javax.sql.DataSource"
        factory="org.logicalcobwebs.proxool.ProxoolDataSource"
        user="username"
        password="password"
        proxool.driver-url="jdbc:oracle:thin:@fqdn.example.com:1521:MYSID"
        proxool.driver-class="oracle.jdbc.driver.OracleDriver"
        proxool.alias="mysid"
        proxool.maximum-connection-count="20"
        proxool.statistics="20s,5m,15m"
        proxool.statistics-log-level="INFO"
        proxool.jmx="true"
        proxool.verbose="true"
    />
  </GlobalNamingResources>

My test .jsp can run queries and I can see it using the connections with the proxool admin servlet, but I'm unsure if there's more I need to configure in tomcat or proxool to get JMX functioning.

Advice?


jmxproxy info edit:

The jmxproxy servlet is working - when I go to the URL http://tomcatserver.example.com:4999/manager/jmxproxy/?qry=*:type%3DRequestProcessor,* the results are:

OK - Number of results: 2

Name: Catalina:type=RequestProcessor,worker=http-8080,name=HttpRequest0
modelerType: org.apache.coyote.RequestInfo
bytesSent: 0
requestBytesSent: 0
contentLength: -1
bytesReceived: 0
requestProcessingTime: 1297983483666
globalProcessor: org.apache.coyote.RequestGroupInfo@32dc51c8
requestBytesReceived: 0
serverPort: -1
stage: 0
requestCount: 0
maxTime: 0
processingTime: 0
errorCount: 0

Name: Catalina:type=RequestProcessor,worker=jk-127.0.0.1-8009,name=JkRequest794
modelerType: org.apache.coyote.RequestInfo
virtualHost: tomcatserver.example.com
bytesSent: 0
method: GET
remoteAddr: 172.30.3.51
requestBytesSent: 0
contentLength: -1
workerThreadName: TP-Processor15
bytesReceived: 0
requestProcessingTime: 9
globalProcessor: org.apache.coyote.RequestGroupInfo@1e7d3b8e
protocol: HTTP/1.1
currentQueryString: qry=*%3Atype%3DRequestProcessor%2C*
requestBytesReceived: 0
serverPort: 4999
stage: 3
requestCount: 0
maxTime: 0
processingTime: 0
currentUri: /manager/jmxproxy/
errorCount: 0

And more to the point http://tomcatserver.example.com:4999/manager/jmxproxy/?qry=Catalina:type%3DEnvironment,resourcetype%3DGlobal,name%3DProxool yields:

OK - Number of results: 0
dialt0ne
  • 3,027
  • 17
  • 27

1 Answers1

1

Solved - this was a classloading issue. When looking again today in the logs, I saw this when restarting tomcat:

Feb 22, 2011 11:47:40 AM org.apache.catalina.core.NamingContextListener addResource
WARNING: Failed to register in JMX: javax.naming.NamingException: Could not load resource factory class [Root exception is java.lang.ClassNotFoundException: org.logicalcobwebs.proxool.ProxoolDataSource]

I believe since I was using GlobalNamingResources, I needed to move proxool and jar with the database drivers up to the "common" classloader instead of the "shared" or per-webapp library directories (See the Class Loader HOW-TO). Once I relocated the .jar files to a directory in the common.loader, proxool's JMX interface started working. For refence, the MBean is in Catalina > DataSource

dialt0ne
  • 3,027
  • 17
  • 27