Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-4978

Another CacheManager with same name 'apiCache' already exists in the same VM

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: TBD
    • Resolution: Fixed
    • Affects Version/s: Core 2.1.0
    • Fix Version/s: Core 2.1.0
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Undetermined

      Description

      The following error was reported by Jack Goldsmith [X] for a fresh install of openmrs-core 2.1.0-SNAPSHOT on Mac using mvn jetty:run straight from source code:

      Error creating bean with name 'apiCacheManagerFactoryBean' defined in org.openmrs.api.cache.CacheConfig: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Another CacheManager with same name 'apiCache' already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following: 1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary 2. Shutdown the earlier cacheManager before creating new one with same name. The source of the existing CacheManager is: InputStreamConfigurationSource [stream=java.io.BufferedInputStream@7bdf94f2]
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'apiCacheManagerFactoryBean' defined in org.openmrs.api.cache.CacheConfig: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Another CacheManager with same name 'apiCache' already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
      1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
      2. Shutdown the earlier cacheManager before creating new one with same name.
      The source of the existing CacheManager is: InputStreamConfigurationSource [stream=java.io.BufferedInputStream@7bdf94f2]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:743)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
      at org.openmrs.web.Listener.contextInitialized(Listener.java:193)
      at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:835)
      at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:530)
      at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:808)
      at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:342)
      at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1368)
      at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp(JettyWebAppContext.java:320)
      at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1335)
      at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:772)
      at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:259)
      at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:511)
      at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:403)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
      at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
      at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
      at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
      at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
      at org.eclipse.jetty.server.Server.start(Server.java:405)
      at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:106)
      at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
      at org.eclipse.jetty.server.Server.doStart(Server.java:372)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:457)
      at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:328)
      at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute(JettyRunMojo.java:170)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      Caused by: net.sf.ehcache.CacheException: Another CacheManager with same name 'apiCache' already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
      1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
      2. Shutdown the earlier cacheManager before creating new one with same name.
      The source of the existing CacheManager is: InputStreamConfigurationSource [stream=java.io.BufferedInputStream@7bdf94f2]
      at net.sf.ehcache.CacheManager.assertNoCacheManagerExistsWithSameName(CacheManager.java:628)
      at net.sf.ehcache.CacheManager.init(CacheManager.java:392)
      at net.sf.ehcache.CacheManager.(CacheManager.java:270)
      at org.springframework.cache.ehcache.EhCacheManagerFactoryBean.afterPropertiesSet(EhCacheManagerFactoryBean.java:157)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562)
      ... 63 more
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              raff Rafal Korytkowski
              Reporter:
              raff Rafal Korytkowski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: