Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, I am trying to learn Hibernate, I found this tutorial : http://www.netbeans.org/kb/61/web/hibernate-vwp.html I follwed all the steps, but at the end I got a table with a message : no items in the Page1.jsp I got a Null pointer exception : public void prerender() { try { if (dropDown1.getSelected() == null ) { // NullPointer Exception in this line : Option firstPerson = getSessionBean1().getPersonOptions()[0]; getSessionBean1(). setSelectedPersonId((Integer)firstPerson .getValue()); } } catch (Exception ex) { log("Error Description", ex); error(ex.getMessage()); } } Thanks, your help is appreciated. -- View this message in context: http://www.nabble.com/Hibernate-in-...3p17653113.html Sent from the Netbeans - J2EE mailing list archive at Nabble.com.
Post Follow-up to this messageHi, getPresonOptions must return null. Are you sure that you have added buildPersonOptions() to init() method and buildPersonOptions() correctly initialize personOptions ? Try to use debugger to find problem. > Hi, > > I am trying to learn Hibernate, I found this tutorial : > http://www.netbeans.org/kb/61/web/hibernate-vwp.html > > I follwed all the steps, but at the end I got a table with a message : no > items > > in the Page1.jsp I got a Null pointer exception : > > public void prerender() { > try { > if (dropDown1.getSelected() == null ) { > // NullPointer Exception in this line : > Option firstPerson = getSessionBean1().getPersonOptions()[0]; > > getSessionBean1(). setSelectedPersonId((Integer)firstPerson .getValue()); > } > } catch (Exception ex) { > log("Error Description", ex); > error(ex.getMessage()); > } > > } > > Thanks, your help is appreciated.
Post Follow-up to this messageHi Tomasz, Yes I have added buildPersonOptions() to init() method and buildPersonOptions() correctly initialize personOptions , I did exactly what in the tutorial I added bold code with cut and paste, I was trying to debug buildPersonOptions() method, but the jsp page start wthout going there. Note, I am using mysql database, I can see the connection in the database explorer, execute queries. Thanks Tomasz Zakrzewski wrote: > > Hi, > > getPresonOptions must return null. > Are you sure that you have added buildPersonOptions() to init() method > and buildPersonOptions() correctly initialize personOptions ? > > Try to use debugger to find problem. > > > > > > -- View this message in context: http://www.nabble.com/Hibernate-in-...3p17669505.html Sent from the Netbeans - J2EE mailing list archive at Nabble.com.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.