Java 部署SpringREST项目时System.Deployment.Application.InvalidDeploymentException(ManifestParse)?

Java 部署SpringREST项目时System.Deployment.Application.InvalidDeploymentException(ManifestParse)?,java,spring,rest,maven,Java,Spring,Rest,Maven,我在eclipse中使用maven和Tomcat9.0服务器部署SpringREST项目时遇到了这个错误 DemoAppConfig.java package com.pal.springdemo.rest.conf; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.spring

我在eclipse中使用maven和Tomcat9.0服务器部署SpringREST项目时遇到了这个错误

DemoAppConfig.java

package com.pal.springdemo.rest.conf;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

@Configuration
@EnableWebMvc
@ComponentScan("com.pal.springdemo.rest")
public class DemoAppConfig {

}
MyDispatcherServletilizer

package com.pal.springdemo.rest.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class Travel {

    @GetMapping("/hello")
    public String sethello() {
        System.out.println("hello from test");
        return "hello";
    }

}
package com.pal.springdemo.rest.conf;
导入org.springframework.web.servlet.support.AbstractAnnotationConfigDispatchersServletInitializer;
公共类myspringmvcdispatcherservletInitializer扩展了AbstractAnnotationConfigDispatcherServletInitializer{
@凌驾
受保护类[]getRootConfigClasses(){
//TODO自动生成的方法存根
返回null;
}
@凌驾
受保护类[]getServletConfigClasses(){
//TODO自动生成的方法存根
返回新类[]{DemoAppConfig.Class};
}
@凌驾
受保护的字符串[]getServletMappings(){
返回新字符串[]{”/“};
}
}
PalController

package com.pal.springdemo.rest.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class Travel {

    @GetMapping("/hello")
    public String sethello() {
        System.out.println("hello from test");
        return "hello";
    }

}
这就是我在短消息中遇到的错误:
应用程序的格式不正确。请与应用程序供应商联系 寻求帮助

它在index.jsp中运行良好,没有任何错误,但在转到rest控制器映射链接时出错

项目参考: