The ArrayList of Beans That I Created Is A Null

I have a bean. The bean has only one property. I populate the bean from fetching data from the database. Because more than one record should be picked up from the database (the data table is created by me, there should be a number of records to be picked up), I add bean(s) to an ArrayList. Unfortunately, the computer tells me that this ArrayList is a null.
Let me go step by step:
1. in my action class:
String userrole = "editor";
String category = "literature";
EditorService service = new EditorService();
Collection editors = service.getEditors( userrole, category );2. in my business logic class EditorService, I have:
   EditorDAO ed = new MySQLEditorDAO();
   public Collection getEditors( String userrole,
String category )
      return ed.findEditors( userrole, category );
   }3. in my data access class, I have:
public class MySQLEditorDAO implements EditorDAO
   public Collection findEditors( String userrole,
String category )
       throws EditorDAOSysException
      EditorBean editorBean;
      ArrayList editors = new ArrayList();
      try
         conn = DBConnection.getDBConnection();
         stmt = conn.createStatement();
         String query = "SELECT user_name FROM members
WHERE user_role = '" + userrole + "' AND
journal_category = '" + category + "'";  
         rs = stmt.executeQuery( query );
      while( rs.next() )
         editorBean = new EditorBean(
rs.getString("user_name") );
         editors.add( editorBean );
         return editors;
}4. my EditorBean is:
public class EditorBean
   private String name;
   public EditorBean() {}
   public EditorBean( String name )
      setName( name );
   public String getName() {
      return name;
   public void setName( String name ) {
      this.name = name;
}

The code you have here looks fine.
Given that you have initialised the return value with new ArrayList(), it should never be null - maybe empty, but never null.
I can't see any exception handling code, so I don't know what you are doing if an exception occurs - ignoring it? throwing a different exception? Are there any other return statements from the DAO method?
Where exactly do you get the error message ArrayList is null?

Similar Messages

  • I forgot the password in restrictions that I created so my daughter couldnt use the in app features.  Now she wants a video and I can't buy it:(  Is there anyway to reset that password or find out what it was?

    I forgot the password in restrictions that I created so my daughter coundlt buy any in-app purchases.  Now we can't buy any videos until I alter that restriction.  Is there anyway to reset that or findout what the password was?

    Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device
    1. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    3. iOS- Understanding passcodes
    4. What to Do If You've Forgotten Your iPhone's Passcode
    5. How to Recover Forgotten iPhone Restrictions Passcode | The iPhone and iPad
    6. Restoring iPod touch after forgotten passcode
    7. RecBoot: Easy Way to Put iPhone into Recovery Mode - if all else fails.
    Forgotten Restrictions Passcode Help
    1. How to Recover Forgotten iPhone, iPad Restrictions Passcode
        If this method does not work, then you will need to fully Restore your
        device as New

  • What are the .fm.sp files that are created when using SharePoint?

    What are the .fm.sp files that are created when using SharePoint? When I'm working with SharePoint, I've noticed that duplicate files ending in .fm.sp are created. I've been unable to find any reference or documentation about them so far.

    Whe you use sharepoint as a CMS connections in Framemaker it creates the folder where Sp is installed and also a file ending .sp is created that let SP know that its the file associated with it.
    .fm.sp indicates that its the framemaker type SP file.
    Dont worry about it as its not creating any mess in the system.
    Harpreet

  • Can't get a handle to the text input bean I just created

    I create text input bean this way
    OAMessageTextInputBean bigBean = (OAMessageTextInputBean) pageContext.getWebBeanFactory().createWebBean(pageContext,OAWebBeanConstants.MESSAGE_TEXT_INPUT_BEAN,"BIGBEAN");
    and right after this I do
    OAMessageTextInputBean bigBeanJustCreated = (OAMessageTextInputBean) webBean.findIndexedChildRecursive("BIGBEAN");
    It is not found!
    What am I missing?
    Thanks,
    Anatoliy

    Sumit,
    Thank you very much for quick response.
    Your suggestion did work.
    Could you please clarify something for me - while working on the problem I realized that I can add text input bean to either PageLayoutBean or message Component bean? Is this correct?
    And one more query if you please - how can I get all the beans(text input beans) under a parent messageComponentbean?
    Should I say something like
    For example, in previous example the beans that I am creating are under messageComponent bean
    OAMessageComponentLayoutBean componentBean = (OAMessageComponentLayoutBean) webBean.findIndexedChildRecursive("MainRN");
    Enumeration e = pageContext.getWebBeanValueNames(componentBean);...
    Thank you.
    Anatoliy

  • What is the av-1 file that is created when I make Quicktime Movies from FCP

    I have just experienced the -av1 phenomena for the first time.
    I have been exporting to QT movies regularly using the same internal and external drives for months - no changes, no incorrect formatting. I have used those exported movies to create One-Step DVDs in iDVD for display and distribution. This -av1 file thing is keeping me from doing that.
    The only diff with this project (and, in fact, it's a new Sequence in a Project that has successfully been exported (without the companion file)) is that this sequence had .aiff music files some of which were from iTunes (downloaded/protected).
    I thought that might be the problem, so I created mp3s (by burning to disk and re-importing) and replaced the aiff's in the timeline - it still insisted on creating -av1 files with the QT Movie.
    Help would be appreciated.
    Thanks.

    It means that the drive that you are saving these to is formatted FAT32 and has a file size limit of 2GB. Check the file sizes and see.
    If the drive was formatted MacOS Extended you won't see this issue.
    Shane

  • I just upgraded to the new Photo and find a few things missing. May find more later. My Events are gone. Also, the Albums and Projects that I created that were on the left side tab of iPhoto are now gone. Where are they?

    Where are my Events from the old iPhoto? Also, where are the albums and projects I created that were on the left side tab in my old iPhoto?

    Hersco wrote:
    After importing my iPhoto Library no Events became Albums. Some of my Albums are still Albums, but many are missing from the Albums tab and Sidebar. One of the Albums listed has no photos when it should have 142. Another is missing nearly all of its photos. I found some missing Albums by name via the search window. Yet they remain missing from the Albums tab. Very strange indeed. This is one big mess right now! Thank goodness iPhoto still works.
    Yes, it's a mess for sure, and I've lost confidence in it for now.  First attempt, 5 photos came up missing.  Delete and start over, then after second attempt 18 photos go missing.  Even one single missing photo is a real confidence breaker for me.
    After conversion, and activation of the sidebar, all of my Events were migrated into a single "Photos" Album called "iPhoto Events".  Why would I want "legacy" Events segregated into one big Album?  What the heck am I supposed to do with that?  That's useless if new photos are going to be organized in some other way moving forward.  I cannot imagine new photos automatically putting themselves into a new Event inside of the "iPhoto Events" Album... because they won't.  I'll be stuck with my old iPhoto Events in this one Album, and the new stuff organized as per Photos.  Weird, just weird.
    Also, in the "all photos" view, there are dates that are just blank.  I think I know why.  In iPhoto, I merged various photos into single Events.  For whatever reason, within the Library, this left empty folders behind.  iPhoto's fault, not mine... I simply dragged & dropped photos to combine Events.   Then during Photos import/conversion these empty folders got converted into "blank" days within Photos... this is simply ridiculous.  When programming for an import, you'd want to ignore a folder if there are no files inside of it, not convert it into a block of photos that contain no photos.  It's nonsensical... you cannot have an iPhoto Event with zero photos, yet that's what was converted over.  LOL.
    I'm certainly not going to invest the time into cleaning up and moving hundreds of Events and 18,000 photos if Photos can't even do a simple library conversion.  Heck, what about the dozens of photos that my iPhone 5S fails to geotag for whatever reason?  Can't edit geotags.  Can't bulk edit meta data.  These are pretty basic functions.  Total fail.
    I'm going back to iPhoto for a while, hoping Apple eventually cleans up this mess into something usable.

  • Limiting the number of threads that are created

    I am trying to write a web crawler as a way of learning about multi-threading and I have hit a stumbling block (probably my design). The way the application I have started works is that I provide a single URL, which is passed to a thread and that thread then parses the web page building a list of links (If the links are not already held in a 'visited' list then they are saved in a list in the Runnable object that is parsing the html page).
    When the page has been parsed the list of links are then passed to a method in a Utilities class that creates a new group of threads, 1 for each link and each of these threads then does the same thing. The problem I have is that as more and more links are captured more and more threads are created eventually I either get a out of memory exception or I get an operating system 'cannot create native thread' message. I am not sure if the threads are staying in memory after they have done their tasks, I am not sure why I am running out of memory so quickly.
    What I would like to try and do is to set a limit for the maximum number of threads created and then only create new threads if the limit is not breached. If someone could point me in the right direction that would be good, I have googled around but cant find an example of what I want to do.
    Thanks

    Thanks for that, that has given me a lot to read up on and I can already see where I went wrong.... I think implementing a thread pool and also a work queue is probably the way I will go from now on.

  • When using Panorama, everytime I create a New Group, I am redirected to the Google Calendar App that I created. Tab groups are not being remembered. Any workaround?

    I am trying to use Panorama for the first time. I can successfully create a tab group, but Firefox does not remember it. When I view a new web page and try to use "add to group" I am redirected to the app tab I created for Google Calendar. I am using Windows 7 64x with Firefox as my default browser.
    Are there any know issues with the apps tap and Panorama?

    I have a somewhat related problem running FF7 on WinXP32, specifically concerning your ''I can successfully create a tab group, but Firefox does not remember it.''
    When I reopen FF, I find FF
    * ''sometimes'' does not remember all tab groups.
    * ''often'' seems to move at least 1 tab from one group to another.
    ''kursiver Text''
    I am new to using this tab grouping feature, and I have not identified a specific and consistent misbehavior yet.

  • Is there a function to send window id's to TS to use for placement of the standard panels/windows that are created during normal TS operation?

    I have asked this question previously in a different manner and have not received any useful hints. I want to manage the placement of all of the standard TS windows/panels during normal operation of TS.
    Thanks in advance,
    Paul

    Paul,
    I am assuming that you are talking about the File Dialog when you select "Open Sequence File..." from the menu.  The code for the dialog is encapsulated as a command in the Operator Interface.  If you look in the TestStand help, under Command Kinds, you can see all the coded commands that will cause the OI to respond.  The CommandKind_OpenSequenceFile command is what causes the File Dialog to popup.  When the user selects the proper file and chooses to Open the dialog, the OpenSequenceFile command triggers a DisplaySequenceFile event.  This event is handled by the Application Manager with a callback function (or VI if you are using LabVIEW).  The SequenceFile gets updated in the SequenceFileView manager.  Unfortunately, much of this code is handled internally by the Operator Interface manager controls.  The File Dialog is simply a function that gets called, and the Window handle is never really accessed by the OI developer.
    You may have a few options, however.  There may be a Windows kernel function, that accesses child Window handles.  I would search MSDN for any functions that will help access Window handles.
    The other option is to implement the File Open dialog yourself.  I believe, the File Chooser is a standard dialog popup, that you can call from most programming languages that are accessing Windows functionality.  However, you should trigger the DisplaySequenceFile event after the user selects a file.  This will cause the SequenceFileView manager to be udpated with the proper sequence file.
    I have not tried either of these implementations.
    If you have any questions, please let me know.
    Thanks,
    Tyler T.
    NI

  • "Read items that were created by the user" and inconsistent permissions

    Hi!
    I have enabled the option "Read items that were created by the user" and "Create items and edit items that were created by the user" in the advanced settings of a list. Indeed when a user creates an item in that list, that item is visible
    only by that account and other accounts cannot see it.
    However when the user opens the "Shared With" dialog he/she sees all users there, giving him/her the impression that the item is visible to everyone! Why is that? This is very confusing since this "Shared With" feature is the only way
    for a user to tell who can see an item.

    Let it make it more clear. User A creates Item 1. Users B creates Item 2. When User A sees the contents of the list he sees Item 1 only. When User B sees the contents of the list he sees Item 2 only. As expected.
    The problem is that if User A selects Item 1 and then clicks on 'Shared With' button on the ribbon, he will get pop up that indicates that the Item 1 is Shared with User B. Which is not true since User B cannot see the item. So User A wrongly assumes
    that Item 1 is Shared with User B!
    Dimitris Papadimitriou, Software Development Professional

  • BI Bean that displays the data in tabular layout (multi-row)

    Hi,
    I know there isn't a graphic type in BI Beans that can display data in multi-row tabular layout as one graphic object. Oracle Forms can actually display this layout but they want to display everything in one page without scrollbars (without the need to scroll for the other records that isn't displayed yet in the screen). Is this at all possible in Oracle Forms using BI Beans? Are there other possible approaches aside from BI Beans?
    Thanks in advance.
    Anthony
    Philippines

    Hello Vikas,
    >> How does one go about troubleshooting & fixing this sort of thing?
    By given us a bit more information :)
    • Is it a manual Tabular Form (using the ITEM API) or a wizard created one?
    • Are the Insert/Update operations work correctly? If not, what is the type of your PK column(s)?
    • If the problem is limited to the Delete operation, maybe the problem lies with the checkbox column. Are you sure that on page it is rendered as the f01 column?
    • As triggers are involved, can you save the PK that the trigger sees? Is it the expected value?
    • Are there any other processes that are fired before the DML process? If so, maybe the problem is with them. You can temporarily disable them and see if it change anything.
    >> Tabular forms are the most frustrating, opaque component in Apex, wish they were easier to troubleshoot
    Yes, I agree. However, I believe that 4.1 made some serious advancement where Tabular Form is concerned. Having simplified Tabular Form related Validations and Process should make things easier, and as a result, prone to less errors. Still, the main problem is that the type of error you are talking about is usually the result of metadata problems and these are indeed very hard to track.
    Regards,
    Arie.
    ♦ Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    ♦ Author of Oracle Application Express 3.2 – The Essentials and More

  • Is it possible to create a bean that will generate (fill up) applet paramet

    Hi all,
    As a newbie I was asking myself is it possible to create a bean that will fill up applet parameter or directly generate the applet ??
    And I can I create it ?
    I mean : Having a jsp page that make reference to the bean, the bean shall generatehtml applet parameter values.
    Some samples will be welcome or a template.
    Thanks in advance
    Shamann

    Thanks a lot for your reply siv viv,
    I've posted this thread because I'm a little bit disappointed with Applet and jsp according to lot of thread about this subject (it seems that communication between applet and jsp is not easy : bug reported).
    The basic thing i want to do is to create a dynamic Pie Chart as applet or bean so i need to set applet parameter thanks to variables.
    See the http://forums.java.sun.com/thread.jsp?forum=45&thread=80250 this one is putting me in the dark.
    regards
    Shamann

  • HT5858 I can't update apps on my iphone 5. theirs an old apple ID. That I don't have the pass word. I've created a new apple ID. but the old one keeps popping up. I have it on the Itunes on the phone but the old one keeps comming up and asking for a pass

    I can't update apps on my iphone 5. theirs an old apple ID. That I don't have the pass word. I've created a new apple ID. but the old one keeps popping up. I have it on the Itunes on the phone but the old one keeps comming up and asking for a pass word. 

    Apps are permanently tied to the Apple ID used to purchase them. You will have to delete the apps from the phone and re-purchase them using your Apple ID.

  • I have an ipad mini. From one moment to another a document that was created and used on pages app ( on the ipad mini) does not want to open ( When pressed it states " document cant be opened). How can I make this document open again?

    I have an ipad mini. From one moment to another a document that was created and used on pages app ( on the ipad mini) does not want to open ( When pressed it states " document cant be opened). How can I make this document open again?
    I have tried back ups and  restoring, resetting, and even updating the pages app. And nothing has worked.

    I have an ipad mini. From one moment to another a document that was created and used on pages app ( on the ipad mini) does not want to open ( When pressed it states " document cant be opened). How can I make this document open again?
    I have tried back ups and  restoring, resetting, and even updating the pages app. And nothing has worked.

  • After installing an application that was created using the Application Builder

    After installing an application that I created using the Application Builder I get this error if I try to run " ANY " LabVIEW App's that I have built. "Executable Version 7.1.1 doesn't match Resource File 7.1. Check your configuration."
    The way that I tried to fix this is to reload LabVIEW 7.1 and DAQmx 8.0. I am using two NI-6528 switch cards.
    After I reload LabVIEW and DAQmx I can run my applications but as soon as I install one on this development machine the error begins again.
    The executable that I built works fine on the development machine and any other machine that I try it on but it appears that the Run-Time engine 7.1 becomes corrupt after I run setup.exe for the newly created application.
    I have built numerous Installers, setup.exe's in the past without this error. Just this latest one caused this problem to start.
    I can NOT upgrade to 7.1.1. I am doing work for many different sections of this factory and I can not force them to upgrade. I've asked. Others supply code for the same machines using LabVIEW 7.1.
    I am stuck creating executables and manualing moving the correct files to the target machines.
    What can be done?

    No. The KB article was talking about a machine with 7.1.1 installed. I have LabVIEW 7.1 installed.
    The machine that I am having trouble with is my development machine. LabVIEW 7.1, DAQmx 8.0.
    If I build the executable all is fine. I can still run old executables including the one I just built.
    If I create the installer all is fine. I can still run old executables including the one I just built.
    When I install the app on my development machine the corruption occurs. I can " NOT " run old executables including the one I just built. The subject error pops up.
    I have not moved any executables to the other machines yet. I don't want to corrupt others.

Maybe you are looking for