Проблема при развертывании war в jetty

Здравствуйте.

Пытаюсь развернуть тестовое приложение как описано тут https://docs.cuba-platform.com/cuba/6.0/manual/ru/html-single/manual.html#war_deployment

При запуске получаю ошибку

Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'cuba_DataManager' for bean class [com.haulmont.cuba.core.app.DataManagerBean] conflicts with existing, non-compatible bean definition of same name and class [com.haulmont.cuba.client.sys.DataManagerClientImpl]

Подскажите, пожалуйста, в чем может быть проблема?

Добрый день.

Я правильно понимаю, что Вы собрали single WAR (одно приложение для web и core )?

Если нет - пришлите пожалуйста ваш build.gradle и сам WAR-файл.

Да, разворачивал в single.
Поставил singleWar=false теперь такая проблема


14:45:23.346 WARN  [main] com.haulmont.cuba.core.sys.CubaClassPathXmlApplicationContext - Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cuba_NumberIdSource': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.haulmont.cuba.core.app.NumberIdService com.haulmont.cuba.client.sys.NumberIdSourceClientImpl.service; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.ui.velocity.VelocityEngineFactoryBean] for bean with name 'velocityEngine' defined in class path resource [web-spring.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.ui.velocity.VelocityEngineFactoryBean

Через студию все работает без ошибок.

Давайте закончим с single сперва.

Вы создали специальный web.xml для single WAR и прописали его в билд таске?

task buildWar(type: CubaWarBuilding) {
    appHome = '..'
    webXml = "${webModule.projectDir}/web/WEB-INF/single-war-web.xml"
}

Нет, специального не создавал. В документации про это ни слова (

Вообще в документации это есть (см. ниже).
Для singleWar требуется специальный web.xml, потому что приложение инициализируется листнерами, а не как обычно.

https://doc.cuba-platform.com/manual-6.0/build.gradle_buildWar.html
Example of single-war-web.xml:


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5">

    <!-- Web Client parameters -->

    <context-param>
        <description>List of app properties files for Web Client</description>
        <param-name>appPropertiesConfigWeb</param-name>
        <param-value>
            classpath:cuba-web-app.properties
            classpath:web-app.properties
            /WEB-INF/local.app.properties
        </param-value>
    </context-param>
    <context-param>
        <description>Vaadin production mode</description>
        <param-name>productionMode</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <description>Web resources version for correct caching in browser</description>
        <param-name>webResourcesTs</param-name>
        <param-value>${webResourcesTs}</param-value>
    </context-param>
    <context-param>
        <description>Web client UI class</description>
        <param-name>UI</param-name>
        <param-value>com.haulmont.cuba.web.AppUI</param-value>
    </context-param>
    <context-param>
        <description>Web Client UIProvider class</description>
        <param-name>UIProvider</param-name>
        <param-value>com.haulmont.cuba.web.sys.CubaUIProvider</param-value>
    </context-param>
    <context-param>
        <description>Web Client Application class</description>
        <param-name>application</param-name>
        <param-value>com.company.sample.web.App</param-value>
    </context-param>
    <context-param>
        <description>Web Client Widgetset name</description>
        <param-name>widgetset</param-name>
        <param-value>com.haulmont.cuba.web.toolkit.ui.WidgetSet</param-value>
    </context-param>

    <!-- Middleware parameters -->

    <context-param>
        <description>List of app properties files for Middleware</description>
        <param-name>appPropertiesConfigCore</param-name>
        <param-value>
            classpath:cuba-app.properties
            classpath:app.properties
            /WEB-INF/local.app.properties
        </param-value>
    </context-param>

    <!-- Servlet context listeners that load the application blocks -->

    <listener>
        <listener-class>com.haulmont.cuba.core.sys.singleapp.SingleAppCoreServletListener</listener-class>
    </listener>
    <listener>
        <listener-class>com.haulmont.cuba.web.sys.singleapp.SingleAppWebServletListener</listener-class>
    </listener>
</web-app>

UPD: Упс, прошу прощения. В русской тоже все есть, но в другом разделе https://docs.cuba-platform.com/cuba/6.0/manual/ru/html-single/manual.html#build.gradle_buildWar

Я смотрел по этой инструкции https://docs.cuba-platform.com/cuba/6.0/manual/ru/html-single/manual.html#war_deployment
Видимо у вас рассогласование в русской и английской версии.

По второй проблеме отдельный топик делать или в рамках этого сможем разобрать?

В русской версии это тоже есть, но оно видимо не очень удобно разделено на 2 части.
https://docs.cuba-platform.com/cuba/6.0/manual/ru/html-single/manual.html#build.gradle_buildWar
и
https://docs.cuba-platform.com/cuba/6.0/manual/ru/html-single/manual.html#war_deployment

По второй проблеме давайте здесь же.

Можете прислать web-spring.xml?

С ошибкой вроде как разобрался самостоятельно.
Спасибо за помощь.