Announcement Announcement Module
Collapse
No announcement yet.
NullPointer when displaying jobsteps Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NullPointer when displaying jobsteps

    Hi,

    I receive a nullpointer when using the web gui to check the Step Executions Count for a completed Job Execution. When debugging I see that the SimpleJobService calls the jobLocator (a MapJobRegistry) to get a job with jobName null. The ConcurrentHashMap used by the MapJobRegistry then throws the NullPointer. Since a NoSuchJobException is expected according to the code I guess the Nullpointer should be caught and re-thrown as a NoSuchJobEx.?

    Env:
    Win 7
    Java 6
    Jboss 6.1
    Spring Batch 2.1.0.RELEASE
    Spring Batch Admin 1.2.1.RELEASE

    Any help or pointers are appreciated!
    Br Svante

    Spring batch beans (excl. jobs)
    Code:
    <bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
        	<property name="jobRepository" ref="jobRepository" />
        	<property name="taskExecutor">
            	<bean class="org.springframework.core.task.SimpleAsyncTaskExecutor" />
        	</property>
        </bean>
    
    	<bean id="jobService" class="org.springframework.batch.admin.service.SimpleJobServiceFactoryBean">
    		<property name="jobRepository" ref="jobRepository" />
    		<property name="jobLauncher" ref="jobLauncher" />
    		<property name="jobLocator" ref="jobRegistry" />
    		<property name="dataSource" ref="dataSource" />
    		<property name="tablePrefix" value="SB_" />
    		<property name="databaseType" value="ORACLE" />
    	</bean>
    	
    	<batch:job-repository id="jobRepository"
    		data-source="dataSource"
    		transaction-manager="transactionManager"
        	isolation-level-for-create="READ_COMMITTED"
        	table-prefix="SB_"/>
        	
        <bean id="jobExplorer" class="org.springframework.batch.core.explore.support.JobExplorerFactoryBean">
        	<property name="dataSource" ref="dataSource"/>
        	<property name="tablePrefix" value="SB_"/>
        </bean>
        
        <bean id="jobRegistry" class="org.springframework.batch.core.configuration.support.MapJobRegistry"/>
    	<bean id="jobRegistryBeanPostProcessor" class="org.springframework.batch.core.configuration.support.JobRegistryBeanPostProcessor">
        	<property name="jobRegistry" ref="jobRegistry"/>
    	</bean>    
        
        <bean id="jobOperator" class="org.springframework.batch.core.launch.support.SimpleJobOperator">
        	<property name="jobExplorer" ref="jobExplorer"/>
        	<property name="jobLauncher" ref="jobLauncher"/>
        	<property name="jobRepository" ref="jobRepository"/>
        	<property name="jobRegistry" ref="jobRegistry"/>
        </bean>
    Stack trace:
    Code:
    10:50:18,440 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/aisfbatch].[Batch Servlet]] Servlet.service() for servlet Batch Servlet threw exception: java.lang.NullPointerException
    	at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768) [:1.6.0_25]
    	at org.springframework.batch.core.configuration.support.MapJobRegistry.getJob(MapJobRegistry.java:67) [:]
    	at org.springframework.batch.admin.service.SimpleJobService.getStepExecutions(SimpleJobService.java:124) [:]
    	at org.springframework.batch.admin.web.StepExecutionController.list(StepExecutionController.java:72) [:]
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_25]
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_25]
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_25]
    	at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_25]
    	at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) [:3.2.0.RC1]
    	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) [:3.2.0.RC1]
    	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) [:3.2.0.RC1]
    	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) [:3.2.0.RC1]
    	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686) [:3.2.0.RC1]
    	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) [:3.2.0.RC1]
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) [:3.2.0.RC1]
    	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) [:3.2.0.RC1]
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:917) [:3.2.0.RC1]
    	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:813) [:3.2.0.RC1]
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [:1.0.0.Final]
    	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:798) [:3.2.0.RC1]
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.1.0.Final]
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]
    	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) [:3.2.0.RC1]
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [:3.2.0.RC1]
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.1.0.Final]
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]
    	at org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:75) [:3.2.0.RC1]
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [:3.2.0.RC1]
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.1.0.Final]
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.1.0.Final]
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [:6.1.0.Final]
    	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.1.0.Final]
    	at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
    	at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
    	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.1.0.Final]
    	at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.1.0.Final]
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159) [:6.1.0.Final]
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.1.0.Final]
    	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.1.0.Final]
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.1.0.Final]
    	at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.1.0.Final]
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.1.0.Final]
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.1.0.Final]
    	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.1.0.Final]
    	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.1.0.Final]
    	at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
Working...
X