• Post Reply Bookmark Topic Watch Topic
  • New Topic

java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.lang.Object;  RSS feed

 
Babu Singh
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



I am getting exception:
java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.lang.Object;

on these line:


please advice.
Thanks.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Babu Singh wrote:
I am getting exception:
java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.lang.Object;

on these line:



It means the list is not holding what you expect... you are expecting the list to contain Object array instances. And it returned a String object.

Henry
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you would appear to be trying to cast a String to some sort of array, which you cannot do.
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have a result set, it might be obtaining a String when you expect an array. Can you actually get arrays out of result sets?
 
Babu Singh
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
resultset returns the rows which all is string.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Babu Singh wrote:resultset returns the rows which all is string.


So, why are you treating the strings as object arrays?

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!