camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Müller <christian.muel...@gmail.com>
Subject Re: JPA component throwing "Attempt to cast instance [Ljava.lang.Object"
Date Fri, 11 Jan 2013 22:37:06 GMT
Which version of Camel do you use?
Have a look at route policy and/or the quartz component for sheduling
routes.

Best,
Christian
Am 11.01.2013 20:23 schrieb "Chris Wolf" <cwolf.algo@gmail.com>:

> I have a JPA endpoint setup as a consumer, just performing a basic
> query.  If I have consumeDelete=false configured,
> then it works and I see the entities.  When consumeDelete=false is not
> configured (default is to remove), then the error
> occurs upon JpaTemplate calling  EntityManagerImpl.remove(arg) - but
> "arg" is of type Object[] - not the entity.
>
> Second issue is I'd like the route to just perform the query once.
> As it is, invokes the query in a loop.
>
> Thanks
>
> Chris
>
> P.S. the EntityManagerImpl.remove(arg) issue is not due to the
> entities not being enhanced - I verified that with javap.
>
> FailedObject: [Ljava.lang.Object;@1e3a0ec. Will commit all previous
> successful processed message, and ignore this last failure.
> javax.persistence.PersistenceException: <openjpa-2.2.0-r422266:1244990
> nonfatal user error> org.apache.openjpa.persistence.ArgumentException:
> Attempt to cast instance "[Ljava.lang.Object;@1e3a0ec" to
> PersistenceCapable failed.  Ensure that it has been enhanced.
> FailedObject: [Ljava.lang.Object;@1e3a0ec
>         at
> org.apache.camel.component.jpa.JpaConsumer$1.doInJpa(JpaConsumer.java:102)
>         at
> org.apache.camel.component.jpa.JpaTemplateTransactionStrategy$1$1.doInJpa(JpaTemplateTransactionStrategy.java:82)
>         at
> org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:183)
>         at
> org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:146)
>         at
> org.apache.camel.component.jpa.JpaTemplateTransactionStrategy$1.doInTransaction(JpaTemplateTransactionStrategy.java:80)
>         at
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
>         at
> org.apache.camel.component.jpa.JpaTemplateTransactionStrategy.execute(JpaTemplateTransactionStrategy.java:78)
>         at
> org.apache.camel.component.jpa.JpaConsumer.poll(JpaConsumer.java:75)
>         at
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:139)
>         at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:91)
>         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:180)
>         at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
>         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:662)
> Caused by: <openjpa-2.2.0-r422266:1244990 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: Attempt to cast
> instance "[Ljava.lang.Object;@1e3a0ec" to PersistenceCapable failed.
> Ensure that it has been enhanced.
> FailedObject: [Ljava.lang.Object;@1e3a0ec
>         at
> org.apache.openjpa.kernel.BrokerImpl.assertPersistenceCapable(BrokerImpl.java:4662)
>         at
> org.apache.openjpa.kernel.BrokerImpl.cascadeTransient(BrokerImpl.java:2681)
>         at
> org.apache.openjpa.kernel.BrokerImpl.delete(BrokerImpl.java:2769)
>         at
> org.apache.openjpa.kernel.BrokerImpl.delete(BrokerImpl.java:2740)
>         at
> org.apache.openjpa.kernel.DelegatingBroker.delete(DelegatingBroker.java:1102)
>         at
> org.apache.openjpa.persistence.EntityManagerImpl.remove(EntityManagerImpl.java:730)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         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:425)
>         at $Proxy12.remove(Unknown Source)
>         at
> org.apache.camel.component.jpa.JpaConsumer$3.deleteObject(JpaConsumer.java:337)
>         at
> org.apache.camel.component.jpa.JpaConsumer.processBatch(JpaConsumer.java:159)
>         at
> org.apache.camel.component.jpa.JpaConsumer$1.doInJpa(JpaConsumer.java:97)
>         ... 18 more
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message