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

  • Problem with spring scheduler

    Hi Am trying to schedule multiple jobs at different time.

    <bean id="invokeObj2" class="com.login.action.cron.CronJobTrigger" />

    <sched:cron-job
    target-bean="invokeObj2"
    target-method="doStuff"
    cron-expression="0 03 11 * * ?" />

    Am using above code to schedule the Job

    http://www.springinaction.com/schema/sched when I click this link am getting 404 page not found exception.Am using spring-schedule 1.0.jar

    when I run the application am getting the below exception.Help me out to resolve this issue.

    SEVERE: Context initialization failed
    org.springframework.beans.factory.parsing.BeanDefi nitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.springinaction.com/schema/sched]
    Offending resource: ServletContext resource [/WEB-INF/batch-servlet.xml]
    at org.springframework.beans.factory.parsing.FailFast ProblemReporter.error(FailFastProblemReporter.java :57)
    at org.springframework.beans.factory.parsing.ReaderCo ntext.error(ReaderContext.java:64)
    at org.springframework.beans.factory.parsing.ReaderCo ntext.error(ReaderContext.java:55)
    at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1144)
    at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1137)
    at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.parseBeanDefinitions(Defau ltBeanDefinitionDocumentReader.java:145)
    at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.registerBeanDefinitions(De faultBeanDefinitionDocumentReader.java:89)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:499)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:407)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:357)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:334)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:126)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:142)
    at org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:123)
    at org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:91)
    at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:94)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:294)
    at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:156)
    at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:3 08)
    at org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:252 )
    at org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:221)
    at org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:115)
    at javax.servlet.GenericServlet.init(GenericServlet.j ava:256)
    at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1105)
    at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:932)
    at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:3951)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4225)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1013)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:718)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1013)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:442)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:450)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:709)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:551)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:294)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:432)
    Jan 28, 2009 11:05:29 AM org.apache.catalina.core.ApplicationContext l

  • #2
    Is it possible to see the XML header of your configuration file ?

    Comment


    • #3
      This is my xml configuration


      <?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:sched="http://www.springinaction.com/schema/sched"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-2.0.xsd
      http://www.springinaction.com/schema/sched http://www.springinaction.com/schema/sched-1.0.xsd"
      default-lazy-init="true">

      <bean id="invokeObj2" class="com.login.action.cron.CronJobTrigger" />

      <sched:cron-job
      target-bean="invokeObj2"
      target-method="doStuff"
      cron-expression="0 03 11 * * ?" />

      <sched:cron-job
      target-bean="invokeObj2"
      target-method="doStuff"
      cron-expression="0 04 11 * * ?" />

      </beans>

      Comment

      Working...
      X