保护Spring(4.2.8.RELEASE)Http远程方法导致创建bean时出错/未找到匹配的工厂方法:工厂bean

保护Spring(4.2.8.RELEASE)Http远程方法导致创建bean时出错/未找到匹配的工厂方法:工厂bean,spring,spring-mvc,spring-security,Spring,Spring Mvc,Spring Security,现在的例子是: 我正在尝试保护使用HttpInvokerServiceExporter发布的方法。当我将@Secured添加到正在发布的类中的方法时,我在创建名为“/DocSaveServiceHttpFacade”的bean时出错,该bean在类路径资源[com/ttinc/docSaveExample/web/remoteService/docSave/DocSaveServiceHttpRemoteImpl.class]:未找到匹配的工厂方法:工厂bean“docSaveServiceHt

现在的例子是:

我正在尝试保护使用HttpInvokerServiceExporter发布的方法。当我将@Secured添加到正在发布的类中的方法时,我在创建名为“/DocSaveServiceHttpFacade”的bean时出错,该bean在类路径资源[com/ttinc/docSaveExample/web/remoteService/docSave/DocSaveServiceHttpRemoteImpl.class]:未找到匹配的工厂方法:工厂bean“docSaveServiceHttpRemoteFacade”;工厂方法“DocSaveServiceHttpRemoteFacade()”。检查具有指定名称的方法是否存在,以及该方法是否为非静态方法

应用程序已经具有Spring安全性(4.2.8.RELEASE)。在方法层面上工作。我已经测试过它与@Secured commented一起工作,但是当@Secured存在时失败

我尝试过的不仅仅是服务,结果也是一样的

将@Secured放在一个不被导出的方法上,一切都很好

我在谷歌上搜索了一下,但似乎什么也找不到

下面是我如何编码它的,以及我得到的堆栈跟踪

@组件(value=“docSaveServiceHttpRemoteFacade”) @条件(RemoteBeanPublishingValidator.class) 公共类DocSaveServiceHttpRemoteImpl 扩展DocSaveServiceRemoteBase{

@Bean(name=“/DocSaveServiceHttpFacade”)
公共HttpInvokerServiceExporter DocSaveServiceHttpRemoteFacade(){ HttpInvokerServiceExporter导出器= 新的HttpInvokerServiceExporter();
出口商。设置服务(本); exporter.setServiceInterface(DocSaveService.class);
返回导出器;}

@覆盖@Secured(“InternetUsers”)
public ExpressDocumentBase saveExpressDocument(ExpressDocumentBase doc, 输入流(源){ 返回docSaveService.saveExpressDocument(文档,源);
}

我希望它能像在非导出方法上一样工作

我得到的是:

2019-09-12 11:20:07550警告org.springframework.web.context.support.AnnotationConfigWebApplicationContext==>上下文初始化期间遇到异常-取消刷新尝试:org.springframework.beans.factory.beancreatitionException:创建名为“/DocSaveServiceHttpFacade”的bean时出错,该bean在类路径资源中定义[com/ttinc/docSaveExample/web/remoteService/docSave/DocSaveServiceHttpRemoteImpl.class]:未找到匹配的工厂方法:工厂bean'docSaveServiceHttpRemoteFacade';工厂方法'docSaveServiceHttpRemoteFacade()'。请检查具有指定名称的方法是否存在以及该方法是否为非静态方法。 2019-09-12 11:20:07551错误org.springframework.web.context.ContextLoader==>上下文初始化失败:org.springframework.beans.factory.BeanCreationException:创建名为“/DocSaveServiceHttpFacade”的bean时出错,该bean在类路径资源[com/ttinc/docSaveExample/web/remoteService/docSave/docsaveServiceHttpEmplate.class]中定义:未找到匹配的工厂方法:工厂bean“docSaveServiceHttpRemoteFacade”;工厂方法“docSaveServiceHttpRemoteFacade()”。请检查具有指定名称的方法是否存在,以及该方法是否为非静态方法。 位于org.springframework.beans.factory.support.ConstructorResolver.InstanceUsingFactoryMethod(ConstructorResolver.java:549) 位于org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.InstanceUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1178) 位于org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1072) 位于org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511) 位于org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481) 位于org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) 位于org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) 位于org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) 位于org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) 位于org.springframework.beans.factory.support.DefaultListableBeanFactory.PreInstanceSingleton(DefaultListableBeanFactory.java:761) 位于org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) 位于org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) 位于org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443) 位于org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325) 位于org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) 位于io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187) 位于io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:216) 位于io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:185) 位于io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42) 位于io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) 位于org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105) 位于org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoS