gpt4 book ai didi

java - org.springframework.beans.factory.UnsatisfiedDependencyException moskito

转载 作者:行者123 更新时间:2023-11-30 06:45:15 24 4
gpt4 key购买 nike

Tomcat8 (jdk8) 未启动。我使用的是 moskito 版本 2.4.3。它已经被开发人员嵌入了,不知道我错过了什么。

你能指点我一下吗?谢谢

04-May-2017 16:22:07.553 SEVERE [localhost-startStop-1] org.springframework.web.context.ContextLoader.initWebApplicationContext Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sessionListener' defined in class path resource [monitoringContext-web.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [javax.servlet.Filter]: Could not convert factory method argument value of type [net.anotheria.moskito.web.session.SessionCountProducer] to required type [javax.servlet.Filter]: Failed to convert value of type [net.anotheria.moskito.web.session.SessionCountProducer] to required type [javax.servlet.Filter]; nested exception is java.lang.IllegalStateException: Cannot convert value of type [net.anotheria.moskito.web.session.SessionCountProducer] to required type [javax.servlet.Filter]: no matching editors or conversion strategy found
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:724)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:464)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:596)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1805)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
May 04, 2017 4:22:07 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
May 04, 2017 4:22:07 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/myapp] startup failed due to previous errors

使用这些依赖项:

moskito-aop-2.4.3.jar
moskito-central-connectors-common-1.1.0.jar
moskito-central-embedded-common-1.1.0.jar
moskito-core-2.4.4.jar

这里是monitoringContext-web.xml。

    <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">

<bean id="uiUrlBuilderFilter" factory-bean="applicationFilters" factory-method="add">
<constructor-arg>
<bean class="net.domain.myapp.monitoring.filters.ApplicationContextUrlBuilderFilter" />
</constructor-arg>
</bean>
<bean id="methodFilter" factory-bean="applicationFilters" factory-method="add">
<constructor-arg>
<bean class="net.anotheria.moskito.web.filters.MethodFilter" />
</constructor-arg>
</bean>
<bean id="userAgentFilter" factory-bean="applicationFilters" factory-method="add">
<constructor-arg>
<bean class="net.anotheria.moskito.web.filters.UserAgentFilter" />
</constructor-arg>
</bean>

<bean id="sessionListener" factory-bean="applicationFilters" factory-method="add">
<constructor-arg>
<bean class="net.anotheria.moskito.web.session.SessionCountProducer" />
</constructor-arg>
</bean>
</beans>

最佳答案

问题是您正在使用创建过滤器的工厂。我认为这不是声明 session 计数器的方法。您应该为 LISTENERS 找到另一个工厂,或者按照此处所述在 web.xml 中自行声明

https://confluence.opensource.anotheria.net/display/MSK/MoSKito-Essential+Integration+Guide#MoSKito-EssentialIntegrationGuide-Listeners

关于java - org.springframework.beans.factory.UnsatisfiedDependencyException moskito,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43786534/

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