Bug 52916 - While Importing data from excel file, this error is coming--->java.lang.String cannot be cast to org.apache.avalon.excalibur.datasource.DataSourceComponent
Summary: While Importing data from excel file, this error is coming--->java.lang.Strin...
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.7
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords: ErrorMessage
Depends on: 53844
Blocks:
  Show dependency tree
 
Reported: 2012-03-15 08:57 UTC by Cyril SCETBON
Modified: 2012-09-09 13:21 UTC (History)
3 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cyril SCETBON 2012-03-15 08:57:29 UTC
If there is an empty user variable defined (maybe someone click the add button without filling name and value for example), an exception is raised by the JDBC Request component :

jmeter.threads.JMeterThread: Error while processing sampler 'JDBC Request' : java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.avalon.excalibur.datasource.DataSourceComponent
        at org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection(DataSourceElement.java:137)
        at org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.sample(JDBCSampler.java:176)
        at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:411)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:297)
        at java.lang.Thread.run(Thread.java:662)

Components shouldn't use undefined variables

Believe me, it was hard to find the cause of this issue ...
Comment 1 Philippe Mouawad 2012-03-17 21:41:53 UTC
Date: Sat Mar 17 21:41:10 2012
New Revision: 1302018

URL: http://svn.apache.org/viewvc?rev=1302018&view=rev
Log:
Bug 52916 - JDBC Exception if there is an empty user defined variable

Modified:
   jmeter/trunk/src/core/org/apache/jmeter/config/gui/ArgumentsPanel.java
   jmeter/trunk/xdocs/changes.xml
Comment 2 Cyril SCETBON 2012-03-17 22:42:01 UTC
Thank you.
Comment 3 UmaMahesh 2012-09-06 10:09:41 UTC
please help me,
when i am trying to import data from .txt or .csv file to sqlserver through JDBC from JMeter, it is showing the following Error:

"java.lang.String cannot be cast to org.apache.avalon.excalibur.datasource.DataSourceComponent"


But it is taking the request correctly  as like below
"[Select Statement] insert into  new values ('shatrughun')"

but not exporting to database.

please do the needful help.
Comment 4 Philippe Mouawad 2012-09-06 11:59:18 UTC
Hello,
Can you attach a simple test plan showing the issue ?

Thank you
Comment 5 Philippe Mouawad 2012-09-09 13:21:03 UTC
Last reported Bug was related to error in variable naming which will be easier to detect now with:
https://issues.apache.org/bugzilla/show_bug.cgi?id=53844

I close issue as fixed.
Comment 6 The ASF infrastructure team 2022-09-24 20:37:49 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2781