ClassCastException error problem

Hi all,
I am relatively new to java and confused with the following problem. The below code compilers but returns a ClassCastException error when run.
private List<TableOne> query = new ArrayList<TableOne>();
       private TableTwo tableTwo;
//create an array of values
        for (Double value : array) {
          query = ..result from sql query (needs to be list using hibernate)
         for (TableOne queryValue :  query ) {
         //something
public List<TableOne> getTableOne() {
        return query;
    public List getQuery()
        return this.Query;
           The ClassCastException error occurs on the second for loop? Is this because the wo objects are not of the same type? Any suggetions would be great, thanks in advance

Hi,
look, List<TableOne> should mean that You have a list of TableOne objects. It seems like logic mistake. In addition, You are already have instance of query why do You need to assign it once more?
Now about ex. You sayed it is in the second loop and put almost nothing there. It seems like You have a mistake in //something ;)

Similar Messages

  • ClassCastException error  Please Help!

    When I run my Java Applet, I get a ClassCastException error. Here's the link: http://users.route24.net/~jtrost/bb4/bb4.html
    I have no idea what this means or how to fix it? Could someone please help me? Also, here are the two java files: http://users.route24.net/~jtrost/bb4/Guest.java
    http://users.route24.net/~jtrost/bb4/Picker.java
    Picker.java is the main one, and Guest.java just holds information about every instance of the array of Guest that I have.
    Thank you!

    dear friend
    well i have worked with java a lot. i went 2 ur site but i was unable to see ur applet. then i downloaded ur code and run it on my pc and it run fine. but i have some doubts. clear them so that i can better help u.
    1> this is an application and not an applet. please post the original version of ur applet so that i can study it. or atleast make ur applet available on the link u have given.
    2> ur coding is good but there are some loopholes which can cause indirect problems. i may clear them after studying ur applet.
    here are some solutions which i can give u at this stage
    ClassCastException is also thrown when u r using different versions (maybe compiled from two different java files) at different places. make sure ur class file is directly compiled in the spacified folder.
    dont make every class public
    run the applet on appletviewer and see if the same error exists
    set indirect debug points by writing System.out.println("something") on various places and try to find out origion of the exception (this works only with appletviewer)
    there was a problem when running this aplication that it was not exiting. try to find out why.
    write your problem in detail.jitin

  • I am currently using Lightroom 5.6 and operating on a Mac with OSX Ver 10.9.5. I am receiving an error problem when doing the following -  I am exporting selected photos from a particular Catalogue saved on Drive 1 to a folder created on another Drive whe

    Hi, I am having a little trouble with exporting images to another drive and Catalogue and need some help if anyone can give me some advice
    I am currently using Lightroom 5.6 and operating on a Mac with OSX Ver 10.9.5.
    I am receiving an error problem when doing the following -
    I am exporting selected photos from a particular Catalogue saved on Drive 1 to a folder created on another Drive where a Lightroom Catalogue has been created. In this Catalogue I have arranged for the images once exported to be moved to a different folder - I used the Auto Import process under the File dialogue box.
    When processing the Export I receive an error message for each of the images being exported indicating the following -
    Heading Import Results
    Some import operations were not performed
    Could not move a file to requested location. (1)
    then a description of the image with file name
    Box Save As                                  Box  OK
    If I click the OK button to each image I can then go to the other Catalogue and all images are then transferred to the file as required.
    To click the OK button each time is time consuming, possibly I have missed an action or maybe you can advise an alternative method to save the time in actioning this process.
    Thanks if you can can help out.

    Thank You, but this is a gong show. Why is something that is so important to us all so very, very difficult to do?

  • Error "Problem occured locking WS object" while activating Proxy

    Hi All,
    I have move an Inbout proxy to a different Client(QA system) and in QA system that proxy shows incative.
    When i tried to activate that proxy/service in Sproxy, getting error "Problem occured locking WS object".
    Proxy was active in development system and was working fine without any error.
    Please provide some help, what need to be done to fix this issue
    Thanks
    Harshit

    Hi Harshit,
    Try with the following steps in sequence:
    1. Re-genarate the proxy in Development - Create a New Transport Reuest.
    2. Transport the Proxy from PI Dev to PI OA
    3. Confirm the Proxy in PI QA and then, transport the re-generated Request from ECC Dev to ECC QA.
    Regards,
    Pranav.

  • Error "Problem building schema" while invoking external webservice

    Hi,
    I have following problem:
    I created 2 BPEL processes.
    One of these processes should be called from the other as a partnerlink.
    When I create the partnerlink, pointing to the deployed wsdl, I get following error "Problem building schema" when I try to access the input variable that was created by the invoke activity.
    I have tried a lot of things but keep on getting this error.
    When I create a new, empty BPEL process, and do exactly the same it does work!
    any help would be greatly appreciated.....

    Hi,
    I have given this URL 'http://ws.cdyne.com/WeatherWS/Weather.asmx?WSDL'.
    Now it is showing the following error
    Exception occured in library handler.Not implemented.
    Exception of class CX_SIDL_INTERNAL_ERROR
    Please have a look into it
    Regards,
    Dhana

  • I'm a character error problem in firefox. How can I solve.

    I'm a character error problem in firefox. How can I solve.

    Hello haruntt, please be a little more specific about the issue. In order to better assist you with your issue please provide us with a screenshot. If you need help to create a screenshot, please see [[How do I create a screenshot of my problem?]]
    Once you've done this, attach the saved screenshot file to your forum post by clicking the '''Browse...''' button below the ''Post your reply'' box. This will help us to visualize the problem.
    Thank you!

  • MPD: ERROR: problems opening audio device

    Since a day, maybe a little more, mpd is troubling me. When I use mpc, I get the error
    ERROR: problems opening audio device
    This is my mpd.conf
    # An example configuration file for MPD
    # See the mpd.conf man page for a more detailed description of each parameter.
    # Files and directories #######################################################
    # This setting controls the top directory which MPD will search to discover the
    # available audio files and add them to the daemon's online database. This
    # setting defaults to the XDG directory, otherwise the music directory will be
    # be disabled and audio files will only be accepted over ipc socket (using
    # file:// protocol) or streaming files over an accepted protocol.
    music_directory "/home/adriaan/Music"
    # This setting sets the MPD internal playlist directory. The purpose of this
    # directory is storage for playlists created by MPD. The server will use
    # playlist files not created by the server but only if they are in the MPD
    # format. This setting defaults to playlist saving being disabled.
    playlist_directory "/var/lib/mpd/playlists"
    # This setting sets the location of the MPD database. This file is used to
    # load the database at server start up and store the database while the
    # server is not up. This setting defaults to disabled which will allow
    # MPD to accept files over ipc socket (using file:// protocol) or streaming
    # files over an accepted protocol.
    db_file "/var/lib/mpd/mpd.db"
    # These settings are the locations for the daemon log files for the daemon.
    # These logs are great for troubleshooting, depending on your log_level
    # settings.
    # The special value "syslog" makes MPD use the local syslog daemon. This
    # setting defaults to logging to syslog, otherwise logging is disabled.
    log_file "/var/log/mpd/mpd.log"
    # This setting sets the location of the file which stores the process ID
    # for use of mpd --kill and some init scripts. This setting is disabled by
    # default and the pid file will not be stored.
    pid_file "/var/run/mpd/mpd.pid"
    # This setting sets the location of the file which contains information about
    # most variables to get MPD back into the same general shape it was in before
    # it was brought down. This setting is disabled by default and the server
    # state will be reset on server start up.
    state_file "/var/lib/mpd/mpdstate"
    # The location of the sticker database. This is a database which
    # manages dynamic information attached to songs.
    #sticker_file "~/.mpd/sticker.sql"
    # General music daemon options ################################################
    # This setting specifies the user that MPD will run as. MPD should never run as
    # root and you may use this setting to make MPD change its user ID after
    # initialization. This setting is disabled by default and MPD is run as the
    # current user.
    user "adriaan"
    # This setting specifies the group that MPD will run as. If not specified
    # primary group of user specified with "user" setting will be used (if set).
    # This is useful if MPD needs to be a member of group such as "audio" to
    # have permission to use sound card.
    group "users"
    # This setting sets the address for the daemon to listen on. Careful attention
    # should be paid if this is assigned to anything other then the default, any.
    # This setting can deny access to control of the daemon.
    # For network
    #bind_to_address "any"
    # And for Unix Socket
    #bind_to_address "~/.mpd/socket"
    # This setting is the TCP port that is desired for the daemon to get assigned
    # to.
    #port "6600"
    # This setting controls the type of information which is logged. Available
    # setting arguments are "default", "secure" or "verbose". The "verbose" setting
    # argument is recommended for troubleshooting, though can quickly stretch
    # available resources on limited hardware storage.
    #log_level "default"
    # If you have a problem with your MP3s ending abruptly it is recommended that
    # you set this argument to "no" to attempt to fix the problem. If this solves
    # the problem, it is highly recommended to fix the MP3 files with vbrfix
    # (available from <http://www.willwap.co.uk/Programs/vbrfix.php>), at which
    # point gapless MP3 playback can be enabled.
    #gapless_mp3_playback "yes"
    # This setting enables MPD to create playlists in a format usable by other
    # music players.
    #save_absolute_paths_in_playlists "no"
    # This setting defines a list of tag types that will be extracted during the
    # audio file discovery process. Optionally, 'comment' can be added to this
    # list.
    #metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
    # This setting enables automatic update of MPD's database when files in
    # music_directory are changed.
    auto_update "yes"
    # Limit the depth of the directories being watched, 0 means only watch
    # the music directory itself. There is no limit by default.
    #auto_update_depth "3"
    # Symbolic link behavior ######################################################
    # If this setting is set to "yes", MPD will discover audio files by following
    # symbolic links outside of the configured music_directory.
    #follow_outside_symlinks "yes"
    # If this setting is set to "yes", MPD will discover audio files by following
    # symbolic links inside of the configured music_directory.
    #follow_inside_symlinks "yes"
    # Zeroconf / Avahi Service Discovery ##########################################
    # If this setting is set to "yes", service information will be published with
    # Zeroconf / Avahi.
    #zeroconf_enabled "yes"
    # The argument to this setting will be the Zeroconf / Avahi unique name for
    # this MPD server on the network.
    #zeroconf_name "Music Player"
    # Permissions #################################################################
    # If this setting is set, MPD will require password authorization. The password
    # can setting can be specified multiple times for different password profiles.
    #password "password@read,add,control,admin"
    # This setting specifies the permissions a user has who has not yet logged in.
    #default_permissions "read,add,control,admin"
    # Input #######################################################################
    input {
    plugin "curl"
    # proxy "proxy.isp.com:8080"
    # proxy_user "user"
    # proxy_password "password"
    # Audio Output ################################################################
    # MPD supports various audio output types, as well as playing through multiple
    # audio outputs at the same time, through multiple audio_output settings
    # blocks. Setting this block is optional, though the server will only attempt
    # autodetection for one sound card.
    # See <http://mpd.wikia.com/wiki/Configuration#Audio_Outputs> for examples of
    # other audio outputs.
    # An example of an ALSA output:
    audio_output {
    type "alsa"
    name "My ALSA Device"
    device "hw:0,0" # optional
    # format "44100:16:2" # optional
    # mixer_type "hardware" # optional
    # mixer_device "default" # optional
    # mixer_control "PCM" # optional
    # mixer_index "0" # optional
    #audio_output {
    # type "alsa"
    # name "Sound Card"
    # options "dev=dmixer"
    # device "plug:dmix"
    # An example of an OSS output:
    #audio_output {
    # type "oss"
    # name "My OSS Device"
    ## device "/dev/dsp" # optional
    ## format "44100:16:2" # optional
    ## mixer_type "hardware" # optional
    ## mixer_device "/dev/mixer" # optional
    ## mixer_control "PCM" # optional
    # An example of a shout output (for streaming to Icecast):
    #audio_output {
    # type "shout"
    # encoding "ogg" # optional
    # name "My Shout Stream"
    # host "localhost"
    # port "8000"
    # mount "/mpd.ogg"
    # password "hackme"
    # quality "5.0"
    # bitrate "128"
    # format "44100:16:1"
    ## protocol "icecast2" # optional
    ## user "source" # optional
    ## description "My Stream Description" # optional
    ## genre "jazz" # optional
    ## public "no" # optional
    ## timeout "2" # optional
    ## mixer_type "software" # optional
    # An example of a recorder output:
    #audio_output {
    # type "recorder"
    # name "My recorder"
    # encoder "vorbis" # optional, vorbis or lame
    # path "/var/lib/mpd/recorder/mpd.ogg"
    ## quality "5.0" # do not define if bitrate is defined
    # bitrate "128" # do not define if quality is defined
    # format "44100:16:1"
    # An example of a httpd output (built-in HTTP streaming server):
    #audio_output {
    # type "httpd"
    # name "My HTTP Stream"
    # encoder "vorbis" # optional, vorbis or lame
    # port "8000"
    # bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
    ## quality "5.0" # do not define if bitrate is defined
    # bitrate "128" # do not define if quality is defined
    # format "44100:16:1"
    # max_clients "0" # optional 0=no limit
    # An example of a pulseaudio output (streaming to a remote pulseaudio server)
    #audio_output {
    # type "pulse"
    # name "My Pulse Output"
    ## server "remote_server" # optional
    ## sink "remote_server_sink" # optional
    ## Example "pipe" output:
    #audio_output {
    # type "pipe"
    # name "my pipe"
    # command "aplay -f cd 2>/dev/null"
    ## Or if you're want to use AudioCompress
    # command "AudioCompress -m | aplay -f cd 2>/dev/null"
    ## Or to send raw PCM stream through PCM:
    # command "nc example.org 8765"
    # format "44100:16:2"
    ## An example of a null output (for no audio output):
    #audio_output {
    # type "null"
    # name "My Null Output"
    # mixer_type "none" # optional
    # This setting will change all decoded audio to be converted to the specified
    # format before being passed to the audio outputs. By default, this setting is
    # disabled.
    #audio_output_format "44100:16:2"
    # If MPD has been compiled with libsamplerate support, this setting specifies
    # the sample rate converter to use. Possible values can be found in the
    # mpd.conf man page or the libsamplerate documentation. By default, this is
    # setting is disabled.
    #samplerate_converter "Fastest Sinc Interpolator"
    # Normalization automatic volume adjustments ##################################
    # This setting specifies the type of ReplayGain to use. This setting can have
    # the argument "off", "album" or "track". See <http://www.replaygain.org>
    # for more details. This setting is off by default.
    #replaygain "album"
    # This setting sets the pre-amp used for files that have ReplayGain tags. By
    # default this setting is disabled.
    #replaygain_preamp "0"
    # This setting enables on-the-fly normalization volume adjustment. This will
    # result in the volume of all playing audio to be adjusted so the output has
    # equal "loudness". This setting is disabled by default.
    #volume_normalization "no"
    # MPD Internal Buffering ######################################################
    # This setting adjusts the size of internal decoded audio buffering. Changing
    # this may have undesired effects. Don't change this if you don't know what you
    # are doing.
    #audio_buffer_size "2048"
    # This setting controls the percentage of the buffer which is filled before
    # beginning to play. Increasing this reduces the chance of audio file skipping,
    # at the cost of increased time prior to audio playback.
    #buffer_before_play "10%"
    # Resource Limitations ########################################################
    # These settings are various limitations to prevent MPD from using too many
    # resources. Generally, these settings should be minimized to prevent security
    # risks, depending on the operating resources.
    #connection_timeout "60"
    #max_connections "10"
    #max_playlist_length "16384"
    #max_command_list_size "2048"
    #max_output_buffer_size "8192"
    # Character Encoding ##########################################################
    # If file or directory names do not display correctly for your locale then you
    # may need to modify this setting.
    filesystem_charset "UTF-8"
    # This setting controls the encoding that ID3v1 tags should be converted from.
    #id3v1_encoding "ISO-8859-1"
    # SIDPlay decoder #############################################################
    # songlength_database:
    # Location of your songlengths file, as distributed with the HVSC.
    # The sidplay plugin checks this for matching MD5 fingerprints.
    # See http://www.c64.org/HVSC/DOCUMENTS/Songlengths.faq
    # default_songlength:
    # This is the default playing time in seconds for songs not in the
    # songlength database, or in case you're not using a database.
    # A value of 0 means play indefinitely.
    # filter:
    # Turns the SID filter emulation on or off.
    #decoder {
    # plugin "sidplay"
    # songlength_database "/media/C64Music/DOCUMENTS/Songlengths.txt"
    # default_songlength "120"
    # filter "true"

    milso wrote:
    type "alsa"
    name "equal"
    device "default"
    format "44100:16:2" # optional
    mixer_device "default" # optional
    mixer_control "PCM" # optional
    mixer_index "0" # optional
    I have mine set to plug:plugequal as I use an equalizer with alsa, but when I set it to default it works fine, try that.
    That didn't work out.
    Mr.Elendig wrote:Tell mpd to be more verbose. And check that mplayer -ao alsa whatever works.
    Here's the output of mpd -v
    listen: bind to '0.0.0.0:6600' failed: Address already in use (continuing anyway, because binding to '[::]:6600' succeeded)
    path: path_set_fs_charset: fs charset is: UTF-8
    database: reading DB
    disabling the last.fm playlist plugin because account is not configured
    daemon: opening pid file
    daemon: daemonized!
    daemon: writing pid file
    Doesn't contain anything unusual.
    EDIT: oh, and mplayer -ao alsa works fine.
    Last edited by arthd (2011-02-09 15:14:09)

  • How to solve the error problem

    Hi Devs ...
    I have been learning Adobe Flex and using IDE Flash Builder 4. but Im fasing an unsolve able problem in code given bellow..
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:mx="library://ns.adobe.com/flex/mx" layout="vertical" minWidth="955" minHeight="600">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <mx:states>
            <mx:State name="details">  /////////Here comes an error saying:-->State overrides may no longer be explicitly declared. The legacy states                                                                     /////syntax has been deprecated.
                <mx:AddChild position="lastChild">
                    <mx:Text text="About Picture" width="200" fontWeight="bold"/>
                </mx:AddChild>
                <mx:AddChild position="lastChild">
                    <mx:Text text="this is the picture of futue of Windows" width="200"/>
                </mx:AddChild>
            </mx:State>
        </mx:states>
        <mx:Image source="assets/att66298.jpg" rollOver="currentState='detail'"/>
    </mx:Application>
    please tell me how to slove this error problem.
    Arshay..

    <!-- incorrect --> 
    <root>
      < myxml label="something" >
    </root>
    <!-- correct -->
    <root>
      <myxml label="something">
    </myxml></root>

  • How to solve the " Unknown error" problem

    hi
     can anybody help me to solve " unknown error problem" of blackberry Z10 with "X" symbol at top right of the screen with red color.
    And remaining all services (Wifi) are working except the calls.
    And also my phone is automatically restarting frequently.
    please help me in this regard

    Phone restarting randomly could be loose battery. Tighten by putting a small strip of electrical tape on the back edge.
    THE BITTERNESS OF POOR QUALITY, LINGERS LONG AFTER THE CHEAPNESS OF PRICE, IS SOON FORGOTTEN.

  • I am not able to sync some videos and apps onto my iphone 3gs. it shows a sync error: 0xe8008001.i updated it but still i am getting the same sync error problem..please help.

    i am not able to sync some videos and apps onto my iphone 3gs. it shows a sync error: 0xe8008001.i updated it but still i am getting the same sync error problem..please help.
    aman

    Are you using Windows...?

  • Bex analyzer - internal error problem with table c_t_variable

    HI All,
         When ever I try to refresh a query in Bex-Analyzer ,Iam getting "internal error problem with table c_t_variable".
         Please advise
    Edited by: Aparna Duvvuri on Jan 13, 2010 10:53 AM

    Hi Aparna,
    try to open the query in RSRT and debug the query.the error is due to some  customer exit variable so try to debug the code for the variable and rectify it.
    Thanks,
    Ashok

  • Fox opens an error (Problem opening page) page when ever I open a new fox window and parks it in upper left corner of my desktop, what is up with this ??

    Fox opens an error (Problem opening page) page when ever I open a new fox window and parks it in upper left corner of my desktop, what is up with this ??
    It slows down my surfing, a lot and I do not notice the error page, until I notice the slow speed, because it is as small as a page can be, showing only the " -, +, & full size boxes with a border"

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Unable to send crash/error problem report

    Hi There,
    I have recently noticed that when a program I am running either force quits on it's own or I have to manually force quit the program, I am unable to send crash/error problem report to Apple. This has happened for all my programs from Safari and iTunes to recently Microsoft Word. The crashing messed up my internet as I had to give up using Firefox (because it kept crashing and wouldn't send a report) so I downloaded Chrome.
    Yesterday, Microsoft Word had to force quit because I manually quit the program but it never closed. It kept running in the background at 192% under my operating processes. When I force quit Word, it gave me the option to report the problem or ignore it. I chose to send a report but once that Problem Report screen loaded, it would not let me send to Apple, stating "Your submission could not be submitted. Please try again later."
    I have tried numerous times since all to no avail. As I mentioned, this happens on a lot of programs lately and I don't know what to do to fix it. Below are the specs of my Macbook. I can copy the problem details, but is lengthy.
    Any help/feedback is greatly appreciated.

    Welcome to Apple Support Communities.
    Apple is apparently no longer accepting crash reports for 'Leopard' OS X 10.5.8.
    https://discussions.apple.com/message/17544781#17544781
    Typical disk-maintenance activities when crashes occur include using Verify, and Repair Permissions on your hard drive (probably labeled Macintosh HD), using Disk Utility.
    10% to 15% of hard-drive capacity is generally acknowledged as the minimum amount of free space needed for adequate performance.

  • ClassCastException error when trying to cast to a subclass of JRootPane

    In connection with using key bindings for a JFrame, which I achieve by using key bindings for
    pane = jFrame.getRootPane(), I created a subclass ACJRootPane of JRootPane so that I can have my own processKeyBinding method which returns after a key has been pressed once.
    However when I try
    pane = (ACJRootPane)jFrame.getRootPane(),
    it compiles fine, but when I try to run it, I am getting a ClassCastException error. Well, my ACJRootPane class is exactly the same as the JRootPane class with the exeption of the processKeyBinding method.
    How can I use my subclass of JRootPane?
    Thanks for looking at this!

    This is how my JRootPane subclass looks:
    class ACJRootPane extends JRootPane
      //private static final long serialVersionUID = 2L; //release
      public ACJRootPane()
              super();
         protected boolean processKeyBinding(KeyStroke keyStroke, KeyEvent keyEvent, int int2, boolean boolean3)
              if (Basics.canvas.keyCommand == true)
                   return false;
              return super.processKeyBinding(keyStroke, keyEvent, int2, boolean3);
    }and roughly speaking keyCommand is set true in my actions for pressed keys (for which the onKeyRelease parameter in getKeyStroke in getInputMap is false) and set false in my actions for released keys (for which the onKeyRelease parameter in getKeyStroke in getInputMap is true).
    I would appreciate your help! Thanks!

  • ClassCastException error when casting OAWebBean to OAQueryBean

    I'm on OAF 11.5.10 2CU. I recevive ClassCastException error when the following statement is used:
    OAQueryBean queryBean = (OAQueryBean) webBean;
    Any idea?
    Thanks
    Muhammet

    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processFormRequest(oapagecontext, oawebbean);
    System.out.println("Here it will fail");
    OAQueryBean queryBean = (OAQueryBean) oawebbean.findIndexedChildRecursive("SrchRN");
    System.out.println("You cant see this message because of classcastexception error");

Maybe you are looking for