MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
shrutee
Post subject: Implementing LazyDataModel with Scaffolding for CRUD + JSF  PostPosted: Aug 23, 2012 - 12:58 PM



Joined: Aug 21, 2012
Posts: 4

Hi

I have Table in the database in which theer are more tahn 6K records.
After scaffolding for CRUD I implemented LazyDataModel.
Pasting all the files and error logs here.

Please help.
 
 View user's profile Send private message  
Reply with quote Back to top
support-swapna
Post subject:   PostPosted: Aug 24, 2012 - 06:32 AM



Joined: Nov 11, 2010
Posts: 2151

shrutee,

Sorry that you are seeing this issue.
I have escalated it to a dev team member. They will get back to you.

_________________
Swapna
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
shrutee
Post subject:   PostPosted: Aug 24, 2012 - 08:33 AM



Joined: Aug 21, 2012
Posts: 4

Thanks a lot Swapna.

Hope it will get resolved soon.
 
 View user's profile Send private message  
Reply with quote Back to top
cconway
Post subject:   PostPosted: Aug 27, 2012 - 11:58 AM



Joined: Apr 04, 2011
Posts: 196

Hi shrutee,

According to the error log, the system is unable to create the named query associated with com.test.dao.Dfp1CarClassDAOImpl.findAllDfp1CarClasss():

java.lang.NullPointerException
at org.skyway.spring.util.dao.AbstractJpaDao.createNamedQuery(AbstractJpaDao.java:214)
at org.skyway.spring.util.dao.AbstractJpaDao.createNamedQuery(AbstractJpaDao.java:205)
at com.test.dao.Dfp1CarClassDAOImpl.findAllDfp1CarClasss(Dfp1CarClassDAOImpl.java:247)
at com.test.datamodel.LazyCarList.fetchLazyData(LazyCarList.java:27)



The line in AbstractJPADao.java that is failing with a Null Pointer Exception is this:
Query query = getEntityManager().createNamedQuery(queryName);


Likely the EntityManager is null because you've tried calling the dao method from a bean that is not properly wired into spring. In your LazyCarList.fetchLazyData, you are constructing a DaoImpl. When you manually construct the DaoImpl it doesn't get the spring context and the entity manager is not autowired in.

Can you move your method into the existing scaffolded objects, maybe the scaffolded class annotated with @Component? Or, possibly try annotating the LazyCarList with @Component and then use autowiring for the dao? You should find examples in the scaffolded code of how a dao is autowired in and then called.

HTH

_________________
Cindy
MyEclipse for Spring Support
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits