• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

start up jobs on production environment

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
reply
    Bookmark Topic Watch Topic
  • New Topic