@Override public void configure() throws Exception { // [ENTESB-3281] Wildfly-Camel build fails on OpenJDK String vmname = System.getProperty("java.vm.name"); if (vmname.contains("OpenJDK")) return; // Configure our JaxbDataFormat to point at our 'model' package JaxbDataFormat jaxbDataFormat = new JaxbDataFormat(); jaxbDataFormat.setContextPath(Customer.class.getPackage().getName()); EntityManagerFactory entityManagerFactory = em.getEntityManagerFactory(); // Configure a JtaTransactionManager by looking up the JBoss transaction manager from JNDI JtaTransactionManager transactionManager = new JtaTransactionManager(); transactionManager.setUserTransaction(userTransaction); transactionManager.afterPropertiesSet(); // Configure the JPA endpoint to use the correct EntityManagerFactory and JtaTransactionManager JpaEndpoint jpaEndpoint = new JpaEndpoint(); jpaEndpoint.setCamelContext(getContext()); jpaEndpoint.setEntityType(Customer.class); jpaEndpoint.setEntityManagerFactory(entityManagerFactory); jpaEndpoint.setTransactionManager(transactionManager); /* * Simple route to consume customer record files from directory input/customers, * unmarshall XML file content to a Customer entity and then use the JPA endpoint * to persist the it to the 'ExampleDS' datasource (see standalone.camel.xml for datasource config). */ from("file://{{jboss.server.data.dir}}/customers") .unmarshal(jaxbDataFormat) .to(jpaEndpoint) .to("log:input?showAll=true"); }