我正在为我受雇的公司从事一个项目。他们正在使用Magnolia CMS。尝试启动Tomcat服务器时,我在Eclipse的控制台中收到此错误。
我一直在寻找解决方案,但发现它很困难。我试过重新安装eclipse,tomcat,删除.m2存储库并重建,清理项目,清理tomcat工作目录,并在magnolia.properties中注释掉log4j的配置。
我已经搜索了错误,但没有发现任何帮助。我在另一台完全不同的计算机上尝试过,但遇到了相同的错误,因此可能与代码有关,而不与环境有关。但是,我有在Windows上的同事却没有收到此错误。任何帮助,将不胜感激。
Tomcat 8.5,mac osx 10.13.6 High sierra,java 8 update 191(内部版本1.8.0_191-b12),木兰版本不是最新版本(我会找出并更新)。
Initializing Log4J
Initializing Log4J from [WEB-INF/config/default/log4j.xml]
18-11-02 17:38:49 ERROR PUBLIC[main]info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder: Magnolia failed to load module configuration with types {} and components {Key[type=info.magnolia.cms.pddescriptor.ProductDescriptorExtractor, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@4e251e4d, Key[type=info.magnolia.cms.util.UnicodeNormalizer$Normalizer, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@622f47c4, Key[type=info.magnolia.content2bean.Content2BeanProcessor, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@56c25298, Key[type=info.magnolia.cms.filters.FilterManager, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@210b1e0a, Key[type=info.magnolia.cms.beans.config.ConfigLoader, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@3b12c7f8, Key[type=info.magnolia.cms.core.FileSystemHelper, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@63167b60, Key[type=info.magnolia.cms.i18n.MessagesManager, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@9ac51e8b, Key[type=info.magnolia.cms.license.LicenseFileExtractor, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@e660a786, Key[type=info.magnolia.content2bean.TypeMapping, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@a0a859f1, Key[type=info.magnolia.context.SystemContext, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@f98910d0, Key[type=info.magnolia.cms.beans.config.VersionConfig, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@b2d693be, Key[type=info.magnolia.init.MagnoliaConfigurationProperties, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@69e0fc4f, Key[type=info.magnolia.jcr.registry.SessionProviderRegistry, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@1fa6adc2, Key[type=info.magnolia.transformer.BeanTypeResolver, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@be83187a, Key[type=info.magnolia.content2bean.TransformationState, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@a57e83b8, Key[type=info.magnolia.content2bean.Content2BeanTransformer, annotation=[none]]=info.magnolia.objectfactory.configuration.ImplementationConfiguration@753582eb}. Please ensure you don't have any legacy modules present in your web application.
com.google.inject.CreationException: Guice creation errors:
1) A binding to org.slf4j.Logger was already configured at [unknown source].
at info.magnolia.objectfactory.guice.GuiceParentBindingsModule.configure(GuiceParentBindingsModule.java:85)
1 error
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:411)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:167)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:119)
at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:100)
at com.google.inject.Guice.createInjector(Guice.java:95)
at com.google.inject.Guice.createInjector(Guice.java:83)
at info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder.build(GuiceComponentProviderBuilder.java:149)
at info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder.build(GuiceComponentProviderBuilder.java:196)
at info.magnolia.init.MagnoliaServletContextListener.contextInitialized(MagnoliaServletContextListener.java:168)
at info.magnolia.init.MagnoliaServletContextListener.contextInitialized(MagnoliaServletContextListener.java:128)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4643)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5109)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
18-11-02 17:38:49 ERROR PUBLIC[main]info.magnolia.init.MagnoliaServletContextListener: Oops, Magnolia could not be started
com.google.inject.CreationException: Guice creation errors:
最佳答案
该错误告诉您的是缺少各种类型映射。根据错误中提到的映射,我猜想这些是magnolia-core-x.y.z.jar:/META-INF/magnolia/core.xml
中通常描述的映射。 Jar本身或至少它包含的类必须位于类路径上,否则Magnolia甚至无法像启动时那样到达。对我来说,如何从jar中丢失映射文件是一个谜。
您是要从源代码编译Magnolia还是使用现有的预编译版本?或者,也许您在类路径中某处具有相同名称的文件,而该类文件是在magnolia-core.jar
中正确的文件之前由类加载器加载的?