You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Charles Moulliard <cm...@gmail.com> on 2009/12/07 11:42:43 UTC
nested exception is
org.apache.openjpa.persistence.Entity NotFoundException
Hi,
I have a Apache Camel project where we use openJPA as an JPA component of
camel (http://camel.apache.org/jpa.html). Spring is used to facilitate db
connection, transaction handling and so on.
Unforunately, our code does not work anymore and generate the following
error. IT works fine when using Hibernate as JPA framework with Spring
[ Camel thread 1: FileComponent] GenericFileOnCompletion ERROR The
instance of type "class org.apache.camel.example.etl.CustomerEntity" with oi
d "org.apache.camel.example.etl.CustomerEntity-100" no longer exists in the
data store. This may mean that you deleted the instance in a separate tra
nsaction, but this context still has a cached version.; nested exception is
<openjpa-0.0.0-rnull nonfatal store error> org.apache.openjpa.persistence.
EntityNotFoundException: The instance of type "class
org.apache.camel.example.etl.CustomerEntity" with oid
"org.apache.camel.example.etl.CustomerEntit
y-100" no longer exists in the data store. This may mean that you deleted
the instance in a separate transaction, but this context still has a cached
version.
FailedObject:
org.apache.camel.example.etl.CustomerEntity-org.apache.camel.example.etl.CustomerEntity-100
org.springframework.orm.jpa.JpaObjectRetrievalFailureException: The instance
of type "class org.apache.camel.example.etl.CustomerEntity" with oid "org
.apache.camel.example.etl.CustomerEntity-100" no longer exists in the data
store. This may mean that you deleted the instance in a separate transacti
on, but this context still has a cached version.; nested exception is
<openjpa-0.0.0-rnull nonfatal store error>
org.apache.openjpa.persistence.Entity
NotFoundException: The instance of type "class
org.apache.camel.example.etl.CustomerEntity" with oid
"org.apache.camel.example.etl.CustomerEntity-100"
no longer exists in the data store. This may mean that you deleted the
instance in a separate transaction, but this context still has a cached
versi
on.
FailedObject:
org.apache.camel.example.etl.CustomerEntity-org.apache.camel.example.etl.CustomerEntity-100
at
org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:276)
at
org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
at
org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212)
at
org.springframework.orm.jpa.JpaAccessor.translateIfNecessary(JpaAccessor.java:152)
at
org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:189)
at
org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:147)
at
org.apache.camel.component.jpa.JpaTemplateTransactionStrategy$1.doInTransaction(JpaTemplateTransactionStrategy.java:79)
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
at
org.apache.camel.component.jpa.JpaTemplateTransactionStrategy.execute(JpaTemplateTransactionStrategy.java:77)
at
org.apache.camel.component.jpa.JpaProducer.process(JpaProducer.java:49)
at
org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:97)
at
org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:94)
at
org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:146)
at
org.apache.camel.processor.SendProcessor.doProcess(SendProcessor.java:94)
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:82)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)
at
org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:53)
at
org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:82)
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:162)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)
at
org.apache.camel.processor.RedeliveryErrorHandler.processExchange(RedeliveryErrorHandler.java:223)
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:153)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:91)
at
org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:49)
at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:206)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:74)
at
org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
at
org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)
at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:201)
at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:122)
at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:95)
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: <openjpa-0.0.0-rnull nonfatal store error>
org.apache.openjpa.persistence.EntityNotFoundException: The instance of type
"class org.apache.c
amel.example.etl.CustomerEntity" with oid
"org.apache.camel.example.etl.CustomerEntity-100" no longer exists in the
data store. This may mean that yo
u deleted the instance in a separate transaction, but this context still has
a cached version.
FailedObject:
org.apache.camel.example.etl.CustomerEntity-org.apache.camel.example.etl.CustomerEntity-100
at
org.apache.openjpa.kernel.StateManagerImpl.loadFields(StateManagerImpl.java:2923)
at
org.apache.openjpa.kernel.DetachedStateManager.attach(DetachedStateManager.java:150)
at
org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:241)
at
org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:101)
at org.apache.openjpa.kernel.BrokerImpl.attach(BrokerImpl.java:3212)
at
org.apache.openjpa.kernel.DelegatingBroker.attach(DelegatingBroker.java:1158)
at
org.apache.openjpa.persistence.EntityManagerImpl.merge(EntityManagerImpl.java:769)
at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.orm.jpa.JpaTemplate$CloseSuppressingInvocationHandler.invoke(JpaTemplate.java:404)
at $Proxy35.merge(Unknown Source)
at
org.apache.camel.component.jpa.JpaProducer$1.doInJpa(JpaProducer.java:54)
at
org.apache.camel.component.jpa.JpaTemplateTransactionStrategy$1$1.doInJpa(JpaTemplateTransactionStrategy.java:81)
at
org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:184)
... 37 more
Regards,
Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer
*****************************
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard
Apache Camel Group :
http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm
Re: nested exception is
org.apache.openjpa.persistence.Entity NotFoundException
Posted by Pinaki Poddar <pp...@apache.org>.
Hi,
As you are seeing the application work with another JPA implementation, I
assume that the instance of org.apache.camel.example.etl.CustomerEntity with
id 100 does really exist in database and not actaully deleted by another
transaction. Assuming that the actula record exists but OpenJPA somehow
fails to load it from database (yes, the stack trace shows that OpenJPA is
trying to load it from the database), one way to narriw down further is to
squeeze out the SQL issued by OpenJPA to find the instance before it failed.
Charles Moulliard wrote:
>
> Hi,
>
> I have a Apache Camel project where we use openJPA as an JPA component of
> camel (http://camel.apache.org/jpa.html). Spring is used to facilitate db
> connection, transaction handling and so on.
>
> Unforunately, our code does not work anymore and generate the following
> error. IT works fine when using Hibernate as JPA framework with Spring
>
> [ Camel thread 1: FileComponent] GenericFileOnCompletion ERROR The
> instance of type "class org.apache.camel.example.etl.CustomerEntity" with
> oi
> d "org.apache.camel.example.etl.CustomerEntity-100" no longer exists in
> the
> data store. This may mean that you deleted the instance in a separate tra
> nsaction, but this context still has a cached version.; nested exception
> is
> <openjpa-0.0.0-rnull nonfatal store error> org.apache.openjpa.persistence.
> EntityNotFoundException: The instance of type "class
> org.apache.camel.example.etl.CustomerEntity" with oid
> "org.apache.camel.example.etl.CustomerEntit
> y-100" no longer exists in the data store. This may mean that you deleted
> the instance in a separate transaction, but this context still has a
> cached
> version.
> FailedObject:
> org.apache.camel.example.etl.CustomerEntity-org.apache.camel.example.etl.CustomerEntity-100
> org.springframework.orm.jpa.JpaObjectRetrievalFailureException: The
> instance
> of type "class org.apache.camel.example.etl.CustomerEntity" with oid "org
> .apache.camel.example.etl.CustomerEntity-100" no longer exists in the data
> store. This may mean that you deleted the instance in a separate
> transacti
> on, but this context still has a cached version.; nested exception is
> <openjpa-0.0.0-rnull nonfatal store error>
> org.apache.openjpa.persistence.Entity
> NotFoundException: The instance of type "class
> org.apache.camel.example.etl.CustomerEntity" with oid
> "org.apache.camel.example.etl.CustomerEntity-100"
> no longer exists in the data store. This may mean that you deleted the
> instance in a separate transaction, but this context still has a cached
> versi
> on.
> FailedObject:
> org.apache.camel.example.etl.CustomerEntity-org.apache.camel.example.etl.CustomerEntity-100
> at
> org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:276)
> at
> org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
> at
> org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212)
> at
> org.springframework.orm.jpa.JpaAccessor.translateIfNecessary(JpaAccessor.java:152)
> at
> org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:189)
> at
> org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:147)
> at
> org.apache.camel.component.jpa.JpaTemplateTransactionStrategy$1.doInTransaction(JpaTemplateTransactionStrategy.java:79)
> at
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
> at
> org.apache.camel.component.jpa.JpaTemplateTransactionStrategy.execute(JpaTemplateTransactionStrategy.java:77)
> at
> org.apache.camel.component.jpa.JpaProducer.process(JpaProducer.java:49)
> at
> org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:97)
> at
> org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:94)
> at
> org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:146)
> at
> org.apache.camel.processor.SendProcessor.doProcess(SendProcessor.java:94)
> at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:82)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)
> at
> org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:53)
> at
> org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:82)
> at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:162)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.processExchange(RedeliveryErrorHandler.java:223)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:153)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:91)
> at
> org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:49)
> at
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:206)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:74)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
> at
> org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)
> at
> org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:201)
> at
> org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:122)
> at
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:95)
> at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
> at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
> at
> java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: <openjpa-0.0.0-rnull nonfatal store error>
> org.apache.openjpa.persistence.EntityNotFoundException: The instance of
> type
> "class org.apache.c
> amel.example.etl.CustomerEntity" with oid
> "org.apache.camel.example.etl.CustomerEntity-100" no longer exists in the
> data store. This may mean that yo
> u deleted the instance in a separate transaction, but this context still
> has
> a cached version.
> FailedObject:
> org.apache.camel.example.etl.CustomerEntity-org.apache.camel.example.etl.CustomerEntity-100
> at
> org.apache.openjpa.kernel.StateManagerImpl.loadFields(StateManagerImpl.java:2923)
> at
> org.apache.openjpa.kernel.DetachedStateManager.attach(DetachedStateManager.java:150)
> at
> org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:241)
> at
> org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:101)
> at
> org.apache.openjpa.kernel.BrokerImpl.attach(BrokerImpl.java:3212)
> at
> org.apache.openjpa.kernel.DelegatingBroker.attach(DelegatingBroker.java:1158)
> at
> org.apache.openjpa.persistence.EntityManagerImpl.merge(EntityManagerImpl.java:769)
> at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.springframework.orm.jpa.JpaTemplate$CloseSuppressingInvocationHandler.invoke(JpaTemplate.java:404)
> at $Proxy35.merge(Unknown Source)
> at
> org.apache.camel.component.jpa.JpaProducer$1.doInJpa(JpaProducer.java:54)
> at
> org.apache.camel.component.jpa.JpaTemplateTransactionStrategy$1$1.doInJpa(JpaTemplateTransactionStrategy.java:81)
> at
> org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:184)
> ... 37 more
>
> Regards,
>
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
>
> *****************************
> blog : http://cmoulliard.blogspot.com
> twitter : http://twitter.com/cmoulliard
> Linkedlin : http://www.linkedin.com/in/charlesmoulliard
>
> Apache Camel Group :
> http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm
>
>
-----
Pinaki
--
View this message in context: http://n2.nabble.com/nested-exception-is-openjpa-0-0-0-rnull-nonfatal-store-error-org-apache-openjpa-persistence-Entity-Nn-tp4125308p4143569.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.