Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Getting JDBC performance and HTTP endpoint data with Spring Insight?

  1. #11

    Default

    More information, which may help or muddle things even further. I started with the petclinic application, enabled mysql, and got it running using an entry in servlet.xml: <Context docBase="path/to/petclinic/war" .../> and it looks just fine (jdbc calls in the trace, etc, and all the HTTP enpoints). But it looks like the file war/META-INF/context.xml isn't read (typos/errors in the file go unnoticed).

    Then I copied all in the war directory to the catalina base (the tc Server instance), using eclipse's deployment mechanism. Now I get only the top level (ex: GET /petclinic/vets.do). But I know the context.xml file is read, because a typos/errors show up as errors in the logs.

    I inserted a breakpoint at ClinicController#vetsHandler() and compared the stack traces (thinking maybe the valves were setup differently, but the two stacks looked the same.

  2. #12
    Join Date
    Feb 2008
    Location
    Fremont, CA
    Posts
    4

    Default

    Quote Originally Posted by sneakybeaky View Post
    I can see app traces fine in the recent activity view, but I can't see any HTTP endpoint activity either in the application health view.

    Our app is Spring 2.5.x and running as the ROOT context in tomcat.
    I see the same issue, however I'm not deploying on root. I am using a context path to deploy it. I just raised https://issuetracker.springsource.com/browse/INSIGHT-3
    Last edited by rahulsom; Nov 4th, 2009 at 03:33 PM. Reason: Added ticket info

  3. #13
    Join Date
    Nov 2009
    Location
    Los Angeles, CA
    Posts
    3

    Question

    I have a similar issue with an application I am trying to analyze using Insight. I deployed the application by copying the .war file in the webapps directory (i.e. it is not running in the ROOT context).

    First of all, using the default configuration (which works fine on regular (non-Spring) Tomcat), the application won't start at all, and I get a lengthy Exception stack trace in my applications log file that the "myDataSource" bean could not be instanciated. The root cause is a javax.naming.NamingException with no error message.

    The "myDataSource" bean is configured as follows:
    Code:
        <bean id="myDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiName">
                <value>java:comp/env/jdbc/hypodb</value>
            </property>
        </bean>
    By default, the application provides the configuration for the resource in its META-INF/context.xml file. I tried moving the resource definition into the tc server's server.xml file under <GlobalNamingResources>, but I still get the same error.

    So I changed the data source definition to skip JNDI and configure it directly in my Spring configuration, like so:
    Code:
        <bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
            <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
            <property name="url" value="jdbc:mysql://localhost:3306/mydatabase"/>
            <property name="username" value="xxxxxxx"/>
            <property name="password" value="xxxxxxx"/>
        </bean>
    Now I can run the application on tc server and it shows up in Insight as well, but the traces contain nothing but information about the HTTP requests made (no call tracing, and no SQL tracing either, just like the OP). Also, under "Application Health", there are no endpoints listed.

    I tried moving the MySQL JDBC driver into the webapp/lib directory, but it doesn't change anything. Still no SQL trace information available.

    I'm using mysql-connector-java-5.0.7-bin.jar, the application is built using Spring 2.5 and Hibernate 3.0 (through JPA).

  4. #14
    Join Date
    Oct 2009
    Posts
    55

    Default

    I'm going to resurrect this thread. Litius, did you try putting the driver _only_ in WEB-INF/lib? That is the recommended fix. If you put it in both the WEB-INF/lib and the server/lib I don't believe it will take the latter.

  5. #15
    Join Date
    Apr 2008
    Location
    Philadelphia, US
    Posts
    198

    Arrow

    @jtravis,

    Yeap, that is the first thing I tried (having the only jar in WEB-INF/lib).
    Humans are stateful and mutable beings that have no problems processing many things concurrently and share state with others + they are usually "coupled"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •