首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SpringBoot1.3.3在JBoss 6.4上使用Tiles 3的应用程序-错误JBWEB000065 - 404未找到

SpringBoot1.3.3在JBoss 6.4上使用Tiles 3的应用程序-错误JBWEB000065 - 404未找到
EN

Stack Overflow用户
提问于 2016-04-26 10:05:31
回答 1查看 745关注 0票数 0

我正努力在 EAP 6.4上部署一个Spring应用程序(带有Tiles视图的)。这个应用程序在Tomcat 8上运行很顺利,但是当我在JBoss上部署它时,它没有响应。启动日志是可以的,但是当我从浏览器调用控制器时,我会得到错误的JBWEB000065。我从Eclipse进行部署,并将war置于独立/部署中。

pom.xml

代码语言:javascript
复制
<?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

代码语言:javascript
复制
public class ServletInitializer extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Boot3Application.class);
    }

}

Boot3Application

代码语言:javascript
复制
@SpringBootApplication
@RestController
public class Boot3Application {

    @RequestMapping("/home")
    public String home(){
        return "home";
    }

    public static void main(String[] args) {
        SpringApplication.run(Boot3Application.class, args);
    }
}

TilesConfiguration

代码语言:javascript
复制
@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;
     }

}

启动日志

代码语言:javascript
复制
[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.jersey.JerseyAutoConfiguration$JerseyWebApplicationInitializer@57c6298e, com.codependent.gitprofiles.ServletInitializer@16df6757]
[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()
...

在浏览器上调用http://localhost:8080/boot3/home如下所示,JBoss日志中没有显示任何内容;

代码语言:javascript
复制
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:我在堆栈溢出上找到了一个solution,但在我的示例中它是无用的:使用server.servlet-path=/*应用程序开始处理请求,现在控制器被调用,但它无法呈现Tiles视图

代码语言:javascript
复制
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

我已经检查过Tomcat,如果我使用server-servlet-path/*,它也不能工作(有相同的错误),但是它可以用于/

总之,在JBoss中,我不能同时使用server.servlet-path=/* (允许在控制器上调用)和server.servlet-path=/来允许Tiles视图呈现,所以我如何解决这个问题?

EN

回答 1

Stack Overflow用户

发布于 2016-06-02 15:16:28

我确实遇到了问题。在安装JBoss修补程序jboss-eap-6.4.6-patch.zip之后,问题不再发生。

修补之后,我不需要使用设置server.servlet-path=/*

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36861708

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档