File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes start up jobs on production environment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "start up jobs on production environment" Watch "start up jobs on production environment" New topic
Author

start up jobs on production environment

gianluca gian
Ranch Hand

Joined: Aug 14, 2009
Posts: 31
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

Joined: Aug 14, 2009
Posts: 31
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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: start up jobs on production environment