Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Hibernate in Netbeans 6.1 , tutorial, does not work
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.



Report this thread to moderator Post Follow-up to this message
Old Post
mlotfi
06-05-08 12:51 AM


Re: Hibernate in Netbeans 6.1 , tutorial, does not work
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.



> 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.



Report this thread to moderator Post Follow-up to this message
Old Post
Tomasz Zakrzewski
06-05-08 10:25 AM


Re: Hibernate in Netbeans 6.1 , tutorial, does not work
Hi 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.



Report this thread to moderator Post Follow-up to this message
Old Post
mlotfi
06-05-08 01:37 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Netbeans J2EE archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:54 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.