4
回答
关于项目部署到 tomcat ROOT 中的问题
终于搞明白,存储TCO原来是这样算的>>>   

请问 

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

右键工程properties  -> MyEclipse -> Web   

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

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

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

举报
无敌小学僧
发帖于10个月前 4回/1K+阅

启动的时候满屏幕都是这些 大概是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
我就简短复制一些。

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