关于项目部署到 tomcat ROOT 中的问题
请问
将publiccms-by-maven 部署到myeclipse以后
右键工程properties -> MyEclipse -> Web
想把工程 Web Context-root 改成 "/"
以前这么改了以后 工程会被自动部署到 tomcat webApps ROOT中
现在这么改就报错为什么?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
谢谢 秋痕 kerneler 问题解决!
是的,是有飘红的地方。。。 主要是java.nio.file这个包找不到, 但是我如果不更改Web Context-root 为"/" 而是使用默认的"/cms" 程序就不会报错一切正常。。。
好了 好了 是我弄错了 才发现JRE版本是1.6的 换成1.7的瞬间解决!!
我猜测 你的项目有飘红的地方吧 编译貌似没过啊
启动的时候满屏幕都是这些 大概是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
我就简短复制一些。
报什么错呢 这样部署是没问题的 它跟其他web工程没什么区别