我正在使用springboot创建一个项目,它没有错误运行的想法,但是,运行app.jar文件,它会像下面这样运行异常
java.io.FileNotFoundException: class path resource [templates/] cannot be resol
ed to absolute file path because it does not reside in the file system: jar:fil
:/E:/projects/help/target/zhx-help-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/templa
es/
    at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:21
)
    at org.springframework.core.io.AbstractFileResolvingResource.getFile(Ab
tractFileResolvingResource.java:52)
    at org.springframework.ui.freemarker.FreeMarkerConfigurationFactory.get
emplateLoaderForPath(FreeMarkerConfigurationFactory.java:338)
    at org.springframework.ui.freemarker.FreeMarkerConfigurationFactory.cre
teConfiguration(FreeMarkerConfigurationFactory.java:290)
    at org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer
   afterPropertiesSet(FreeMarkerConfigurer.java:116)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBea
Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBea
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBea
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBea
Factory.createBean(AbstractAutowireCapableBeanFactory.java:483)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getO
ject(AbstractBeanFactory.java:306)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegist
y.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetB
an(AbstractBeanFactory.java:302)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBea
(AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.DefaultListableBeanFactoryspringboot版本:1.5.2
使用弹簧-数据-jpa
发布于 2018-05-17 19:08:45
如果您使用的球衣与弹簧靴,泽西并不是很好的spring。造成此错误的原因是,jersey无法自动发现所有rest资源。要解决这个问题,请显式注册所有资源,注册包不起作用。希望这个问题将在未来版本的泽西解决。
公共类JerseyConfig扩展ResourceConfig {
public JerseyConfig() {
    register(Resource1.class);
    register(Resource2.class);
    register(Resource3.class);
}}
https://stackoverflow.com/questions/43065117
复制相似问题