关于项目部署到 tomcat ROOT 中的问题

发布于 2021-11-28 12:46:00 字数 255 浏览 836 评论 6

请问 

将publiccms-by-maven 部署到myeclipse以后

右键工程properties  -> MyEclipse -> Web   

想把工程 Web Context-root 改成 "/"

以前这么改了以后  工程会被自动部署到 tomcat webApps ROOT中

现在这么改就报错为什么?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

各自安好 2021-12-03 12:30:44

谢谢  秋痕  kerneler  问题解决!

风柔一江水 2021-12-03 12:22:26

是的,是有飘红的地方。。。 主要是java.nio.file这个包找不到, 但是我如果不更改Web Context-root 为"/" 而是使用默认的"/cms" 程序就不会报错一切正常。。。

深巷少女 2021-12-03 09:25:24

好了 好了 是我弄错了 才发现JRE版本是1.6的 换成1.7的瞬间解决!!

恋你朝朝暮暮 2021-12-03 02:39:29

我猜测 你的项目有飘红的地方吧 编译貌似没过啊

背叛残局 2021-12-02 15:06:23

启动的时候满屏幕都是这些 大概是spring 注入bean时候出错了吧

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'templateComponent': Unsatisfied dependency expressed through method 'setFreeMarkerConfigurer' parameter 1: Error creating bean with name 'publishPageDirective': Unsatisfied dependency expressed through field 'fileComponent': Error creating bean with name 'fileComponent' defined in file [D:apache-tomcat-7.0.40webappsROOTWEB-INFclassescompubliccmslogiccomponentFileComponent.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.publiccms.logic.component.FileComponent]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    DirectoryStream cannot be resolved to a type

    Path cannot be resolved to a type

    Files cannot be resolved

    Paths cannot be resolved

    Path cannot be resolved to a type

    Path cannot be resolved to a type

    BasicFileAttributes cannot be resolved to a type

    Files cannot be resolved

    BasicFileAttributes cannot be resolved to a type

    BasicFileAttributes cannot be resolved to a type

; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileComponent' defined in file [D:apache-tomcat-7.0.40webappsROOTWEB-INFclassescompubliccmslogiccomponentFileComponent.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.publiccms.logic.component.FileComponent]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    DirectoryStream cannot be resolved to a type

    Path cannot be resolved to a type

    Files cannot be resolved

    Paths cannot be resolved

    Path cannot be resolved to a type

    Path cannot be resolved to a type

    BasicFileAttributes cannot be resolved to a type

    Files cannot be resolved

    BasicFileAttributes cannot be resolved to a type

    BasicFileAttr

ibutes cannot be resolved to a type

; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'publishPageDirective': Unsatisfied dependency expressed through field 'fileComponent': Error creating bean with name 'fileComponent' defined in file [D:apache-tomcat-7.0.40webappsROOTWEB-INFclassescompubliccmslogiccomponentFileComponent.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.publiccms.logic.component.FileComponent]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    DirectoryStream cannot be resolved to a type

    Path cannot be resolved to a type

    Files cannot be resolved

    Paths cannot be resolved

    Path cannot be resolved to a type

    Path cannot be resolved to a type

    BasicFileAttributes cannot be resolved to a type

    Files cannot be resolved

    BasicFileAttributes cannot be resolved to a type

    BasicFileAttributes cannot be resolved to a type

; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileComponent' defined in file [D:apache-tomcat-7.0.40webappsROOTWEB-INFclassescompubliccmslogiccomponentFileComponent.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.publiccms.logic.component.FileComponent]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    The import java.nio.file cannot be resolved

    DirectoryStream cannot be resolved to a type

    Path cannot be resolved to a type

    Files cannot be resolved

    Paths cannot be resolved

    Path cannot be resolved to a type

    Path cannot be resolved to a type

    BasicFileAttributes cannot be resolved to a type

    Files cannot be resolved

    BasicFileAttributes cannot be resolved to a type

    BasicFileAttributes cannot be resolved to a type
我就简短复制一些。

心舞飞扬 2021-12-02 12:51:54

报什么错呢 这样部署是没问题的 它跟其他web工程没什么区别

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文