在野蝇上运行战争春季 roo 2.0.0 RC1



我在运行春季 roo 在野蝇 10 上生成的 .war 时遇到问题 在创建项目时在 roo shell 中执行以下命令: 项目设置 --topLevelPackage com.example --java 8 --打包 WAR

添加的路径 server.contextPath=/teste

运行后: Mvn 包

它生成一个 .war,可以使用 Java -jar xxxxx-exec.war

它正确启动并由浏览器访问。 当我在文件夹部署中播放它时,野蝇不会转动。 我发现我不得不取下雄猫内置弹簧靴:

<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>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>

然后我创建了一个新的 .war 并尝试在 wildfly 中运行,但它没有再次运行,不是由于错误或其他原因,它说它开始了,但是当我尝试访问 url 时,它显示禁止。

对不起,我的英语,我是巴西人,我正在使用谷歌翻译。

为了能够在Wildfly服务器中部署 Spring Boot 应用程序,您需要从SpringBootServletInitializer扩展@SpringBootApplication.java 类并实现configure方法。

通过这些简单的步骤,您将能够在tomcat,jboss,wildfly等中部署和运行您的应用程序。

要了解有关应应用的更改的更多信息,请阅读 http://docs.spring.io/spring-boot/docs/1.5.4.RELEASE/reference/htmlsingle/#howto-create-a-deployable-war-file

希望对您有所帮助,

最新更新