AbstractMethodError при тестировании приложения Spring - PullRequest
0 голосов
/ 18 декабря 2018

У меня проблема с запуском теста.У меня есть класс с некоторой логикой, и я могу использовать метод этого класса из развернутой версии на сервере.

В основном методы принимают аргумент массива, который включает список свойств.

Я пишу тест и выполняю его с помощью JUnit, который вызывает тот же метод с теми же параметрами.Хотя метод и параметры совпадают, я получаю исключение из сторонних библиотек, что очень странно.

java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myBean' defined in class path resource [mySpringContext.xml]: Initialization of bean failed; nested exception is java.lang.AbstractMethodError: com.tars.common.implementation.DeliveryProperty.isSingleton()Z
            at ..
        ....
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myBean' defined in class path resource [mySpringContext.xml]: Initialization of bean failed; nested exception is java.lang.AbstractMethodError: com.tars.common.implementation.DeliveryProperty.isSingleton()Z
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)
            at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
            at com.tars.common.MySpringContext.startcontext(MySpringContext.java:72)

Почему я получаю эту ошибку, хотя могу выполнить тот же метод с теми же параметрами надсервер?Что может быть не так?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...