Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

start up jobs on production environment

 
gianluca gian
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I have a j2ee application that is first tested in test environment and then deployed in production environment. The application has jobs that are scheduled with Quartz and Spring framework. Can you please tell me what would be the best way to start scheduling jobs only in production environment?? Could I use an jndi variable set on the application server? could I use a better way? Thank you
 
gianluca gian
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I solved using a property file on the production server. I saved the file on a directory outside the application. I defined an Url Jndi resource on the application server and then I used the PropertyPlaceholderConfigurer to get properties:

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<bean class="org.springframework.core.io.UrlResource">
<constructor-arg>
<jee:jndi-lookup jndi-name="java:comp/env/url/PropertyUrl" default-value="file:///D:/proDir/application.properties" />
</constructor-arg>
</bean>
</property>
<property name="properties">
<bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="locations">
<list>
<value>/WEB-INF/properties/default.properties</value>
</list>
</property>
</bean>
</property>

<property name="ignoreResourceNotFound" value="true"/>
</bean>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic