apache camel - why CAMEL_MESSAGEPROCESSED created in SQL server db -
i want run camel built application stanalone. using maven create standalone jar , execute route.when run mainapp.java main method eclipse or run using camel run code runs expected. when run using java -jar 3 tables camel_messageprocessed, camel_messagetraced,hibernate_sequence created db. not want these tables created. please me find doing wrong.
camel, camel-jpa version 2.19.1 hibernate-entitymanager version 5.2.7.final
camel-context.xml
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:prop="http://camel.apache.org/schema/placeholder" xmlns:camel="http://camel.apache.org/schema/spring" xsi:schemalocation="http://www.springframework.org/schema/beans classpath:org/springframework/beans/factory/xml/spring-beans-4.3.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <bean id="properties" class="org.apache.camel.component.properti es.propertiescomponent"> <property name="location" value="classpath:db.properties" /> </bean> <bean id="bridgepropertyplaceholder" class="org.apache.camel.spring.spi.bridgepropertyplaceholderconfigurer"> <property name="location" value="classpath:db.properties" /> </bean> <camelcontext id="camel5" xmlns="http://camel.apache.org/schema/spring"> <routebuilder ref="mybuilder" /> </camelcontext> <bean id="mybuilder" class="com.aexp.gsnt.insight.updatecentraldata.insightrouterbuilder" /> <bean id="jpa" class="org.apache.camel.component.jpa.jpacomponent"> <property name="entitymanagerfactory" ref="entitymanagerfactory" /> <property name="transactionmanager" ref="jpatxmanager" /> </bean> <bean id="jpatxmanager" class="org.springframework.orm.jpa.jpatransactionmanager"> <property name="entitymanagerfactory" ref="entitymanagerfactory" /> </bean> <bean id="entitymanagerfactory" class="org.springframework.orm.jpa.localcontainerentitymanagerfactorybean"> <property name="persistenceunitname" value="persistenceunit" /> <property name="datasource" ref="datasource" /> <property name="jpavendoradapter"> <bean class="org.springframework.orm.jpa.vendor.hibernatejpavendoradapter"> <property name="databaseplatform" value="org.hibernate.dialect.sqlserverdialect" /> <property name="showsql" value="${showsql}" /> <property name="generateddl" value="${generateddl}" /> </bean> </property> <property name="jpaproperties"> <props> <prop key="hibernate.format_sql">${formatsql}</prop> </props> </property> </bean> <bean id="datasource" class="org.springframework.jdbc.datasource.drivermanagerdatasource"> <property name="driverclassname" value="com.microsoft.sqlserver.jdbc.sqlserverdriver" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${username}" /> <property name="password" value="${password}" /> </bean> </beans>
persistence.xml
<?xml version="1.0" encoding="utf-8" ?> <persistence xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"> <persistence-unit name="persistenceunit" transaction-type="resource_local"> </persistence-unit> </persistence>
mainapp.java
import org.springframework.context.support.classpathxmlapplicationcontext; public class mainapp { private static classpathxmlapplicationcontext classpathxmlapplicationcontext; /* invoked jar */ public static void main(string args[]) throws exception { system.out.println("started central data extractor"); system.setproperty("jsse.enablesniextension", "false"); classpathxmlapplicationcontext = new classpathxmlapplicationcontext("classpath:/meta-inf/spring/camel-context.xml"); classpathxmlapplicationcontext.start(); } }
Comments
Post a Comment