0

所以我有这个在java文件中被调用的bean文件。看在上帝的份上,我无法弄清楚为什么会出现这个错误。

我尝试在互联网上进行研究或阅读有关 JCSMPChannelProperties 的信息(我没有找到)。

尝试更改 bean 的顺序(这无关紧要)。

可能有一个简单的修复。但是我想不通!!!

    Error creating bean with name 'broadCastService' defined in URL [file:/C:/EclipseWorkspace/NewWorkspace/ss_cache/bin/cacheQueryServiceContext.xml]: Cannot resolve reference to bean 'cacheQueryService' while setting bean property 'genericQueryService'; 
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheQueryService' defined in class path resource [muniOfferingQueryServiceContext.xml]: Cannot resolve reference to bean 'muni.JmsTemplate' while setting bean property 'jmsTopicTemplate'; 
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'muni.JmsTemplate' defined in class path resource [muniOfferingQueryServiceContext.xml]: Cannot resolve reference to bean 'muni.SolaceCachedConnectionFactory' while setting bean property 'connectionFactory'; 
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'muni.SolaceCachedConnectionFactory' defined in class path resource [muniOfferingQueryServiceContext.xml]: Cannot resolve reference to bean 'muni.SolaceConnectionFactory' while setting bean property 'targetConnectionFactory'; 
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'muni.SolaceConnectionFactory' defined in class path resource [muniOfferingQueryServiceContext.xml]: 


    Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.solacesystems.jcsmp.JCSMPChannelProperties.getConnectRetriesPerHost()I
4

1 回答 1

0

我将复制/粘贴我从上周提出的问题中得到的答案之一。

NoSuchMethodError 几乎总是由于库版本冲突。在这种情况下,我猜这两个项目中有多个版本的 joda 库。

同样,您可能有同一个库的多个版本。您可以使用以下代码(也从我的答案复制/粘贴)来检查从何处加载资源。

Class cls = your.clazz.Here.class; 
ProtectionDomain pDomain = cls.getProtectionDomain();
CodeSource cSource = pDomain.getCodeSource();
URL loc = cSource.getLocation();
System.out.println(loc);

参考问题:NoSuchMethodError - 从同一包中的类调用类/方法

于 2014-09-08T21:26:21.943 回答