com.google.inject.CreationException:无法创建注射器,请参见以下错误

时间:2018-12-04 08:55:21

标签: tomcat intellij-idea repository workspace magnolia

我在PC上的木兰中创建了一个项目,现在我不得不更改为另一个项目。当我安装完所有软件并尝试使用Intellij启动tomcat时,它显示以下错误:

1) Error injecting constructor, java.lang.RuntimeException: Something went wrong, version workspace for repository magnolia does not exist.
  at info.magnolia.cms.core.version.VersionManager.<init>(VersionManager.java:72)
  at info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule.bindImplementation(GuiceComponentConfigurationModule.java:155) (via modules: com.google.inject.util.Modules$OverrideModule -> com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule)
  while locating info.magnolia.cms.core.version.VersionManager

2) null returned by binding at info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule.bindProvider(GuiceComponentConfigurationModule.java:182) (via modules: com.google.inject.util.Modules$OverrideModule -> com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule)
 but the 1st parameter of info.magnolia.task.persistence.TasksStoreImpl.<init>(TasksStoreImpl.java:88) is not @Nullable
  at info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule.bindProvider(GuiceComponentConfigurationModule.java:182) (via modules: com.google.inject.util.Modules$OverrideModule -> com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule)
  while locating info.magnolia.cms.security.SecuritySupport
    for the 1st parameter of info.magnolia.task.persistence.TasksStoreImpl.<init>(TasksStoreImpl.java:88)
  at info.magnolia.task.persistence.TasksStoreImpl.class(TasksStoreImpl.java:75)
  while locating info.magnolia.task.persistence.TasksStoreImpl
  while locating info.magnolia.task.persistence.TasksStore

3) null returned by binding at info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule.bindProvider(GuiceComponentConfigurationModule.java:182) (via modules: com.google.inject.util.Modules$OverrideModule -> com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule)
 but the 1st parameter of info.magnolia.task.persistence.TasksStoreImpl.<init>(TasksStoreImpl.java:88) is not @Nullable
  at info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule.bindProvider(GuiceComponentConfigurationModule.java:182) (via modules: com.google.inject.util.Modules$OverrideModule -> com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule)
  while locating info.magnolia.cms.security.SecuritySupport
    for the 1st parameter of info.magnolia.task.persistence.TasksStoreImpl.<init>(TasksStoreImpl.java:88)
  at info.magnolia.task.persistence.TasksStoreImpl.class(TasksStoreImpl.java:75)
  while locating info.magnolia.task.persistence.TasksStoreImpl
  while locating info.magnolia.task.persistence.TasksStore
    for the 1st parameter of info.magnolia.task.DefaultTasksManager.<init>(DefaultTasksManager.java:62)
  at info.magnolia.task.DefaultTasksManager.class(DefaultTasksManager.java:62)
  while locating info.magnolia.task.DefaultTasksManager
  while locating info.magnolia.task.TasksManager

4) null returned by binding at info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule.bindProvider(GuiceComponentConfigurationModule.java:182) (via modules: com.google.inject.util.Modules$OverrideModule -> com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule)
 but the 1st parameter of info.magnolia.freemarker.FreemarkerHelper.<init>(FreemarkerHelper.java:96) is not @Nullable
  at info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule.bindProvider(GuiceComponentConfigurationModule.java:182) (via modules: com.google.inject.util.Modules$OverrideModule -> com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule)
  while locating info.magnolia.freemarker.FreemarkerConfig
    for the 1st parameter of info.magnolia.freemarker.FreemarkerHelper.<init>(FreemarkerHelper.java:96)
  at info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule.bindImplementation(GuiceComponentConfigurationModule.java:155) (via modules: com.google.inject.util.Modules$OverrideModule -> com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule)
  while locating info.magnolia.freemarker.FreemarkerHelper

5) null returned by binding at info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule.bindProvider(GuiceComponentConfigurationModule.java:182) (via modules: com.google.inject.util.Modules$OverrideModule -> com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule)
 but the 1st parameter of info.magnolia.task.persistence.TasksStoreImpl.<init>(TasksStoreImpl.java:88) is not @Nullable
  at info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule.bindProvider(GuiceComponentConfigurationModule.java:182) (via modules: com.google.inject.util.Modules$OverrideModule -> com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule)
  while locating info.magnolia.cms.security.SecuritySupport
    for the 1st parameter of info.magnolia.task.persistence.TasksStoreImpl.<init>(TasksStoreImpl.java:88)
  at info.magnolia.task.persistence.TasksStoreImpl.class(TasksStoreImpl.java:75)
  while locating info.magnolia.task.persistence.TasksStoreImpl
  while locating info.magnolia.task.persistence.TasksStore
    for the 1st parameter of info.magnolia.task.DefaultTasksManager.<init>(DefaultTasksManager.java:62)
  at info.magnolia.task.DefaultTasksManager.class(DefaultTasksManager.java:62)
  while locating info.magnolia.task.DefaultTasksManager

6) null returned by binding at info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule.bindProvider(GuiceComponentConfigurationModule.java:182) (via modules: com.google.inject.util.Modules$OverrideModule -> com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule)
 but the 1st parameter of info.magnolia.task.persistence.TasksStoreImpl.<init>(TasksStoreImpl.java:88) is not @Nullable
  at info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule.bindProvider(GuiceComponentConfigurationModule.java:182) (via modules: com.google.inject.util.Modules$OverrideModule -> com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule)
  while locating info.magnolia.cms.security.SecuritySupport
    for the 1st parameter of info.magnolia.task.persistence.TasksStoreImpl.<init>(TasksStoreImpl.java:88)
  at info.magnolia.task.persistence.TasksStoreImpl.class(TasksStoreImpl.java:75)
  while locating info.magnolia.task.persistence.TasksStoreImpl

6 errors
    at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:543)
    at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:186)
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
    at com.google.inject.Guice.createInjector(Guice.java:87)
    at com.google.inject.Guice.createInjector(Guice.java:78)
    at info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder.build(GuiceComponentProviderBuilder.java:149)
    at info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder.build(GuiceComponentProviderBuilder.java:196)
    at info.magnolia.cms.beans.config.ConfigLoader.load(ConfigLoader.java:142)
    at info.magnolia.init.MagnoliaServletContextListener$1.doExec(MagnoliaServletContextListener.java:259)
    at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:407)
    at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:404)
    at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:378)
    at info.magnolia.init.MagnoliaServletContextListener.startServer(MagnoliaServletContextListener.java:256)
    at info.magnolia.init.MagnoliaServletContextListener.contextInitialized(MagnoliaServletContextListener.java:182)
    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.addChildInternal(ContainerBase.java:742)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
    at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1737)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:287)
    at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809)
    at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:457)
    at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:406)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:287)
    at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809)
    at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1466)
    at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307)
    at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1399)
    at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:827)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
    at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
    at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: Something went wrong, version workspace for repository magnolia does not exist.
    at info.magnolia.cms.core.version.BaseVersionManager.<init>(BaseVersionManager.java:152)
    at info.magnolia.cms.core.version.VersionManager.<init>(VersionManager.java:72)
    at info.magnolia.cms.core.version.VersionManager$$FastClassByGuice$$d6682ab7.newInstance(<generated>)
    at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
    at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:148)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
    at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:211)
    at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:182)
    ... 57 more
04-Dec-2018 09:42:57.958 SEVERE [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
04-Dec-2018 09:42:58.005 SEVERE [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Falló en arranque del Contexto [/diagnostic_project_webapp_war_exploded] debido a errores previos
2018-12-04 09:42:58,036 INFO  info.magnolia.repository.DefaultRepositoryManager : Shutting down JCR
2018-12-04 09:42:58,036 WARN  info.magnolia.repository.WorkspaceMapping         : Failed to retrieve repository provider 'magnolia'. Your Magnolia instance might not have been initialized properly.
[2018-12-04 09:42:58,052] Artifact diagnostic-project-webapp:war exploded: Error during artifact deployment. See server log for details.

我在项目中使用的是木兰版本5.7,在Java中的版本是1.8。该项目正在另一台PC上运行,我不知道发生了什么事...

谢谢!

1 个答案:

答案 0 :(得分:2)

我发现自己做错了。 intellij IDEA使用的Java版本是11,我需要使用Java的jdk 1.8。