所以我有一个在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
答案 0 :(得分: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 - Calling Class/Method from Class in Same Package