Results 1 to 6 of 6

Thread: Error in Spring Dm 2.0M6 - when using <task> namespace

  1. #1
    Join Date
    Nov 2008
    Location
    London,UK
    Posts
    299

    Default Error in Spring Dm 2.0M6 - when using <task> namespace

    Hi,

    I tried using Spring 3 - TaskExecutor and TaskSchedulor with spring Dm 2.0 M6

    I get error when i use the namespace in the xml.

    Code:
      	<task:executor id="taskExecutor" pool-size="2-5" queue-capacity="25"/>
             <task:scheduler id="schedulor"/>
             <task:annotation-driven scheduler="mySchedulor"/>
    When i change the namespace to use specific classes they work fine

    Code:
      <bean id="mySchedulor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler"></bean>
    
      
      <bean class="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor">
             <property name="scheduler" ref="mySchedulor"></property>
      </bean>
    
    
    	<bean id="taskExecutor"
    		class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
    		<property name="corePoolSize" value="2" />
    		<property name="maxPoolSize" value="5" />
    		<property name="queueCapacity" value="25" />
    	</bean>

    Is this a BUG ? the error trace is as follows

    Code:
      
    Caused by: org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class [org.springframework.scheduling.config.TaskNamespaceHandler] for namespace [http://www.springframework.org/schema/task]: problem with handler class file or dependent class; nested exception is java.lang.NoClassDefFoundError: edu/emory/mathcs/backport/java/util/concurrent/ThreadPoolExecutor$AbortPolicy
    	at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:139)
    	at org.springframework.osgi.extender.internal.support.NamespacePlugins$Plugin.resolve(NamespacePlugins.java:82)
    	at org.springframework.osgi.extender.internal.support.NamespacePlugins.doResolve(NamespacePlugins.java:168)
    	at org.springframework.osgi.extender.internal.support.NamespacePlugins.resolve(NamespacePlugins.java:131)
    	at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.springframework.osgi.context.support.TrackingUtil$OsgiServiceHandler.invoke(TrackingUtil.java:123)
    	at $Proxy34.resolve(Unknown Source)
    	at org.springframework.osgi.context.support.DelegatedNamespaceHandlerResolver.resolve(DelegatedNamespaceHandlerResolver.java:56)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1322)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1317)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:134)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:91)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:475)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:372)
    	... 21 common frames omitted
    Caused by: java.lang.NoClassDefFoundError: edu/emory/mathcs/backport/java/util/concurrent/ThreadPoolExecutor$AbortPolicy
    	at org.springframework.scheduling.config.TaskNamespaceHandler.init(TaskNamespaceHandler.java:31)
    	at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:130)
    	... 36 common frames omitted

    I tried soling this classNotFound edu/emory/mathcs/backport/java/util/concurrent/ThreadPoolExecutor$AbortPolicy

    By adding com.springsource.edu.emory.mathcs.backport-3.1.0.jar in repository/ext folder.

    But still no luck :-(

    I keep getting teh same error .

    Since the error is shown in the class -
    org.springframework.beans.factory.xml.DefaultNames paceHandlerResolver

    I checked the shell console - It(spring-context-bundle) is not able to get this package -edu/emory/mathcs/backport/java/util/concurrent.


    Does it mean that com.springsource.edu.emory.mathcs.backport-3.1.0.jar shoudl be in teh kernel region ?

    Is the kernel region bundle able to see bundle places in usr directory ?

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    It has nothing to do with dm server, there was an issue with the namespace support depending directly on on the edu.memory.backport stuff, it has been fixed in newer releases of Spring 3.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Nov 2008
    Location
    London,UK
    Posts
    299

    Default

    Thanks Marten.

    I was using Spring Dm 2.0M6 which was internally using Spring 3.0RC2.

    So i assume this issue was in that version. Can i assume that this issue is fixed in Spring 3.0 RC3 , and use that for my standalone testing ?

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    That should work, you could also install RC3 into dm server in theory it should work .
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Oct 2008
    Posts
    493

    Default

    Quote Originally Posted by Marten Deinum View Post
    It has nothing to do with dm server, there was an issue with the namespace support depending directly on on the edu.memory.backport stuff, it has been fixed in newer releases of Spring 3.
    Thanks Marten, you just saved me a couple of hours of digging
    Andy Wilkinson
    SpringSource

  6. #6
    Join Date
    Oct 2008
    Posts
    493

    Default

    Quote Originally Posted by sudheerk84 View Post
    Thanks Marten.

    I was using Spring Dm 2.0M6 which was internally using Spring 3.0RC2.

    So i assume this issue was in that version. Can i assume that this issue is fixed in Spring 3.0 RC3 , and use that for my standalone testing ?
    RC3 works nicely in dm Server. You can grab one of the latest snapshot builds to try it out.
    Andy Wilkinson
    SpringSource

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •