Unfortunately I currently have limited access to the logs (I'm out of office) but I think we only get the following in the log:
WARN [org.apache.camel.component.jpa.JpaConsumer] (Camel (camelContext_myContext) thread #26 - jpa://dummy.MyEntity) Consumer Consumer[jpa://dummy.MyEntity?consumeDelete=false&delay=300000&query=select+x+from+dummy.MyEntity+x+where+x.myProperty+%3D+%27N%27] failed polling endpoint: jpa://?dummy.MyEntity?consumeDelete=false&delay=300000&query=select+x+from+dummy.MyEntity+x+where+x.myProperty+%3D+%27N%27. Will try again at next poll. Caused by: [javax.persistence.PersistenceException - javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: Null value was assigned to a property [class dummy.MyEntity.myOtherProperty] of primitive type setter of dummy.MyEntity.myOtherProperty]: javax.persistence.PersistenceException: javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: Null value was assigned to a property [class .dummy.MyEntity.myOtherValue] of primitive type setter of dummy.MyEntity.myOtherValue ... Caused by: javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: Null value was assigned to a property [class dummy.MyEntity.myOtherValue] of primitive type setter of dummy.MyEntity.myOtherValue ... Caused by: org.hibernate.PropertyAccessException: Null value was assigned to a property [class dummy.MyEntity.myOtherValue] of primitive type setter of dummy.MyEntity.myOtherValue ... Caused by: java.lang.IllegalArgumentException: Can not set int field dummy.MyEntity.myOtherValue to null value Regards, Calle ________________________________ Från: Claus Ibsen <claus.ib...@gmail.com> Skickat: onsdag 16 februari 2022 14:58 Till: users@camel.apache.org Ämne: Re: JPA consumer logging Hi Is it this WARN log you see? LOG.warn( "Error processing last message due: {}. Will commit all previous successful processed message, and ignore this last failure.", cause.getMessage(), cause); On Tue, Feb 15, 2022 at 3:28 PM Calle Andersson <calleanders...@hotmail.com> wrote: > > Hi, > > I recently discovered that the JPA consumer only logs WARN when failing to > populate an entity class (in my specific case, an exception occurred since an > unexpected null couldn’t be mapped to an int). > > If I understand it correctly, the JPA consumer uses a > LoggingExceptionHandler. Is there a simple way of configuring it to log > exceptions as ERROR instead of WARN as default? > > I use Camel 3.4 and my route is configured in a Java class which extends > EndpointRouteBuilder: > from(jpa(MyEntity.class.getName()) > .consumeDelete(false) > .query(QUERY) > .delay(300000)) > .transacted() > // … > > Some JPA component configuration is also made in jboss-camel-context.xml: > <bean id="jpa" class="org.apache.camel.component.jpa.JpaComponent"> > <property name="entityManagerFactory" ref="entityManagerFactory" /> > <property name="transactionManager" ref="txManager" /> > </bean> > > Regards, > Calle -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2