• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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

 
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.
 
author
Sheriff
Posts: 23603
138
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
 
Marshal
Posts: 60823
190
  • 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: 60823
190
  • 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: 23603
138
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!