升级magnolia到5.6.1,vaadin资源

Posted

技术标签:

【中文标题】升级magnolia到5.6.1,vaadin资源【英文标题】:Upgrading magnolia to 5.6.1, vaadin resources 【发布时间】:2018-01-23 12:54:34 【问题描述】:

Tomcat启动Magnolia后,总是报如下错误:

17:04:36.781 [localhost-startStop-1] ERROR info.magnolia.module.ModuleManagerImpl - Can't start module ui-framework
com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: com/vaadin/data/util/converter/Converter$ConversionException
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2216) ~[guava-23.1-jre.jar:?]

后来当我请求管理页面时,我不断收到这些错误。

INFO: Requested resource [/VAADIN/themes/valo/styles.css] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.
Jan 23, 2018 12:50:50 PM com.vaadin.server.VaadinServlet serveStaticResourcesInVAADIN
INFO: Requested resource [/VAADIN/themes/valo/favicon.ico] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.

除其他外,我已将我认为需要的所有内容都包含在 UI 框架的依赖项中:

<project>
  <!-- ... -->
  <dependency>
    <groupId>info.magnolia.ui</groupId>
    <artifactId>magnolia-ui-framework</artifactId>
    <version>$magnoliaUiVersion</version>
  </dependency>
  <dependency>
    <groupId>info.magnolia.ui</groupId>
    <artifactId>magnolia-ui-admincentral</artifactId>
    <version>$magnoliaUiVersion</version>
  </dependency>
  <dependency>
    <groupId>info.magnolia.ui</groupId>
    <artifactId>magnolia-ui-contentapp</artifactId>
    <version>$magnoliaUiVersion</version>
  </dependency>
</project>

编辑 1:

所以我在 Magnolia Travel Demo 中发现 magnolia-resources 是版本 2.4。当您使用此版本(和 Magnolia 5.6.1 Core)运行它时,登录屏幕不会显示 Magnolia 徽标。当我升级到2.6版本时,出现了Magnolia logo。


编辑 2:

我现在可以登录了,但 admincentral 卡在加载中。几秒钟后,弹出以下消息:

Failed to load the widgetset: ./../VAADIN/widgetsets/info.magnolia.widgetset.MagnoliaWidgetSet/info.magnolia.widgetset.MagnoliaWidgetSet.nocache.js?1516882029507

POM 如下:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd ">
    <modelVersion>4.0.0</modelVersion>
    <groupId><!-- hidden --></groupId>
    <artifactId><!-- hidden --></artifactId>
    <name><!-- hidden --></name>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <description><!-- hidden --></description>

    <properties>
        <magnoliaVersion>5.6.1</magnoliaVersion>
        <magnoliaUiVersion>5.6.1</magnoliaUiVersion>
        <magnoliaDamVersion>2.3</magnoliaDamVersion>
        <magnoliaPasswordManagerVersion>1.2</magnoliaPasswordManagerVersion>
        <magnoliaImagingVersion>3.4</magnoliaImagingVersion>
        <magnoliaCategorizationVersion>2.6</magnoliaCategorizationVersion>
        <magnoliaTemplatingVersion>1.2</magnoliaTemplatingVersion>
        <magnoliaResourcesVersion>2.6</magnoliaResourcesVersion>
        <magnoliaFormVersion>2.4</magnoliaFormVersion>
        <magnoliaSiteVersion>1.2</magnoliaSiteVersion>
        <vaadinVersion>8.1.5</vaadinVersion>
        <mavenCompilerVersion>3.6.1</mavenCompilerVersion>
        <tomcat7Version>2.2</tomcat7Version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- info.magnolia -->
            <dependency>
                <groupId>info.magnolia</groupId>
                <artifactId>magnolia-project</artifactId>
                <version>$magnoliaVersion</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>info.magnolia.ui</groupId>
                <artifactId>magnolia-ui-project</artifactId>
                <version>$magnoliaUiVersion</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>info.magnolia.cache</groupId>
                <artifactId>magnolia-cache-core</artifactId>
                <version>$magnoliaVersion</version>
            </dependency>
            <dependency>
                <groupId>info.magnolia.site</groupId>
                <artifactId>magnolia-site</artifactId>
                <version>$magnoliaSiteVersion</version>
            </dependency>

            <!-- info.magnolia.dam -->
            <dependency>
                <groupId>info.magnolia.dam</groupId>
                <artifactId>magnolia-dam-templating</artifactId>
                <version>$magnoliaDamVersion</version>
            </dependency>
            <dependency>
                <groupId>info.magnolia.dam</groupId>
                <artifactId>magnolia-dam-jcr</artifactId>
                <version>$magnoliaDamVersion</version>
            </dependency>
            <dependency>
                <groupId>info.magnolia.dam</groupId>
                <artifactId>magnolia-dam-api</artifactId>
                <version>$magnoliaDamVersion</version>
            </dependency>
            <dependency>
                <groupId>info.magnolia.dam</groupId>
                <artifactId>magnolia-dam-app</artifactId>
                <version>$magnoliaDamVersion</version>
            </dependency>
            <dependency>
                <groupId>info.magnolia.dam</groupId>
                <artifactId>magnolia-dam-imaging</artifactId>
                <version>$magnoliaDamVersion</version>
            </dependency>

            <!-- info.magnolia.imaging -->
            <dependency>
                <groupId>info.magnolia.imaging</groupId>
                <artifactId>magnolia-imaging</artifactId>
                <version>$magnoliaImagingVersion</version>
            </dependency>
            <dependency>
                <groupId>info.magnolia.imaging</groupId>
                <artifactId>magnolia-imaging-support</artifactId>
                <version>$magnoliaImagingVersion</version>
            </dependency>

            <!-- info.magnolia.passwordmanager -->
            <dependency>
                <groupId>info.magnolia.passwordmanager</groupId>
                <artifactId>magnolia-module-password-manager</artifactId>
                <version>$magnoliaPasswordManagerVersion</version>
            </dependency>

            <!--  info.magnolia.resources -->
            <dependency>
                <groupId>info.magnolia.boms</groupId>
                <artifactId>magnolia-external-dependencies</artifactId>
                <version>$magnoliaVersion</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>info.magnolia.resources</groupId>
                <artifactId>magnolia-resources</artifactId>
                <version>$magnoliaResourcesVersion</version>
            </dependency>

            <!-- info.magnolia.categorization -->
            <dependency>
                <groupId>info.magnolia.categorization</groupId>
                <artifactId>magnolia-categorization</artifactId>
                <version>$magnoliaCategorizationVersion</version>
            </dependency>

            <!-- info.magnolia.templating -->
            <dependency>
                <groupId>info.magnolia.templating</groupId>
                <artifactId>magnolia-templating-kit</artifactId>
                <version>$magnoliaTemplatingVersion</version>
            </dependency>
            <dependency>
                <groupId>info.magnolia.templating</groupId>
                <artifactId>magnolia-templating-essentials-models</artifactId>
                <version>$magnoliaTemplatingVersion</version>
            </dependency>

            <!-- info.magnolia.form -->
            <dependency>
                <groupId>info.magnolia.form</groupId>
                <artifactId>magnolia-form</artifactId>
                <version>$magnoliaFormVersion</version>
            </dependency>

            <!--  com.vaadin -->
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-compatibility-server</artifactId>
                <version>$vaadinVersion</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-server</artifactId>
                <version>$vaadinVersion</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <id>magnolia.public</id>
            <url>https://nexus.magnolia-cms.com/content/groups/public</url>
            <snapshots />
        </repository>
        <!-- IF YOU NEED MODULES FROM THE ENTERPRISE VERSION, UNCOMMENT THE FOLLOWING REPOSITORY -->
        <!--
        <repository>
          <id>magnolia.enterprise.releases</id>
          <url>https://nexus.magnolia-cms.com/content/repositories/magnolia.enterprise.releases</url>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
        -->
        <repository>
            <id>vaadin-addons</id>
            <url>https://maven.vaadin.com/vaadin-addons</url>
        </repository>
    </repositories>

    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <profileName>default</profileName>
                <downloadSources>true</downloadSources>
                <downloadJavadocs>true</downloadJavadocs>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.tomcat.maven</groupId>
                        <artifactId>tomcat7-maven-plugin</artifactId>
                        <version>$tomcat7Version</version>
                        <configuration>
                            <path>/</path>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>$mavenCompilerVersion</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <modules>
        <module><!-- hidden -->-webapp</module>
        <module><!-- hidden -->-blossom</module>
    </modules>
</project>

有什么想法吗?

【问题讨论】:

【参考方案1】:

请查看https://documentation.magnolia-cms.com/display/DOCS56/Upgrading+to+Magnolia+5.6.x。尤其是 Vaadin8 升级和 BOM 的一部分。我相信你必须从 BOM 项目中导入依赖管理部分。

希望这会有所帮助, 干杯,

【讨论】:

嘿,我认为解决这个问题已经迈出了一步,但每次我尝试运行 tomcat7:run: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: com/vaadin/data/util/converter/Converter$ConversionException 我在项目中的任何地方都没有引用 Vaadin ,我很困惑这会出现在哪里。你还有什么可以推荐的吗? 是的,请从 BOM 项目中导入依赖管理部分,这将为您带来 vaadin7 兼容性模块,如果没有,请将其添加到您的项目中。我的猜测是您针对旧版本的 Magnolia 运行代码(可能是自定义模块或任何东西。也可能是 UI 5.4)。有帮助吗? 我添加了它,但它没有帮助。还有其他想法吗? 现在再看一遍,很明显有一个模块需要升级。必须有一个使用该转换器的自定义模块或代码:S 我从 Magnolia travel 演示中获得了 POM。你能自己运行吗?

以上是关于升级magnolia到5.6.1,vaadin资源的主要内容,如果未能解决你的问题,请参考以下文章

JSP 未在 Magnolia 5.2.5 中呈现

Magnolia CMS:对话框太宽

Magnolia 从 5.3.4 升级到最新版本

Magnolia Combobox 自定义不显示

使用 Blossom 在 Magnolia CMS 对话框中创建自定义字段

使用 RegexpVirtualURIMapping 映射到 Magnolia 中的静态目录