WildFly GWT错误消息tomcat容器

时间:2017-02-15 08:12:42

标签: gwt jboss wildfly

在WildFly上部署我的应用程序后,我看到以下消息:

  

2017-02-15 10:06:51,440 ERROR [org.jboss.msc.service.fail]   (ServerService线程池 - 178)MSC000001:无法启动服务   jboss.undertow.deployment.default-server.default-host./cati:   服务中的org.jboss.msc.service.StartException   jboss.undertow.deployment.default-server.default-host./cati:   java.lang.NoSuchMethodError:   org.apache.tomcat.util.descriptor.DigesterFactory.newDigester(ZZLorg /阿帕奇/ Tomcat的/ util的/消化器/规则集; Z)Lorg /阿帕奇/ Tomcat的/ util的/消化器/蒸解;           在org.wildfly.extension.undertow.deployment.UndertowDeploymentService $ 1.run(UndertowDeploymentService.java:85)           at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)           at java.util.concurrent.FutureTask.run(FutureTask.java:266)           在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)           at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)           在java.lang.Thread.run(Thread.java:745)           在org.jboss.threads.JBossThread.run(JBossThread.java:320)引起:java.lang.NoSuchMethodError:   org.apache.tomcat.util.descriptor.DigesterFactory.newDigester(ZZLorg /阿帕奇/ Tomcat的/ util的/消化器/规则集; Z)Lorg /阿帕奇/ Tomcat的/ util的/消化器/蒸解;           在org.apache.tomcat.util.descriptor.tld.TldParser。(TldParser.java:49)           在org.apache.tomcat.util.descriptor.tld.TldParser。(TldParser.java:44)           在org.apache.jasper.servlet.TldScanner。(TldScanner.java:79)           在org.apache.jasper.servlet.JasperInitializer.newTldScanner(JasperInitializer.java:120)           在org.eclipse.jetty.apache.jsp.JettyJasperInitializer.newTldScanner(JettyJasperInitializer.java:115)           在org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:101)           在io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:184)           在org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)           在org.wildfly.extension.undertow.deployment.UndertowDeploymentService $ 1.run(UndertowDeploymentService.java:82)           ......还有6个

在我的maven项目中,我还导入以下依赖

<!-- GWT -->
    <!-- https://mvnrepository.com/artifact/com.google.gwt/gwt-user -->
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-user</artifactId>
        <version>2.8.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.google.gwt/gwt-servlet -->
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-servlet</artifactId>
        <version>2.8.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.google.gwt/gwt-dev -->
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-dev</artifactId>
        <version>2.8.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.tomcat</groupId>
        <artifactId>tomcat-util-scan</artifactId>
        <version>8.5.2</version>
    </dependency>   

当我阅读WildFly项目时,删除了Tomcat容器,这就是为什么我添加了以下依赖项:

    <dependency>
        <groupId>org.apache.tomcat</groupId>
        <artifactId>tomcat-util-scan</artifactId>
        <version>8.5.2</version>
    </dependency>   

任何想法如何绕过此错误消息?

2 个答案:

答案 0 :(得分:0)

当然不起作用,因为你可以看到你是否添加了测试以下依赖性(gwt-dev):

<dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-dev</artifactId>
        <version>2.8.0</version>
</dependency>

包括jetty服务器,这是从我的第一个问题接收消息的movtiv之一。

答案 1 :(得分:0)

确保不要使用编译时依赖性来破坏服务器端。

gwt-servlet仅适用于运行时,gwt-devgwt-user应设置为provided - 这会导致它们可用于编译为JavaScript,但将它们排除在外在应用程序服务器上的最终WAR文件中。

    <!-- GWT -->
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-servlet</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-user</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-dev</artifactId>
        <scope>provided</scope>
    </dependency>

但毕竟它看起来像你不应该尝试将任何Tomcat库放在WildFly服务器中,因为它已经包含了运行应用程序服务器部分的所有内容。 因此,只需坚持使用普通的servlet API:

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <scope>provided</scope>
    </dependency>

再次provided,因为WildFly内置了它。

您是否可以尝试排除Tomcat依赖项并查看它是否适合您?