}
public JAXBContext getJaxbContext() {
if ( this.jaxbContext == null ) {
JaxbDataFormat def = new JaxbDataFormat();
def.setPrettyPrint( true );
// TODO does not work: def.setContextPath( "org.drools.camel.testdomain:org.drools.pipeline.camel" );
def.setContextPath( "org.drools.model:org.kie.pipeline.camel" );
// def.setContextPath( "org.kie.pipeline.camel" );
// create a jaxbContext for the test to use outside of Camel.
KieSession ksession1 = null;
try {
ksession1 = (KieSession) jndiContext.lookup("ksession1");
} catch (NamingException e) {
throw new RuntimeException(e);
}
KieBase kbase = ksession1.getKieBase();
ClassLoader originalCl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader( ((KnowledgeBaseImpl) kbase).getRootClassLoader() );
routeBuilder.getContext().setApplicationContextClassLoader( ((KnowledgeBaseImpl) kbase).getRootClassLoader() );
def = KiePolicy.augmentJaxbDataFormatDefinition( def );
org.apache.camel.converter.jaxb.JaxbDataFormat jaxbDataformat = (org.apache.camel.converter.jaxb.JaxbDataFormat) def.getDataFormat( this.context.getRoutes().get( 0 ).getRouteContext() );
jaxbDataformat.setCamelContext(routeBuilder.getContext());
try {
jaxbDataformat.start();
} catch (Exception e) {