有没有人尝试成功将一个springboot应用程序部署到wildfly 10?我找了一些例子,但我只找到了野生蝇8.2
这是我的应用程序类:
@SpringBootApplication
@EnableEurekaServer
@EnableDiscoveryClient
public class ServereurekaApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(ServereurekaApplication.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(ServereurekaApplication.class);
}
}
这是我的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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.servereureka</groupId>
<artifactId>servereureka</artifactId>
<version>1</version>
<packaging>war</packaging>
<name>servereureka</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.RC2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
我总是收到这个错误:
无法上传部署:{&#34; WFLYCTL0080:服务失败&#34; =&GT; {&#34; jboss.undertow.deployment.default-server.default主机\&#34; /servereureka-0.0.1-SNAPSHOT \&#34;&#34; =&GT; &#34; org.jboss.msc.service.StartException在服务jboss.undertow.deployment.default-server.default-host。\&#34; /servereureka-0.0.1-SNAPSHOT \&#34;:java。 lang.RuntimeException:org.springframework.context.ApplicationContextException:无法启动嵌入式容器;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名称为&#39; org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration $ WebMvcAutoConfigurationAdapter&#39;:注册自动连接的依赖项失败;嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private org.springframework.boot.autoconfigure.web.HttpMessageConverters org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration $ WebMvcAutoConfigurationAdapter.messageConverters;嵌套异常是org.springframework.beans.factory.BeanCreationException:使用名称&#39; org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration&#39;:注册自动连接的依赖项失败时出错;嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private final java.util.List org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration.converters;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名称为&#39; mappingJackson2XmlHttpMessageConverter&#39;在类路径资源中定义[org / springframework / boot / autoconfigure / web / JacksonHttpMessageConvertersConfiguration $ MappingJackson2XmlHttpMessageConverterConfiguration.class]:通过工厂方法进行Bean实例化失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化[org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter]:工厂方法&#39; mappingJackson2XmlHttpMessageConverter&#39;抛出异常;嵌套异常是java.lang.NoSuchMethodError:com.fasterxml.jackson.databind.SerializationConfig.withDefaultPrettyPrinter(Lcom / fasterxml / jackson / core / PrettyPrinter;)Lcom / fasterxml / jackson / databind / SerializationConfig;引起:java.lang.RuntimeException:org.springframework.context.ApplicationContextException:无法启动嵌入式容器;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名称为&#39; org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration $ WebMvcAutoConfigurationAdapter&#39;:注册自动连接的依赖项失败;嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private org.springframework.boot.autoconfigure.web.HttpMessageConverters org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration $ WebMvcAutoConfigurationAdapter.messageConverters;嵌套异常是org.springframework.beans.factory.BeanCreationException:使用名称&#39; org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration&#39;:注册自动连接的依赖项失败时出错;嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private final java.util.List org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration.converters;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名称为&#39; mappingJackson2XmlHttpMessageConverter&#39;在类路径资源中定义[org / springframework / boot / autoconfigure / web / JacksonHttpMessageConvertersConfiguration $ MappingJackson2XmlHttpMessageConverterConfiguration.class]:通过工厂方法进行Bean实例化失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化[org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter]:工厂方法&#39; mappingJackson2XmlHttpMessageConverter&#39;抛出异常;嵌套异常是java.lang.NoSuchMethodError:com.fasterxml.jackson.databind.SerializationConfig.withDefaultPrettyPrinter(Lcom / fasterxml / jackson / core / PrettyPrinter;)Lcom / fasterxml / jackson / databind / SerializationConfig;引起:org.springframework.context.ApplicationContextException:无法启动嵌入式容器;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名称为&#39; org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration $ WebMvcAutoConfigurationAdapter&#39;:注册自动连接的依赖项失败;嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private org.springframework.boot.autoconfigure.web.HttpMessageConverters org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration $ WebMvcAutoConfigurationAdapter.messageConverters;嵌套异常是org.springframework.beans.factory.BeanCreationException:使用名称&#39; org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration&#39;:注册自动连接的依赖项失败时出错;嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private final java.util.List org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration.converters;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名称为&#39; mappingJackson2XmlHttpMessageConverter&#39;在类路径资源中定义[org / springframework / boot / autoconfigure / web / JacksonHttpMessageConvertersConfiguration $ MappingJackson2XmlHttpMessageConverterConfiguration.class]:通过工厂方法进行Bean实例化失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化[org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter]:工厂方法&#39; mappingJackson2XmlHttpMessageConverter&#39;抛出异常;嵌套异常是java.lang.NoSuchMethodError:com.fasterxml.jackson.databind.SerializationConfig.withDefaultPrettyPrinter(Lcom / fasterxml / jackson / core / PrettyPrinter;)Lcom / fasterxml / jackson / databind / SerializationConfig;由以下原因引起:org.springframework.beans.factory.BeanCreationException:创建名称为&#39; org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration $ WebMvcAutoConfigurationAdapter&#39;注册自动连接的依赖项失败;嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private org.springframework.boot.autoconfigure.web.HttpMessageConverters org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration $ WebMvcAutoConfigurationAdapter.messageConverters;嵌套异常是org.springframework.beans.factory.BeanCreationException:使用名称&#39; org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration&#39;:注册自动连接的依赖项失败时出错;嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private final java.util.List org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration.converters;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名称为&#39; mappingJackson2XmlHttpMessageConverter&#39;在类路径资源中定义[org / springframework / boot / autoconfigure / web / JacksonHttpMessageConvertersConfiguration $ MappingJackson2XmlHttpMessageConverterConfiguration.class]:通过工厂方法进行Bean实例化失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化[org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter]:工厂方法&#39; mappingJackson2XmlHttpMessageConverter&#39;抛出异常;嵌套异常是java.lang.NoSuchMethodError:com.fasterxml.jackson.databind.SerializationConfig.withDefaultPrettyPrinter(Lcom / fasterxml / jackson / core / PrettyPrinter;)Lcom / fasterxml / jackson / databind / SerializationConfig;引起:org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private org.springframework.boot.autoconfigure.web.HttpMessageConverters org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration $ WebMvcAutoConfigurationAdapter.messageConverters;嵌套异常是org.springframework.beans.factory.BeanCreationException:使用名称&#39; org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration&#39;:注册自动连接的依赖项失败时出错;嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private final java.util.List org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration.converters;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名称为&#39; mappingJackson2XmlHttpMessageConverter&#39;在类路径资源中定义[org / springframework / boot / autoconfigure / web / JacksonHttpMessageConvertersConfiguration $ MappingJackson2XmlHttpMessageConverterConfiguration.class]:通过工厂方法进行Bean实例化失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化[org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter]:工厂方法&#39; mappingJackson2XmlHttpMessageConverter&#39;抛出异常;嵌套异常是java.lang.NoSuchMethodError:com.fasterxml.jackson.databind.SerializationConfig.withDefaultPrettyPrinter(Lcom / fasterxml / jackson / core / PrettyPrinter;)Lcom / fasterxml / jackson / databind / SerializationConfig;由以下原因引起:org.springframework.beans.factory.BeanCreationException:创建名称为&#39; org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration&#39;:注册自动连接的依赖项失败的错误;嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private final java.util.List org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration.converters;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名称为&#39; mappingJackson2XmlHttpMessageConverter&#39;在类路径资源中定义[org / springframework / boot / autoconfigure / web / JacksonHttpMessageConvertersConfiguration $ MappingJackson2XmlHttpMessageConverterConfiguration.class]:通过工厂方法进行Bean实例化失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化[org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter]:工厂方法&#39; mappingJackson2XmlHttpMessageConverter&#39;抛出异常;嵌套异常是java.lang.NoSuchMethodError:com.fasterxml.jackson.databind.SerializationConfig.withDefaultPrettyPrinter(Lcom / fasterxml / jackson / core / PrettyPrinter;)Lcom / fasterxml / jackson / databind / SerializationConfig;引起:org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private final java.util.List org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration.converters;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名称为&#39; mappingJackson2XmlHttpMessageConverter&#39;在类路径资源中定义[org / springframework / boot / autoconfigure / web / JacksonHttpMessageConvertersConfiguration $ MappingJackson2XmlHttpMessageConverterConfiguration.class]:通过工厂方法进行Bean实例化失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化[org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter]:工厂方法&#39; mappingJackson2XmlHttpMessageConverter&#39;抛出异常;嵌套异常是java.lang.NoSuchMethodError:com.fasterxml.jackson.databind.SerializationConfig.withDefaultPrettyPrinter(Lcom / fasterxml / jackson / core / PrettyPrinter;)Lcom / fasterxml / jackson / databind / SerializationConfig;引起:org.springframework.beans.factory.BeanCreationException:创建名称为&#39; mappingJackson2XmlHttpMessageConverter&#39;在类路径资源中定义[org / springframework / boot / autoconfigure / web / JacksonHttpMessageConvertersConfiguration $ MappingJackson2XmlHttpMessageConverterConfiguration.class]:通过工厂方法进行Bean实例化失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化[org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter]:工厂方法&#39; mappingJackson2XmlHttpMessageConverter&#39;抛出异常;嵌套异常是java.lang.NoSuchMethodError:com.fasterxml.jackson.databind.SerializationConfig.withDefaultPrettyPrinter(Lcom / fasterxml / jackson / core / PrettyPrinter;)Lcom / fasterxml / jackson / databind / SerializationConfig;引起:org.springframework.beans.BeanInstantiationException:无法实例化[org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter]:工厂方法&#39; mappingJackson2XmlHttpMessageConverter&#39;抛出异常;嵌套异常是java.lang.NoSuchMethodError:com.fasterxml.jackson.databind.SerializationConfig.withDefaultPrettyPrinter(Lcom / fasterxml / jackson / core / PrettyPrinter;)Lcom / fasterxml / jackson / databind / SerializationConfig;引起:java.lang.NoSuchMethodError:com.fasterxml.jackson.databind.SerializationConfig.withDefaultPrettyPrinter(Lcom / fasterxml / jackson / core / PrettyPrinter;)Lcom / fasterxml / jackson / databind / SerializationConfig;&#34;}}
答案 0 :(得分:6)
Exclude jaxrs subsystem using jboss-deployment-structure.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<exclude-subsystems>
<subsystem name="jaxrs" />
</exclude-subsystems>
</deployment>
</jboss-deployment-structure>
答案 1 :(得分:0)
pom.xml中的依赖关系必须如下:
<dependencies>
<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>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
</dependencies>
并在Application.java文件中扩展SpringBootServletInitializer:
@SpringBootApplication
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(Application.class);
}
}
你基本上是新的
我希望这有帮助