Announcement Announcement Module
Collapse
No announcement yet.
Spring Batch Admin app DispatcherServlet error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Batch Admin app DispatcherServlet error

    Hi all,

    I am trying to run the Spring Batch Admin app in Websphere. I want to run it as part of an existing web app I have for running batch jobs called "SpringBatchWeb". So I just copied the web.xml from the sample app into my web.xml and I put the 2 jars spring-batch-admin-manager-1.2.0.RELEASE and spring-batch-admin-resources-1.2.0.RELEASE in WEB-INF/lib. When I try to hit the Batch Servlet (which I beleive is the entry point into the app), it gives the following error..

    [9/27/11 14:00:18:671 EDT] 0000003d PageNotFound W org.springframework.web.servlet.DispatcherServlet noHandlerFound No mapping found for HTTP request with URI [/SpringBatchWeb/BatchAdmin] in DispatcherServlet with name 'Batch Servlet'

    Here is my web.xml...

    Code:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    
    <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
    <display-name>SpringBatch</display-name>
    
    	 <context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>WEB-INF/InterStream.xml classpath*:/org/springframework/batch/admin/web/resources/webapp-config.xml</param-value>
    	</context-param>
    	
    
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    
    	<filter>
    		<filter-name>shallowEtagHeaderFilter</filter-name>
    		<filter-class>org.springframework.web.filter.ShallowEtagHeaderFilter</filter-class>
    	</filter>
    
    	<filter>
    		<filter-name>hiddenHttpMethodFilter</filter-name>
    		<filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
    	</filter>
    
    	<filter-mapping>
    		<filter-name>shallowEtagHeaderFilter</filter-name>
    		<url-pattern>/*</url-pattern>
    	</filter-mapping>
    
    	<filter-mapping>
    		<filter-name>hiddenHttpMethodFilter</filter-name>
    		<url-pattern>/*</url-pattern>
    	</filter-mapping>
    
    	<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>
    		<servlet-name>Resources 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/resources-config.xml</param-value>
    		</init-param>
    		<load-on-startup>0</load-on-startup>
    	</servlet>
    	
    		
    	<servlet>
    		<display-name>SpringBatchServlet</display-name>
    		<servlet-name>SpringBatchServlet</servlet-name>
    		<servlet-class>com.wu.interstream.servlet.SpringBatchClient</servlet-class>
    		<load-on-startup>2</load-on-startup>
    	</servlet>
    	
    
    	<servlet-mapping>
    		<servlet-name>Batch Servlet</servlet-name>
    		<url-pattern>/BatchAdmin</url-pattern>
    	</servlet-mapping>
    
    	
    	
    	<servlet-mapping>
    		<servlet-name>SpringBatchServlet</servlet-name>
    		<url-pattern>
    		/SpringBatchServlet</url-pattern>
    	</servlet-mapping>
    	
    
    </web-app>
    As you can see at the bottom I clealry defined a mapping for that url to go to "Batch Servlet". Now is the problem that Dispatcher servlet cannot found "Batch Servlet"? That is strange because when my server starts up I can see is intialized...

    Code:
    [9/27/11 15:27:04:838 EDT] 00000012 webapp        I com.ibm.ws.webcontainer.webapp.WebApp log SRVE0292I: Servlet Message - [SpringClient#SpringBatchWeb.war]:.Initializing Spring FrameworkServlet 'Batch Servlet'
    [9/27/11 15:27:04:838 EDT] 00000012 DispatcherSer I org.springframework.web.servlet.FrameworkServlet initServletBean FrameworkServlet 'Batch Servlet': initialization started
    [9/27/11 15:27:04:839 EDT] 00000012 XmlWebApplica I org.springframework.context.support.AbstractApplicationContext prepareRefresh Refreshing WebApplicationContext for namespace 'Batch Servlet-servlet': startup date [Tue Sep 27 15:27:04 EDT 2011]; parent: Root WebApplicationContext
    [9/27/11 15:27:04:841 EDT] 00000012 XmlBeanDefini I org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions Loading XML bean definitions from URL [wsjar:file:/C:/Users/244582/IBM/rationalsdp/workspace/SpringBatchWeb/WebContent/WEB-INF/lib/spring-batch-admin-resources-1.2.0.RELEASE.jar!/org/springframework/batch/admin/web/resources/servlet-config.xml]
    [9/27/11 15:27:04:876 EDT] 00000012 XmlBeanDefini I org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions Loading XML bean definitions from URL [wsjar:file:/C:/Users/244582/IBM/rationalsdp/workspace/SpringBatchWeb/WebContent/WEB-INF/lib/spring-batch-admin-resources-1.2.0.RELEASE.jar!/META-INF/spring/batch/servlet/resources/resources-context.xml]
    [9/27/11 15:27:04:938 EDT] 00000012 XmlBeanDefini I org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions Loading XML bean definitions from URL [wsjar:file:/C:/Users/244582/IBM/rationalsdp/workspace/SpringBatchWeb/WebContent/WEB-INF/lib/spring-batch-admin-manager-1.2.0.RELEASE.jar!/META-INF/spring/batch/servlet/manager/manager-context.xml]
    [9/27/11 15:27:04:948 EDT] 00000012 XmlBeanDefini I org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions Loading XML bean definitions from URL [wsjar:file:/C:/Users/244582/IBM/rationalsdp/workspace/SpringBatchWeb/WebContent/WEB-INF/lib/spring-batch-admin-manager-1.2.0.RELEASE.jar!/META-INF/spring/batch/servlet/manager/integration-context.xml]
    [9/27/11 15:27:04:981 EDT] 00000012 XmlBeanDefini I org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions Loading XML bean definitions from URL [wsjar:file:/C:/Users/244582/IBM/rationalsdp/workspace/SpringBatchWeb/WebContent/WEB-INF/lib/spring-batch-admin-manager-1.2.0.RELEASE.jar!/META-INF/spring/batch/servlet/manager/controller-context.xml]
    
    there is more here but I removed it to save space
    
    [9/27/11 15:27:06:026 EDT] 00000012 DispatcherSer I org.springframework.web.servlet.FrameworkServlet initServletBean FrameworkServlet 'Batch Servlet': initialization completed in 1188 ms
    [9/27/11 15:27:06:027 EDT] 00000012 servlet       I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [SpringClient] [/SpringBatchWeb] [Batch Servlet]: Initialization successful.
    Thanks in advance for any help.
    Last edited by Jehan99; Sep 27th, 2011, 04:24 PM.

  • #2
    Hi,

    just build the war file with maven and drop it in your servlet. In project spring-batch-admin-sample.

    Comment


    • #3
      Hi,

      I know that is an option, but I want to embed Spring Batch Web into my own web app. I was told that also is possible.

      When I change the URL mapping of Batch servlet to..
      Code:
      <servlet-mapping>
      		<servlet-name>Batch Servlet</servlet-name>
      		<url-pattern>/batch/*</url-pattern>
      	</servlet-mapping>
      and I go to the URL "http://localhost:9080/SpringBatchWeb/batch/jobs" then I am seeing content but there is no CSS. And when I look at the source everything is pointing to my context root, for example the following links..

      Code:
      <li><a href="/SpringBatchWeb">Home</a></li>
      			<li><a href="/SpringBatchWeb/jobs">Jobs</a></li>
      
      			<li><a href="/SpringBatchWeb/jobs/executions">Executions</a></li>
      How do I tell the admin app to change these from "SpringBatchWeb/jobs" to " SpringBatchWeb/batch/jobs "?

      Comment


      • #4
        Hi all,

        I figuered it out, I had to make some changes to the files in the Spring Batch Admin jars, this thread explains how...

        http://forum.springsource.org/showth...lable&p=351442

        Thanks.

        Comment

        Working...
        X