Tuesday, January 25, 2011

JMeter Notes

HTTP Proxy Server URL Patterns RegEx:
.*\.action          ====> all actions that ends with .action
.*\.action\?*     ====> all actions that contain parameters
.*\uri_name      ====> specific uri
.*\uri_name\?.* ====> specific uri with parameter

JMeter Variables
1. Global variable is created at Test Plan level
2. Global variables can be referenced using ${VARIABLE} in element level
3. JMeter context variable can be referenced using ${__VARIABLE} at element level. e.g. ${__threadNum}
4. Element level 'value' field cannot perform arithmetical calculation such as + - * / or string concatenation
5. PreProcessor can be used to handle variable calculation and algorithem in familiar scripting language
6. BSF Processor is the standard implemenation of JSR223 Processor

Useful Links
JMeter - User's Manual: Component Reference
JMeter - User's Manual: Functions and Variables

Friday, January 21, 2011

db2admin lost administrators rights after password reset on Windows

After I reset my db2admin password on Windows today, I found it lost its admin rights such as create table, grant permissions...
To fix this:
1. Go to computer management > user and group > select db2admin and remove Administrators group from it
2. Apply and then add the Administrators group back to db2admin
3. Apply and then restart all DB2 windows services (or restart windows)

I experienced this problem on Windows only as DB2 is using windows credential as login authentication and authorization.

Wednesday, January 19, 2011

[SOLVED] P6DriverNotFoundError: Error registering factory

ERROR

Caused by: com.p6spy.engine.spy.P6DriverNotFoundError:
Error registering factory [com.p6spy.engine.logging.P6LogFactory]
Caused By: java.lang.ClassCastException: com.p6spy.engine.logging.P6LogFactory
cannot be cast to com.p6spy.engine.spy.P6Factory
at com.p6spy.engine.spy.P6SpyDriverCore.initMethod(P6SpyDriverCore.java:289)
at com.p6spy.engine.spy.P6SpyDriver.initMethod(P6SpyDriver.java:78)
at com.p6spy.engine.spy.P6SpyDriver.(P6SpyDriver.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory
(BasicDataSource.java:1415)



SOLUTION

This problem is caused when I have multiple copies of p6spy.jar (one in my WAR file and the other one in Tomcat Lib folder). There should be only one copy of the jar per class loader. By removing p6spy.jar from either the war file or tomcat lib, problem is gone.

Sunday, January 16, 2011

Install MySql on Mac OSX

Extracted from this article

1. Download MySql dmg from official site

2. Install all packages

3. In system preference, make sure the mysql is up and running

4. Change root password => mysqladmin -u root -p’OLDPASSWORD’ password NEWPASSWORD

5. Set up command line and manual pages:

echo 'export PATH=/usr/local/mysql/bin:$PATH' >> ~/.profile

echo 'export MANPATH=/usr/local/mysql/man:$MANPATH' >> ~/.profile

(For Rails Developers:)
6. If you are migrated from Leopard to Snow Leopard, you need to reinstall snow leopard version XCode to get rid of gem update errors (caused by missing ruby.h header file)