[英]SpringJUnit4ClassRunner tests — work from ant, not from IDE
I have some tests that load up some Spring context files. 我有一些测试可以加载一些Spring上下文文件。 When I run the tests from my ant target they work as expected.
当我从蚂蚁目标运行测试时,它们将按预期工作。 When I run them from IntelliJ I get a NotWritablePropertyException.
当我从IntelliJ运行它们时,我收到一个NotWritablePropertyException。 I initially figured different classpaths, but the only differences are for IntelliJ's test runner.
我最初想出了不同的类路径,但是唯一的区别是IntelliJ的测试运行程序。
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'sessionAcknowledgeMode' of bean class [org.springframework.jms.listener.DefaultMessageListenerContainer]: Bean property 'sessionAcknowledgeMode' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:801)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:651)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1276)
... 42 more
It is possible you have some classpath issues. 您可能有一些类路径问题。 Idea may load resource files in a different way from command line ant call.
Idea可能以与命令行ant调用不同的方式加载资源文件。
The classpaths were not the same. 类路径不同。 Sorry folks.
抱歉
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.