在本地启动时没有问题!上服务器(阿里的centos)后,启动后报错:java.io.FileNotFoundException: class path resource [templates/] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/root/java/jiyaoNewWeb-1.0.jar!/BOOT-INF/classes!/templates/at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:215)at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:53)at org.springframework.ui.freemarker.FreeMarkerConfigurationFactory.getTemplateLoaderForPath(FreeMarkerConfigurationFactory.java:338)at org.springframework.ui.freemarker.FreeMarkerConfigurationFactory.createConfiguration(FreeMarkerConfigurationFactory.java:290)at org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer.afterPropertiesSet(FreeMarkerConfigurer.java:116)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)报这个问题之后,又继续跑了一段:最后告诉我说启动失败,说443可能被占用,我用lsof -i:看了没有在用的,现在也用的是root账号,端口也是开放了的:
最后的报错信息是:
2019-04-29 15:50:33,891 [main] DEBUG org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter -
Application failed to start due to an exceptionorg.springframework.boot.context.embedded.tomcat.ConnectorStartFailedException: Connector configured to listen on port 443 failed to start
4 回答
梵蒂冈之花
TA贡献1900条经验 获得超5个赞
搞定了! 是nginx占用了! 但是不知道为什么lsof -i:或者grep不到! 之前没有怀疑是因为同事说他用的是8082,最后我自己去看了下,其实还是用的80,所以导致启动不了,
慕容708150
TA贡献1831条经验 获得超4个赞
不一定是端口的问题吧,你看下这个报错。java.io.FileNotFoundException: class path resource [templates/] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/root/java/jiyaoNewWeb-1.0.jar!/BOOT-INF/classes!/templates/
添加回答
举报
0/150
提交
取消