P6Spy Plugin

cannot create JDBC driver in Windows, works in Linux

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows, Grails 1.1.1

Description

this works in Linux but fails in Windows, Grails 1.1.1

created a new qotd project in 1.1.1 and installed the p6spy plugin and received this exception

Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'com.p6spy.engine.spy.P6SpyDriver' for connect URL 'jdbc:hsqldb:file:devDB;shutdown=true'
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
... 27 more
Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:264)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773)

Activity

Hide
Kurtis Pearce added a comment -

I have found a work-around for the problem. Add a -Dp6.home system property and set it to where the spy.properties file exists. For example, -Dp6.home="grails-app/conf".

The problem is a result of a space in the path to the spy.properties file. There is a class called P6Util that is creating a string of the path to the spy.properties file. In it, a File object is created based on the path and file name and then there is a check to see if the file exists. If there is a space in the path, this check will return false.

The space is being introduce when starting a grails app on a local machine in Windows since all properties go to a directory named "C:\ Documents and Settings\<USER>\.grails\1.1.1\projects\<APP>\resources".

Show
Kurtis Pearce added a comment - I have found a work-around for the problem. Add a -Dp6.home system property and set it to where the spy.properties file exists. For example, -Dp6.home="grails-app/conf". The problem is a result of a space in the path to the spy.properties file. There is a class called P6Util that is creating a string of the path to the spy.properties file. In it, a File object is created based on the path and file name and then there is a check to see if the file exists. If there is a space in the path, this check will return false. The space is being introduce when starting a grails app on a local machine in Windows since all properties go to a directory named "C:\ Documents and Settings\<USER>\.grails\1.1.1\projects\<APP>\resources".

People

Vote (10)
Watch (9)

Dates

  • Created:
    Updated: