Announcement Announcement Module
Collapse
No announcement yet.
quartz scheduler with sprin Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • quartz scheduler with sprin

    I am writing a quartz scheduler with spring. I am using jdbc to connect to the DB for the scheduler, but for my other applictions using hibernate.
    Since I m using maven when i do mvn clean install to scheduler module it will prompt
    The dialect was not set. Set the property hibernate.dialect.

    Other modules which use hibernate is working perfectly. I am wonder why since I m not using hibernate and why this is comming.

    I am attaching my application context

    <quot>
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-2.0.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schem...ing-tx-2.0.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">


    <!-- ************** COMMON SECTION THAT WILL BE EXTRACTED INTO SEPARATE CONFIG XML *************************-->
    <!-- Configurer that replaces ${...} placeholders with values from a properties file -->
    <!-- e.g. DB-related settings for the dataSource definition below, etc. -->
    <bean id="commonPropertyConfigurer" class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
    <property name="order" value="0" />
    <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
    <property name="searchSystemEnvironment" value="true" />
    <property name="ignoreUnresolvablePlaceholders" value="true"/>
    <property name="locations">
    <list>
    <value>classpath:config/quartz.properties</value>
    </list>
    </property>
    </bean>


    <bean id="taskExecutor" class="org.springframework.scheduling.concurrent.T hreadPoolTaskExecutor">
    <property name="corePoolSize" value="${taskExecutor.corePoolSize}" />
    <property name="maxPoolSize" value="${taskExecutor.maxPoolSize}" />
    <property name="queueCapacity" value="${taskExecutor.queueCapacity}" />
    <property name="threadFactory" ref="threadFactory" />
    </bean>

    <bean id="threadFactory" class="org.springframework.scheduling.concurrent.C ustomizableThreadFactory">
    <property name="threadPriority" value="${threadFactory.threadPriority}" />
    </bean>


    <bean id="xdataSource"
    class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://192.168.102.42:3306/athiva" />
    <property name="username" value="root" />
    <property name="password" value="ajith" />

    </bean>

    <tx:advice id="xtxAdvice" transaction-manager="xtxManager">
    <tx:attributes>
    <tx:method name="get*" read-only="true" propagation="SUPPORTS"/>
    <tx:method name="*" propagation="REQUIRED"/>
    </tx:attributes>
    </tx:advice>


    <bean id="xtxManager" class="org.springframework.jdbc.datasource.DataSou rceTransactionManager">
    <property name="dataSource" ref="xdataSource"/>
    </bean>

    <bean id="scheduler" class="org.springframework.scheduling.quartz.Sched ulerFactoryBean" lazy-init="false">
    <property name="dataSource">
    <ref bean="xdataSource" />
    </property>
    <property name="transactionManager">
    <ref bean="xtxManager" />
    </property>
    <property name="taskExecutor">
    <ref bean="taskExecutor" />
    </property>
    <property name="schedulerName">
    <value>bp.scheduler.jdbc</value>
    </property>

    <property name="applicationContextSchedulerContextKey">
    <value>applicationContext</value>
    </property>

    <property name="waitForJobsToCompleteOnShutdown">
    <value>true</value>
    </property>
    <property name="configLocation">
    <value>classpath:config/quartz.properties</value>
    </property>
    <property name="triggers">
    <list>
    <!-- DEFINE ALL TRIGGERS THAT NEEDS TO BE REGISTERED THROUGH THE SCHEDULER SERVICE
    <ref bean="simpleTrigger" />-->
    </list>
    </property>
    </bean>

    <bean id="schedulerService"
    class="com.aeturnum.athiva.modules.scheduler.servi ce.SchedulerService">
    <property name="scheduler" ref="scheduler" />
    </bean>


    <bean id="scheduleDemo" class="com.aeturnum.athiva.modules.scheduler.servi ce.SchedulerDemo">
    <property name="schedulerService" ref="schedulerService" />
    <property name="weeklyEmailJob" ref="weeklyEmailJob" />
    <property name="monthlyEmailJob" ref="monthlyEmailJob" />
    <property name="dailyEmailJob" ref="dailyEmailJob" />
    </bean>


    <bean name="weeklyEmailJob" class="org.springframework.scheduling.quartz.JobDe tailBean">
    <property name="jobClass" value="com.aeturnum.athiva.modules.scheduler.jobs. WeeklyEmailJob" />
    </bean>

    <bean name="monthlyEmailJob" class="org.springframework.scheduling.quartz.JobDe tailBean">
    <property name="jobClass" value="com.aeturnum.athiva.modules.scheduler.jobs. MonthlyEmailJob" />
    </bean>

    <bean name="dailyEmailJob" class="org.springframework.scheduling.quartz.JobDe tailBean">
    <property name="jobClass" value="com.aeturnum.athiva.modules.scheduler.jobs. DailyEmailJob" />
    </bean>


    </beans>
    <quot>
Working...
X