如何使用wildfly10启动springboot项目

时间:2017-10-19 14:17:35

标签: spring-boot wildfly-10

我有一个用弹簧靴制作的项目,我无法从wildfly10开始。如何选择我要上传应用程序的方式?我是否使用Tomcat嵌入或野蝇?

 <dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-web</artifactId>
   <exclusions>
    <exclusion>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-tomcat</artifactId>
    </exclusion>
  </exclusions>
 </dependency>

ERRO:

Caused by: java.lang.NoSuchMethodError: org.apache.tomcat.util.descriptor.DigesterFactory.newDigester(ZZLorg/apache/tomcat/util/digester/RuleSet;Z)Lorg/apache/tomcat/util/digester/Digester;
    at org.apache.tomcat.util.descriptor.tld.TldParser.<init>(TldParser.java:49)
    at org.apache.tomcat.util.descriptor.tld.TldParser.<init>(TldParser.java:44)
    at org.apache.jasper.servlet.TldScanner.<init>(TldScanner.java:84)
    at org.apache.jasper.servlet.JasperInitializer.newTldScanner(JasperInitializer.java:118)
    at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:99)
    at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:186)
    at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:171)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:234)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
    ... 6 more

11:03:40,274 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "Licitar-0.0.1-SNAPSHOT.war")]) - failure description: {
    "WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host.\"/Licitar-0.0.1-SNAPSHOT\"" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host.\"/Licitar-0.0.1-SNAPSHOT\": java.lang.NoSuchMethodError: org.apache.tomcat.util.descriptor.DigesterFactory.newDigester(ZZLorg/apache/tomcat/util/digester/RuleSet;Z)Lorg/apache/tomcat/util/digester/Digester;
    Caused by: java.lang.NoSuchMethodError: org.apache.tomcat.util.descriptor.DigesterFactory.newDigester(ZZLorg/apache/tomcat/util/digester/RuleSet;Z)Lorg/apache/tomcat/util/digester/Digester;"},
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.undertow.deployment.default-server.default-host.\"/Licitar-0.0.1-SNAPSHOT\""],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
}
11:03:40,281 ERROR [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0021: Deploy of deployment "Licitar-0.0.1-SNAPSHOT.war" was rolled back with the following failure message: 
{
    "WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host.\"/Licitar-0.0.1-SNAPSHOT\"" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host.\"/Licitar-0.0.1-SNAPSHOT\": java.lang.NoSuchMethodError: org.apache.tomcat.util.descriptor.DigesterFactory.newDigester(ZZLorg/apache/tomcat/util/digester/RuleSet;Z)Lorg/apache/tomcat/util/digester/Digester;
    Caused by: java.lang.NoSuchMethodError: org.apache.tomcat.util.descriptor.DigesterFactory.newDigester(ZZLorg/apache/tomcat/util/digester/RuleSet;Z)Lorg/apache/tomcat/util/digester/Digester;"},
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.undertow.deployment.default-server.default-host.\"/Licitar-0.0.1-SNAPSHOT\""],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
}

Obs:我可以通过tomcat embargoed启动项目。

2 个答案:

答案 0 :(得分:1)

Spring Boot绝对可以与JEE容器一起使用,请查看此存储库,以获取有关将Spring Boot应用程序部署为战争的示例。

https://github.com/Pytry/bootiful-war-deployment

看看&#34; jee-example&#34;模块,让我知道这是否适合你在野生动物。 如果无法访问您的一些示例代码,则很难确定错误,但这里有一些要查找的内容并与示例进行比较:

你有一个扩展SpringBootServletInitializer的类吗?

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;

@Slf4j
@SpringBootApplication
public class JeeServletInitializer extends SpringBootServletInitializer{

    @Value("${messageForUser}")
    private String message;

    @Value("${whatDoesTheFoxSay:'No body knows.'}")
    private String whatDoesTheFoxSay;

    public static void main(String[] args){

        SpringApplication.run(JeeServletInitializer.class, args);
    }

    @Override
    public SpringApplicationBuilder configure(SpringApplicationBuilder application){

        log.info(
            "\n*********************\n" +
                "What does the fox say?\n" +
                whatDoesTheFoxSay +
                "\n*********************\n");
        return application.sources(JeeServletInitializer.class);
    }
}

您是否排除了tomcat启动器依赖项?

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-web</artifactId>
  <exclusions>
    <exclusion>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-tomcat</artifactId>
    </exclusion>
  </exclusions>
</dependency>

您是否包含适合您的Wildfly实例的javax.servlet:javax.servlet-api版本?

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

答案 1 :(得分:0)

旧问题和OP很可能(并希望)已经解决了他的问题,但是如果其他人将面临这个问题,我会发表我的决议。

我必须从部署中删除apache-jsp * .jar 资源,以消除此完全相同的错误。