Announcement Announcement Module
Collapse
No announcement yet.
Spring Batch Admin App fails to create configuration bean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Batch Admin App fails to create configuration bean

    Hi,

    When Spring Batch Admin App is starting up for me, I am getting the following error...

    Code:
    SEVERE: StandardWrapper.Throwable
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.beanNameUrlHandlerMapping':
    Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: 
    Error creating bean with name 'configurationHandler' defined in URL 
    [jar:file:/C:/Users/244582/Workspaces/MyEclipse%209/.metadata/.me_tcat/webapps/InterStreamBatch/WEB-INF/lib/spring-batch-admin-manager-1.2.1.RELEASE.jar!/META-INF/
    spring/batch/servlet/manager/manager-context.xml]: Cannot resolve reference to bean 'configuration' while setting bean property 'view';
    nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configuration'
    defined in URL [jar:file:/C:/Users/244582/Workspaces/MyEclipse%209/.metadata/.me_tcat/webapps/InterStreamBatch/WEB-INF/lib/spring-batch-admin-manager-1.2.1.RELEASE.jar!/META-INF
    /spring/batch/servlet/manager/manager-context.xml]: Initialization of bean failed; 
    nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; 
    nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0):
    Field or property 'resourceService' cannot be found on object of type 'org.springframework.beans.factory.config.BeanExpressionContext'
    It looks like it is trying to create the bean named "configuration" in manager-context.xml, and when trying to do so it cannot find a "resourceService" property in BeanExpressionContext. I am not sure why exactly it is doing this.

    The root exception seems to be..

    Code:
    nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Field or property 'resourceService' cannot be found on object of type 'org.springframework.beans.factory.config.BeanExpressionContext'
    I am running it on Tomcat.

    Thanks in advance for any help.
    Last edited by Jehan99; Nov 2nd, 2011, 12:57 PM.

  • #2
    Just a quick thought, could this be because the Admin app needs a full blown J2EE server and thus is not supported on Tomcat?

    Comment


    • #3
      You definitely don't need a full blown J2EE server. See http://static.springsource.org/sprin...ng_Batch_Admin. The gist of the note is:

      The sample can also be created with a couple of clicks in the SpringSource Tool Suite (STS): go to File->New->Spring Template Project, and select the Spring Batch Admin Webapp from the list (if it isn't there upgrade STS). In STS you can right click on the project and Run As->Run On Server choose Tomcat or tc Server, and the app will deploy and open a web browser (e.g. localhost:8080/spring-batch-admin-sample). Check out the features for launching jobs and inspecting job executions. If the STS project looks out of date (look at the version numbers in the pom.xml) then you might be able to upgrade by changing the POM, or else you may have to install a nightly update of STS or wait for the next release."

      Are you sure you have all of the required jar files in your deployment?

      Comment


      • #4
        Hi guys... i am also facing the similar issue with getting the spring batch web admin app. up and running...

        error snippet:

        SEVERE: Context initialization failed
        org.springframework.beans.factory.parsing.BeanDefi nitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath*:/META-INF/spring/batch/bootstrap/**/*.xml]
        Offending resource: URL [jar:file:/D:/workspace/jboss-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/SpringBatchAdminWebapp/WEB-INF/lib/spring-batch-admin-resources-1.2.1.RELEASE.jar!/org/springframework/batch/admin/web/resources/webapp-config.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 38 in XML document from URL [jar:file:/D:/workspace/jboss-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/SpringBatchAdminWebapp/WEB-INF/lib/spring-batch-admin-manager-1.2.1.RELEASE.jar!/META-INF/spring/batch/bootstrap/integration/configuration-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 38; columnNumber: 60; cvc-complex-type.3.2.2: Attribute 'cron' is not allowed to appear in element 'poller'.
        Attachment

        were you able to resolve the issue??

        any pointers are much appreciated.

        Attached the full error log.
        Attached Files

        Comment


        • #5
          Looks like the error is: Attribute 'cron' is not allowed to appear in element 'poller'

          What version of Spring Integration are you pulling in? It looks like the cron attribute was added in release 2.0.1.

          Comment


          • #6
            got the same issue

            Spring Framework 3.1.1.RELEASE
            Spring Batch 2.1.8.RELEASE
            Spring Integration 2.1.0.RELEASE
            Spring Batch Admin 1.2.1.RELEASE

            Code:
            org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configurationHandler' defined in URL [jar:file:/C:/java/springsource/vfabric-tc-server-developer-2.6.3.RELEASE/spring-insight-instance/wtpwebapps/iol/WEB-INF/lib/spring-batch-admin-manager-1.2.1.RELEASE.jar!/META-INF/spring/batch/servlet/manager/manager-context.xml]: Cannot resolve reference to bean 'configuration' while setting bean property 'view'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configuration' defined in URL [jar:file:/C:/java/springsource/vfabric-tc-server-developer-2.6.3.RELEASE/spring-insight-instance/wtpwebapps/iol/WEB-INF/lib/spring-batch-admin-manager-1.2.1.RELEASE.jar!/META-INF/spring/batch/servlet/manager/manager-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Field or property 'resourceService' cannot be found on object of type 'org.springframework.beans.factory.config.BeanExpressionContext'

            Comment


            • #7
              thought it might have been because I only added the servlet to my web.xml

              eg
              Code:
              <servlet>
              		<servlet-name>Batch Servlet</servlet-name>
              		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
              		<init-param>
              			<param-name>contextConfigLocation</param-name>
              			<param-value>classpath*:/org/springframework/batch/admin/web/resources/servlet-config.xml</param-value>
              		</init-param>
              		<load-on-startup>1</load-on-startup>
              	</servlet>
              
              <servlet-mapping>
              		<servlet-name>Batch Servlet</servlet-name>
              		<url-pattern>/batch/*</url-pattern>
              	</servlet-mapping>
              so I tried adding also the batch-admin-manager context, eg

              Code:
              <context-param>
              		<param-name>contextConfigLocation</param-name>
              		<param-value>
              			/WEB-INF/spring/root-context.xml
              			classpath*:/org/springframework/batch/admin/web/resources/webapp-config.xml
              		</param-value>
              	</context-param>
              unfortunately, that didnt work, as I was then presented with

              SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner
              org.springframework.beans.factory.parsing.BeanDefi nitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath*:/META-INF/spring/batch/bootstrap/**/*.xml]

              Caused by: org.springframework.beans.factory.parsing.BeanDefi nitionParsingException: Configuration problem: You cannot use prior versions of Spring Integration schemas with Spring Integration 2.1. Please upgrade your schema declarations or use versionless aliases (e.g. spring-integration.xsd).

              Comment


              • #8
                FYI, I managed to get it working using spring-batch-admin 1.2.2.BUILD-SNAPSHOT, as I saw in the git comments that there was a fix for "BATCHADM-125: Version-less URLs for S.I. 2.1"

                any ETA on 1.2.2.RELEASE?

                Comment


                • #9
                  The resourceService issue can be solved by following the steps here: http://stackoverflow.com/a/6466155/51280

                  I.e., define the following bean in your context:

                  Code:
                  <bean id="resourceService"
                  class="org.springframework.batch.admin.web.resources.DefaultResourceService">
                      <property name="servletPath" value="/batch" />
                  </bean>

                  Comment


                  • #10
                    Hi All,

                    Please let me know how to set up the spring batch admin using spring 4 jars

                    Regards
                    Krishna

                    Comment


                    • #11
                      Spring Batch Admin 1.3.0 works with Spring 4

                      Comment

                      Working...
                      X