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

无敌小学僧 发布于 2016/12/14 19:11
阅读 1K+
收藏 0

请问 

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

右键工程properties  -> MyEclipse -> Web   

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

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

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

加载中
0
湖水没了
湖水没了
报什么错呢 这样部署是没问题的 它跟其他web工程没什么区别
0
无敌小学僧

启动的时候满屏幕都是这些 大概是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.40\webapps\ROOT\WEB-INF\classes\com\publiccms\logic\component\FileComponent.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.40\webapps\ROOT\WEB-INF\classes\com\publiccms\logic\component\FileComponent.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.40\webapps\ROOT\WEB-INF\classes\com\publiccms\logic\component\FileComponent.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.40\webapps\ROOT\WEB-INF\classes\com\publiccms\logic\component\FileComponent.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
我就简短复制一些。

0
秋痕
秋痕
我猜测 你的项目有飘红的地方吧 编译貌似没过啊
无敌小学僧
好了 好了 是我弄错了 才发现JRE版本是1.6的 换成1.7的瞬间解决!!
无敌小学僧
是的,是有飘红的地方。。。 主要是java.nio.file这个包找不到, 但是我如果不更改Web Context-root 为"/" 而是使用默认的"/cms" 程序就不会报错一切正常。。。
0
无敌小学僧
谢谢  秋痕  kerneler  问题解决!
返回顶部
顶部