File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Error : No row with the given identifier exists Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Error : No row with the given identifier exists" Watch "Error : No row with the given identifier exists" New topic
Author

Error : No row with the given identifier exists

Abdul Kader
Ranch Hand

Joined: Apr 11, 2007
Posts: 115
Hi I am getting the following exception in hibernate when I am loading the application in the test server. However I am not getting any exception in my development server. Can you please update if you know the solution or the root cause.


com.xyz.sspglobal.admin.dao.AdminDaoException: No row with the given identifier exists: 307, of class: com.xyz.sspglobal.admin.models.BusinessInfo; nested exception is net.sf.hibernate.UnresolvableObjectException: No row with the given identifier exists: 307, of class: com.xyz.sspglobal.admin.models.BusinessInfo: org.springframework.orm.hibernate.HibernateObjectRetrievalFailureException: No row with the given identifier exists: 307, of class: com.xyz.sspglobal.admin.models.BusinessInfo; nested exception is net.sf.hibernate.UnresolvableObjectException: No row with the given identifier exists: 307, of class: com.xyz.sspglobal.admin.models.BusinessInfo
at com.xyz.sspglobal.admin.dao.HbBusinessDao.loadSB(HbBusinessDao.java:25)
at com.xyz.sspglobal.admin.AdminBusinessManagerImpl.reload(AdminBusinessManagerImpl.java:49)
at com.xyz.sspglobal.admin.AdminBusinessManagerImpl.init(AdminBusinessManagerImpl.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:996)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:966)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:354)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:312)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:82)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:67)
at com.xyz.reuse.spring.util.BeanRetrieveUtil.retrieveContext(BeanRetrieveUtil.java:40)
at com.xyz.reuse.spring.SpringSupportManager.init(SpringSupportManager.java:42)
at com.xyz.reuse.framework.AppModuleLoader.initModule(AppModuleLoader.java:69)
at com.xyz.reuse.framework.AppModuleLoader.init(AppModuleLoader.java:49)
at com.xyz.reuse.framework.WebApp2.loadAppModules(WebApp2.java:110)
at com.xyz.reuse.framework.WebApp2.init(WebApp2.java:68)
at com.xyz.reuse.framework.WebServlet$WebAppInitializer.run(WebServlet.java:102)
at java.lang.Thread.run(Thread.java:568)

[ July 03, 2007: Message edited by: Yousuff Mohammed ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

No row with the given identifier exists: 307, of class: com.xyz.sspglobal.admin.models.BusinessInfo;

Looks like you are trying to populate an object called BusinessInfo with the ID of 307 that doesn't exist in the database.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Charan kumar sarvepalli
Ranch Hand

Joined: Dec 14, 2008
Posts: 40
Hi,

I am also getting same exception that is seems to be happening because of ehcache.

The id which it is showing was changed object and updated,
it does not exists no more in data base. But it trying to load those objects (i think those objects are may be resided in cache).



-- Charan
Charan kumar sarvepalli
Ranch Hand

Joined: Dec 14, 2008
Posts: 40
not-found = "ignore" is added to <one-to-many> element to avoid the exception then works fine.
John Landon
Ranch Hand

Joined: Sep 25, 2008
Posts: 227
Charan kumar sarvepalli wrote:not-found = "ignore" is added to <one-to-many> element to avoid the exception then works fine.


I am having same exception but not-found = "ignore" does not compile.
Anyone can explain this exception?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error : No row with the given identifier exists