Announcement Announcement Module
Collapse
No announcement yet.
Spring Batch Admin set up NoSuchMethodError ehcache/Cache.putIfAbsent Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Batch Admin set up NoSuchMethodError ehcache/Cache.putIfAbsent

    Hi all,

    Here is my latest stumbling block in trying to get the Spring Batch Admin app to run as a web application.

    When it tries to intialize the batch servlet which I defined in web.xml as...

    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>
    It gives the following exception...

    Code:
    [9/26/11 12:29:12:484 EDT] 0000000f webapp        I com.ibm.ws.webcontainer.webapp.WebApp log SRVE0292I: Servlet Message - [SpringClient#SpringBatchWeb.war]:.Initializing Spring FrameworkServlet 'Batch Servlet'
    [9/26/11 12:29:12:484 EDT] 0000000f DispatcherSer I org.springframework.web.servlet.FrameworkServlet initServletBean FrameworkServlet 'Batch Servlet': initialization started
    [9/26/11 12:29:12:484 EDT] 0000000f DispatcherSer E org.springframework.web.servlet.FrameworkServlet initServletBean Context initialization failed
                                     org.springframework.context.ApplicationContextException: Failed to start bean 'batchMBeanExporter'; nested exception is java.lang.NoSuchMethodError: net/sf/ehcache/Cache.putIfAbsent(Lnet/sf/ehcache/Element;)Lnet/sf/ehcache/Element;
    	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:169)
    	at org.springframework.context.support.DefaultLifecycleProcessor.access$1(DefaultLifecycleProcessor.java:154)
    	at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:335)
    	at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:143)
    	at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:108)
    	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:926)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:467)
    	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:377)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:278)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
    	at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1649)
    	at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410)
    	at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
    	at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
    	at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:748)
    	at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:633)
    	at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:422)
    	at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:714)
    	at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1134)
    	at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1369)
    	at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:638)
    	at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:967)
    	at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:730)
    	at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2129)
    	at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
    	at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
    	at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)
    	at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)
    	at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:994)
    	at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:349)
    	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1648)
    Caused by: java.lang.NoSuchMethodError: net/sf/ehcache/Cache.putIfAbsent(Lnet/sf/ehcache/Element;)Lnet/sf/ehcache/Element;
    	at org.springframework.batch.admin.util.SimpleEhCacheInterceptor.invoke(SimpleEhCacheInterceptor.java:92)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    	at $Proxy36.listJobs(Unknown Source)
    	at org.springframework.batch.admin.jmx.BatchMBeanExporter.registerJobs(BatchMBeanExporter.java:134)
    	at org.springframework.batch.admin.jmx.BatchMBeanExporter.doStart(BatchMBeanExporter.java:280)
    	at org.springframework.batch.admin.jmx.BatchMBeanExporter.start(BatchMBeanExporter.java:234)
    	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:166)
    So I am thinking I do not have the right version of the ecache jar in my WEB-INF/lib, but the latest version from the Spring web site seems to be 1.6.2. But when I look inside that jar at the Cache class I am not seeing this method "putIfAbsent" that the Spring Batch Admin code is looking for.

    Any ideas?

    Thank you in advance.
    Last edited by Jehan99; Sep 26th, 2011, 12:00 PM.

  • #2
    in spring batch admin parent pom.xml version 2.3.0 is used

    Code:
    			<dependency>
    				<groupId>net.sf.ehcache</groupId>
    				<artifactId>ehcache-core</artifactId>
    				<version>2.3.0</version>
    			</dependency>

    Comment


    • #3
      Thanks Micheal. I got the latest ecache and now the error is gone.

      Thanks again.

      Comment

      Working...
      X