-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: javax.persistence.EntityNotFoundException: Unable to find...
PostPosted: Tue Jan 27, 2009 1:46 pm 
Newbie

Joined: Mon Jan 26, 2009 3:25 pm
Posts: 10
When I do a search to use criteria, this happens exception.
The Code of the criteria is this:
PersistenceFacade.getSession Session session = ();
List result = session.createCriteria (ConvenioTlfHistorico.class)
. SetMaxResults (10)
. List ();
System.out.println (result.size ());

It turns out that this error should not be because I put the annotation @NotFound (action = NotFoundAction.IGNORE)

What is happening?

Hibernate version:
3
Mapping documents:

@NotFound(action=NotFoundAction.IGNORE)
@ManyToOne
@JoinColumns(
@JoinColumn(name="EMPRESA",referencedColumnName="EMPRESA", insertable=false, updatable=false)
)
private Empresa empresa;

Full stack trace of any exception that occurs:

15:39:26,838 ERROR [STDERR] javax.persistence.EntityNotFoundException: Unable to find br.com.cabal.entity.convenio.Empresa with id 0
15:39:26,838 ERROR [STDERR] at org.hibernate.ejb.Ejb3Configuration$Ejb3EntityNotFoundDelegate.handleEntityNotFound(Ejb3Configuration.java:107)
15:39:26,838 ERROR [STDERR] at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:145)
15:39:26,838 ERROR [STDERR] at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:195)
15:39:26,838 ERROR [STDERR] at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)
15:39:26,838 ERROR [STDERR] at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
15:39:26,838 ERROR [STDERR] at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846)
15:39:26,838 ERROR [STDERR] at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:557)
15:39:26,838 ERROR [STDERR] at org.hibernate.type.EntityType.resolve(EntityType.java:379)
15:39:26,838 ERROR [STDERR] at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:116)
15:39:26,838 ERROR [STDERR] at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854)
15:39:26,838 ERROR [STDERR] at org.hibernate.loader.Loader.doQuery(Loader.java:729)
15:39:26,838 ERROR [STDERR] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
15:39:26,838 ERROR [STDERR] at org.hibernate.loader.Loader.doList(Loader.java:2220)
15:39:26,838 ERROR [STDERR] at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
15:39:26,838 ERROR [STDERR] at org.hibernate.loader.Loader.list(Loader.java:2099)
15:39:26,838 ERROR [STDERR] at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
15:39:26,838 ERROR [STDERR] at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
15:39:26,838 ERROR [STDERR] at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
15:39:26,838 ERROR [STDERR] at br.com.cabal.persistence.TestePersistenceBean.teste(TestePersistenceBean.java:67)
15:39:26,838 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
15:39:26,838 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
15:39:26,838 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
15:39:26,838 ERROR [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
15:39:26,838 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
15:39:26,838 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
15:39:26,838 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
15:39:26,838 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
15:39:26,838 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
15:39:26,838 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
15:39:26,838 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
15:39:26,838 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
15:39:26,838 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
15:39:26,838 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
15:39:26,838 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
15:39:26,838 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
15:39:26,838 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
15:39:26,838 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
15:39:26,838 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
15:39:26,838 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
15:39:26,838 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
15:39:26,838 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
15:39:26,838 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
15:39:26,838 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
15:39:26,838 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
15:39:26,838 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
15:39:26,838 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)
15:39:26,838 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
15:39:26,838 ERROR [STDERR] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
15:39:26,838 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:809)
15:39:26,838 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:608)
15:39:26,838 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:406)
15:39:26,838 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:173)


Name and version of the database you are using:
Oracle


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 7:49 am 
Newbie

Joined: Mon Jan 26, 2009 3:25 pm
Posts: 10
Anybody?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.