Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

configuring Quartz scheduler in tomcat 6 using JNDI

 
Shantanu Puranik
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm working on project that involves porting legacy app. from old version of JBoss and java to tomcat 6.x and jdk 1.6.
Quartz 1.6 is configured as JNDI resource using mbean in old app.
For new app. Quartz version remains the same.

What I 've done till now:
1. Created myWebApp_quartz.properties file and placed under /webapps/myWebApp/WEB-INF/classes

2. Added following entry in web.xml

I get an exception saying, javax.naming.NameNotFoundException: Name myWebAppQuartz is not bound in this Context
It means that quartz instance isn't registered with JNDI.
I want to know how to configure Quartz scheduler in tomcat 6 using JNDI.
Thank you.
 
Shantanu Puranik
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just figured out with help of tomcat help resource
Scroll down the page to section Adding Custom Resource Factories

1. Implement interface javax.naming.spi.ObjectFactory

2. create quartz.properties file as shown in the above post (consider specifying additional properties as required by your app.)

3. In web.xml add resource ref
4. create context.xml in the project structure at location /webapps/META-INF.
When deployed tomcat will automatically create <myWebApp>.xml in dir. \tomcat\conf\Catalina\localhost and the contents of context.xml will be copied into it.
Finally, perform lookup as
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic