gpt4 book ai didi

java - Guice 创建错误 Magnolia

转载 作者:行者123 更新时间:2023-11-28 22:47:38 25 4
gpt4 key购买 nike

我正在为我所雇用的公司开展一个项目。他们正在使用 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 (build 1.8.0_191-b12),magnolia 版本不是最新版本(我会找出来更新)。

    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:

enter image description here

最佳答案

错误告诉您的是缺少各种类型映射。根据错误中提到的映射,我猜这些是通常在 magnolia-core-x.y.z.jar:/META-INF/magnolia/core.xml 中描述的映射。 Jar 本身或至少它包含的类必须位于类路径中,否则 Magnolia 甚至无法像它那样在启动时走得那么远。你怎么会从 jar 中丢失映射文件对我来说是个谜。

您是尝试从源代码编译 Magnolia 还是使用现有的预编译版本?或者,也许您在类路径中某处有同名文件,该文件由类加载器在 magnolia-core.jar 中的正确文件之前加载?

关于java - Guice 创建错误 Magnolia,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53135015/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com