Forum Stats

  • 3,840,131 Users
  • 2,262,570 Discussions


Hi ,I am getting the error : java.lang.ClassCastException: report.fileUpload.recipeUpload.DownloadBe

1615069 Member Posts: 12
edited Aug 13, 2015 11:44AM in New To Java

Hi ,

I am trying to create an application in which the user will upload a file and then the records which will be uploaded will get back to user in a text file with process indicator.

But in my DAO file, when i am extracting the data from DB in a bean class, and making an Arraylist object of that bean .

I am getting the below error :

java.lang.ClassCastException: report.fileUpload.mainUpload.DownloadBean incompatible with java.lang.String.

and in the console it is printing as below while printing to that Object:

Result 0 : [email protected]

Result 1 : [email protected]

Result 2 : [email protected]

Result 3 : [email protected]

Result 4 : [email protected]

Result 5 : [email protected]

Result 6 : [email protected]

Result 7 : [email protected]

Result 8 : [email protected]

Result 9 : [email protected]

Result 10 : [email protected]

Result 11 : [email protected]

Kindly help me in this,



  • Unknown
    edited Aug 13, 2015 11:44AM
    Kindly help me in this,

    Sorry - that is NOT possible.

    If you want help with code you have to POST THE CODE. No one can debug code that they cannot see.

    The exception is telling you that you are trying to use an instance of a DownloadBean class as if it were a String.

    That is also why printing the 'DownloadBean' instance gives the object reference.

This discussion has been closed.