Results 1 to 8 of 8

Thread: using spring batch admin

  1. #1

    Question using spring batch admin

    Hi
    I am trying to customize spring batch admin and following the steps listed http://static.springsource.org/sprin...g-started.html have connected to my backend postgres database which is hosting my batch job data.
    However i am having trouble getting the view to work . All my spring dependencies in the pom are set to 3.0.5 release and using the specific dependency as in the spring-batch-admin-manager (template) project is as
    Code:
    	
                      <dependency>
    			<groupId>org.freemarker</groupId>
    			<artifactId>freemarker</artifactId>
    		</dependency>
    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'annotationMappingMetaData': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping org.springframework.batch.admin.web.util.AnnotationMappingMetaData.mapping; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultAnnotationHandlerMapping' defined in URL [jar:file:/C:/gwt/sts/tc-server-developer-2.1.1.RELEASE/spring-insight-instance/wtpwebapps/spring-batch-admin-example/WEB-INF/lib/spring-batch-admin-resources-1.0.0.M1.jar!/META-INF/servlet/freemarker-servlet.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchFieldError: USER_DECLARED_METHODS
    	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:283)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1055)
    	at 
    ...
    Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping org.springframework.batch.admin.web.util.AnnotationMappingMetaData.mapping; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultAnnotationHandlerMapping' defined in URL [jar:file:/C:/gwt/sts/tc-server-developer-2.1.1.RELEASE/spring-insight-instance/wtpwebapps/spring-batch-admin-example/WEB-INF/lib/spring-batch-admin-resources-1.0.0.M1.jar!/META-INF/servlet/freemarker-servlet.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchFieldError: USER_DECLARED_METHODS
    	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:504)
    	at 
    ....
    Caused by: java.lang.NoSuchFieldError: USER_DECLARED_METHODS
    	at org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping.determineUrlsForHandlerMethods(DefaultAnnotationHandlerMapping.java:191)
    	at

  2. #2

    Default

    So i checked the freemarker-servlet.xml located in spring-batch-admin-resources-1.0.0.M1.jar in the spring-batch-admin-example and the namespace contains a reference to the spring 2.5 xsd's. is that the problem ?
    If i try to override that particular bean "defaultAnnotationHandlerMapping" in my own config i see that in the 3.0.5 release the DefaultAnnotationHandlerMapping class from o.s.web.servlet.mvc does not have interceptor property.

    How to make spring-batch-admin work in 3.0.5 ?

  3. #3
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    Quote Originally Posted by anshumania View Post
    How to make spring-batch-admin work in 3.0.5 ?
    Use the latest release (1.2.0.RELEASE), and not an old milestone?

  4. #4

    Default

    Thanks. Atleast that got me started and by now i have been able to integrate successfully with spring integration and launch jobs as well using stringtojoblaunchrequest adapter and joblaunchmessaging handler.
    Also I can lauch jobs from spring batch-admin ui. Great tool ! thanks !

  5. #5
    Join Date
    Jun 2011
    Posts
    9

    Default

    hey anshumania..

    Could you plz guide me fr how batch admin is to be connected to database? coz I m trying the same by following the steps given in ref doc..but no go..
    I have deployed the spirng batch admin war on tomcat and hv configured the xml by overriding few elements as given in the doc.
    Wat else we need to do to make it work?

    thx in adv...

  6. #6

    Default

    what is the error you are getting ? make sure ur datasource is loaded.
    You have to override as per the docs + u will need to append the prefix for your database in the configuration, if any.

    Quote Originally Posted by amrudhta View Post
    hey anshumania..

    Could you plz guide me fr how batch admin is to be connected to database? coz I m trying the same by following the steps given in ref doc..but no go..
    I have deployed the spirng batch admin war on tomcat and hv configured the xml by overriding few elements as given in the doc.
    Wat else we need to do to make it work?

    thx in adv...

  7. #7
    Join Date
    Jun 2011
    Posts
    9

    Default

    thx anshumania...got it configured ..but i have few questions here..

    1. What is the need of using PropertyPlaceholderConfigurer ? Cant we configure datasource with direct values? [ I had tried putting direct values to datasource instead of putting them thru properties file but it was showing no respose and no error too ]
    2. Even if the configuration of boostrap components and overriden components is same , then why do we again have to write it in context.xml file?
    3. After pointing to database UI is showing only few jobs out of 30 jobs which i already have run. But all exeution details are being shown?

    Please reply and suggest on these points..

  8. #8

    Default

    Quote Originally Posted by amrudhta View Post
    thx anshumania...got it configured ..but i have few questions here..

    1. What is the need of using PropertyPlaceholderConfigurer ? Cant we configure datasource with direct values? [ I had tried putting direct values to datasource instead of putting them thru properties file but it was showing no respose and no error too ]
    Have a look here and see if it helps you Spring-Batch-Admin-overriding-PropertyPlaceholderConfigurer

    2. Even if the configuration of boostrap components and overriden components is same , then why do we again have to write it in context.xml file?
    If it is the same then you do not need to override. The idea is that you would want to configure your datasource, your own joblauncher, and point them to your own database.
    3. After pointing to database UI is showing only few jobs out of 30 jobs which i already have run. But all exeution details are being shown?
    retry by starting from a clean slate. probably during your trials u had written into the in-memory hsqldb

Tags for this Thread

Posting Permissions

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