JBoss EAP 6.4でSpringブートアプリケーション(タイルビューあり)を展開するのに苦労しています。このアプリケーションはTomcat 8上でスムーズに動作しますが、JBossにデプロイすると応答しません。起動ログはOKですが、ブラウザからコントローラを呼び出すとエラーが発生します。JBWEB000065私は、Eclipse STSからのデプロイメントとスタンドアロン/デプロイメントでの戦争の両方を行っています。Spring Boot 1.3.3 JBoss 6.4上でタイル3を使用したアプリケーション - エラーJBWEB000065 - 404が見つかりませんでした。
のpom.xml
<?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.codependent.gitprofiles</groupId>
<artifactId>boot3</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>boot3</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-web</artifactId>
</dependency>
<dependency>
<artifactId>spring-boot-starter-tomcat</artifactId>
<groupId>org.springframework.boot</groupId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
ServletInitializer:
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Boot3Application.class);
}
}
Boot3Application:
@SpringBootApplication
@RestController
public class Boot3Application {
@RequestMapping("/home")
public String home(){
return "home";
}
public static void main(String[] args) {
SpringApplication.run(Boot3Application.class, args);
}
}
TilesConfiguration:
@Configuration
public class TilesConfiguration {
@Bean
public TilesConfigurer tilesConfigurer() {
final TilesConfigurer configurer = new TilesConfigurer();
configurer.setDefinitions(new String[] { "WEB-INF/**/tiles.xml" });
configurer.setCheckRefresh(true);
return configurer;
}
@Bean
public TilesViewResolver tilesViewResolver() {
final TilesViewResolver resolver = new TilesViewResolver();
resolver.setViewClass(TilesView.class);
return resolver;
}
}
スタートアップログ:ブラウザ上でhttp://localhost:8080/boot3/home
を呼び出す
[org.jboss.web] (ServerService Thread Pool -- 80) JBAS018210: Registrar el contexto web: /boot3
[org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/boot3]] (ServerService Thread Pool -- 80) Spring WebApplicationInitializers detected on classpath: [org.springframework.boot.autoconfigure[email protected]57c6298e, [email protected]]
[org.hibernate.validator.internal.util.Version] (background-preinit) HV000001: Hibernate Validator 4.3.2.Final-redhat-2
[stdout] (ServerService Thread Pool -- 80)
[stdout] (ServerService Thread Pool -- 80) . ____ _ __ _ _
[stdout] (ServerService Thread Pool -- 80) /\\/___'_ __ _ _(_)_ __ __ _ \ \ \ \
[stdout] (ServerService Thread Pool -- 80) (()\___ | '_ | '_| | '_ \/ _` | \ \ \ \
[stdout] (ServerService Thread Pool -- 80) \\/ ___)| |_)| | | | | || (_| | ))))
[stdout] (ServerService Thread Pool -- 80) ' |____| .__|_| |_|_| |_\__, |////
[stdout] (ServerService Thread Pool -- 80) =========|_|==============|___/=/_/_/_/
[stdout] (ServerService Thread Pool -- 80) :: Spring Boot :: (v1.3.3.RELEASE)
[stdout] (ServerService Thread Pool -- 80)
[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 80) Mapped "{[/home]}" onto public java.lang.String com.codependent.gitprofiles.Boot3Application.home()
...
は、JBossのログに表示されて何もして次のことを示しています。
JBWEB000065: HTTP Status 404 - /boot3/error
JBWEB000309: type JBWEB000067: Status report
JBWEB000068: message /boot3/error
JBWEB000069: description JBWEB000124: The requested resource is not available.
JBoss Web/7.5.7.Final-redhat-1
UPDATE:私は、私の場合には役に立たないStackOverflowの上solutionが見つかりましたが、それ:server.servlet-path=/*
を使用すると、アプリケーションが要求の処理を開始し、今でコントローラが起動しかし、それはタイルビューをレンダリングすることができないのですされています
Cannot forward to error page for request [/home] as the response has already been committed. As a result, the response may have the wrong status code. If your application is running on WebSphere Application Server you may be able to resolve this problem by setting com.ibm.ws.webcontainer.invokeFlushAfterService to false
私はserver-servlet-path/*
を使用している場合、それはどちらか(同じエラーで)動作しませんが、それは/
でないことをTomcat上でチェックしています。
要約すると、JBossではコントローラの呼び出しを許可するためにserver.servlet-path=/*
とserver.servlet-path=/
の両方にTilesビューレンダリングを許可することはできません。どうすればこの問題を回避できますか?
パッチを試すつもりです – codependent