You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2001/04/10 22:23:02 UTC

[Bug 1297] New - ClassCastException Testing Database in 1.6

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1297

*** shadow/1297	Tue Apr 10 13:23:01 2001
--- shadow/1297.tmp.612	Tue Apr 10 13:23:02 2001
***************
*** 0 ****
--- 1,45 ----
+ +============================================================================+
+ | ClassCastException Testing Database in 1.6                                 |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 1297                        Product: JMeter                  |
+ |       Status: NEW                         Version: 1.5                     |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Normal                   OS/Version:                         |
+ |     Priority:                           Component: Main                    |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: jmeter-dev@jakarta.apache.org                                |
+ |  Reported By: fradelos@jgsullivan.com                                      |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ Running following setup in version 1.6
+ 
+ - Test Plan
+         - Thread Group
+                 - Database Testing
+                         - SQL Query
+ 
+ 
+ I always get the exeption:
+ 
+         java.lang.ClassCastException: org.apache.jmeter.config.LoginConfig
+                 at org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.sample
+ (JDBCSampler.java:102)
+                 at org.apache.jmeter.threads.JMeterThread.run
+ (JMeterThread.java:133)
+                 at java.lang.Thread.run(Thread.java:484)
+ 
+ 
+ Here is the line that does it (JDBCSampler.java:102):
+ 
+         DBKey key = getKey((DbConfig)e.getConfigElement(DbConfig.class),
+                 (PoolConfig)e.getConfigElement(PoolConfig.class));
+ 
+ 
+ I think that the cause is that DbConfig extends 
+ org.apache.jmeter.config.LoginConfig but does not override the clone() method.  
+ This means that aDbConfig.clone() returns an instance of LoginConfig.  Since 
+ the Entry class clones ConfigElements before putting them on a hash, the return 
+ value of getConfigElement() is a LoginConfig.  Hope this helps.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org