Oh, one more thing, in Chapter 6, the ArrayList variable that is returned in
getOutOfStockItems needs to be initialized, or else you get a NullPointer Exception:
| /**
| * @ejb.interface-method
| * view-type="remote"
| **/
| public java.util.ArrayList getOutOfStockItems() {
| System.out.println(" Entering StoreAccessBean.getOutOfStockItems() ");
|
| Collection items = null;
| ArrayList itemsOutOfStock = new ArrayList();
|
| try {
| items = itemLocalHome.findByOutOfStock();
| Iterator iterate = items.iterator();
| while (iterate.hasNext()) {
| try {
| ItemLocal myItemLocal = (ItemLocal) iterate.next();
| ItemData myTmpData = myItemLocal.getItemData();
| itemsOutOfStock.add(myTmpData);
| } catch (RuntimeException e1) {
| // TODO Auto-generated catch block
| e1.printStackTrace();
| }
| }
|
| } catch (Exception e) {
| System.out.println(
| " Error in StoreAccessBean.getOutOfStockItems() " + e);
| }
| System.out.println(" Leaving StoreAccesBean.getOutOfStockItems() ");
|
| return itemsOutOfStock;
| }
|
|
<a
href="http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3827018#3827018">View
the original post</a>
<a
href="http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3827018>Reply
to the post</a>
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user