spring boot jar在ec2服务器上不起作用

时间:2016-06-19 11:10:45

标签: java spring amazon-web-services amazon-ec2 spring-boot

在localhost我的应用程序有效,但在运行后的ec2中我有错误404.我看到其他答案并添加到我的application.properties server.context-path=/index和我的应用程序

@Bean
    public DispatcherServlet dispatcherServlet (){
        return new DispatcherServlet();
    }

    @Bean
    public ServletRegistrationBean dispatchServletRegistration(){
        ServletRegistrationBean registrationBean = new ServletRegistrationBean(dispatcherServlet(), "/*");
        registrationBean.setName(DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME);
        return registrationBean;
    }

但仍然无法奏效。我做错了什么?

0 个答案:

没有答案