Mule EHCache在Mule独立中抛出异常

时间:2014-10-27 16:10:58

标签: mule ehcache mule-studio

我有一个使用 Mule EHCache Scope 的Mule应用程序。 我参考了以下内容: - http://ricston.com/blog/cache-scope-ehcache/ 现在,如果您查看文章的评论部分,可以将EHCache jar(ehcache-core-2.6.0.jar)放在Mule Standalone的$ MULE_HOME / lib / user中,并将Mule Studio放入$ MULE_STUDIO_INSTALL_DIR /plugins/org.mule.tooling.server.$version/mule/lib/user ...现在我完全按照它所说的做了..

在Mule studio中,应用程序运行正常没有任何问题..但是如果我尝试在Mule enterprise 3.5.1 Standalone中部署和运行..我得到以下异常: -

org.mule.module.launcher.DeploymentInitException: Error: Unresolved compilation problems:
        The import net.sf.ehcache cannot be resolved
        The import net.sf.ehcache cannot be resolved
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type

        at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:181)
        at org.mule.module.launcher.artifact.ArtifactWrapper$2.execute(ArtifactWrapper.java:62)
        at org.mule.module.launcher.artifact.ArtifactWrapper.executeWithinArtifactClassLoader(ArtifactWrapper.java:129)
        at org.mule.module.launcher.artifact.ArtifactWrapper.init(ArtifactWrapper.java:57)
        at org.mule.module.launcher.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:25)
        at org.mule.module.launcher.DefaultArchiveDeployer.guardedDeploy(DefaultArchiveDeployer.java:310)
        at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:330)
        at org.mule.module.launcher.DefaultArchiveDeployer.deployExplodedApp(DefaultArchiveDeployer.java:297)
        at org.mule.module.launcher.DefaultArchiveDeployer.deployExplodedArtifact(DefaultArchiveDeployer.java:108)
        at org.mule.module.launcher.DeploymentDirectoryWatcher.deployExplodedApps(DeploymentDirectoryWatcher.java:290)
        at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:151)
        at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:99)
        at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:152)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.mule.module.reboot.MuleContainerWrapper.start(MuleContainerWrapper.java:52)
        at org.tanukisoftware.wrapper.WrapperManager$11.run(WrapperManager.java:4048)
Caused by: org.mule.api.config.ConfigurationException: Error creating bean with name 'cachingStrategy': Cannot create inner bean '(inner bean)' of type [com.anirban.EHCat
ban.EHCatche.EhcacheObjectStore]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
        The import net.sf.ehcache cannot be resolved
        The import net.sf.ehcache cannot be resolved
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
 (org.mule.api.lifecycle.InitialisationException) (org.mule.api.config.ConfigurationException)
        at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:49)
        at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69)
        at org.mule.context.DefaultMuleContextFactory$1.configure(DefaultMuleContextFactory.java:84)
        at org.mule.context.DefaultMuleContextFactory.doCreateMuleContext(DefaultMuleContextFactory.java:217)
        at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:76)
        at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:174)
        ... 18 more
Caused by: org.mule.api.config.ConfigurationException: Error creating bean with name 'cachingStrategy': Cannot create inner bean '(inner bean)' of type [com.anirban.EHCat
ban.EHCatche.EhcacheObjectStore]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
        The import net.sf.ehcache cannot be resolved
        The import net.sf.ehcache cannot be resolved
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
 (org.mule.api.lifecycle.InitialisationException)
        at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:49)
        at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69)
        at org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(AutoConfigurationBuilder.java:101)
        at org.mule.config.builders.AutoConfigurationBuilder.doConfigure(AutoConfigurationBuilder.java:52)
        at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43)
        ... 23 more
Caused by: org.mule.api.lifecycle.InitialisationException: Error creating bean with name 'cachingStrategy': Cannot create inner bean '(inner bean)' of type [com.anirban.E
anirban.EHCatche.EhcacheObjectStore]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
        The import net.sf.ehcache cannot be resolved
        The import net.sf.ehcache cannot be resolved
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type

        at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:113)
        at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:135)
        at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:90)
        at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43)
        ... 27 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cachingStrategy': Cannot create inner bean '(inner bean)' of type [com.
ass [com.anirban.EHCatche.EhcacheObjectStore]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
        The import net.sf.ehcache cannot be resolved
        The import net.sf.ehcache cannot be resolved
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type

        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:282)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1391)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1132)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
        at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:86)
        at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:105)
        ... 30 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Instantiation of bean failed; nested exception is org.sp
        The import net.sf.ehcache cannot be resolved
        The import net.sf.ehcache cannot be resolved
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1011)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:957)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:271)
        ... 44 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.anirban.EHCatche.EhcacheObjectStore]: Constructor threw exception;
        The import net.sf.ehcache cannot be resolved
        The import net.sf.ehcache cannot be resolved
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type

        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1004)
        ... 48 more
Caused by: java.lang.Error: Unresolved compilation problems:
        The import net.sf.ehcache cannot be resolved
        The import net.sf.ehcache cannot be resolved
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Element cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type
        Ehcache cannot be resolved to a type

        at com.anirban.EHCatche.EhcacheObjectStore.<init>(EhcacheObjectStore.java:5)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
        ... 50 more
INFO  2014-10-27 21:30:10,584 [WrapperListener_start_runner] org.mule.module.launcher.DeploymentDirectoryWatcher:

现在我已将 ehcache-core-2.6.5.jar 放在Mule Standalone的 $ MULE_HOME / lib / user 中。 仍然得到例外..请帮忙

1 个答案:

答案 0 :(得分:0)

我最终将 ehcache-core-2.6.5.jar 放在项目的lib文件夹中,然后它像往常一样工作..但仍然使用相同的独立jar文件不起作用