在eclipse中导入动态Web项目

在eclipse中导入动态Web项目

本文介绍了在eclipse中导入动态Web项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用eclipse 3.6.2 [Helios]和tomcat 7和myfaces 1.2.10



当我想导入动态Web项目时,我有一个问题。我在我的工作空间中导入项目,并执行配置并设置jar文件,但是当我在tomcat中运行时,我将遇到这个问题

  HTTP状态404  -  

类型状态报告

消息

描述请求的资源()不可用。
Apache Tomcat / 6.0.33

并在控制台中显示此错误:

  SEVERE:启动静态资源时出错
java.lang.IllegalArgumentException:文档库C:\Eclipse\Workspaces\Wsp2\\ \\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Wp1不存在或不可读目录
在org.apache.naming.resources.FileDirContext .setDocBase(FileDirContext.java:142)
在org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4320)
在org.apache.catalina.core.StandardContext.start(StandardContext .java:4489)
在org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
在org.apache.catalina.core.StandardHost.start(StandardHost.java:840 )
在org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
在org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
在org.apache.catalina.core.StandardService.start(StandardService.java:525)
在org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
在org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source )
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
在java.lang.reflect.Method.invoke(Unknown Source)
在org.apache.catalina.startup.Bootstrap。 start(Bootstrap.java:289)
在org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2011年10月13日上午4:12:18 org.apache.catalina .core.StandardContext start
SEVERE:resourceStart()中的错误

我该怎么办?



thanx

解决方案

Eclipse和Tomcat都是混乱的。我建议清理并重建所有的。


  1. 从Tomcat中删除项目(右键单击Tomcat,添加/删除项目,删除项目)

  2. 关闭Eclipse中的项目(rightclick project,关闭

  3. 清理Tomcat(右键单击Tomcat,

  4. 在Eclipse中重新打开项目(右键菜单,打开

  5. 清洁项目在Eclipse(项目>清洁...>清除下面的选定项目,选择项目)

  6. 将项目添加到Tomcat(右键单击Tomcat,添加/删除项目,添加项目)

  7. 启动Tomcat(右键单击Tomcat,开始


i use eclipse 3.6.2[Helios] and tomcat 7 and myfaces 1.2.10

i have a problem when i want to import a dynamic web project . i import the project in my workspace and perform the configurations and set jar files but when i run that in tomcat i will have this problem

HTTP Status 404 -

type Status report

message

description The requested resource () is not available.
Apache Tomcat/6.0.33

and in console display this error :

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base C:\Eclipse\Workspaces\Wsp2\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Wp1 does not exist or is not a readable directory
    at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:142)
    at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4320)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4489)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
    at org.apache.catalina.core.StandardService.start(StandardService.java:525)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Oct 13, 2011 4:12:18 AM org.apache.catalina.core.StandardContext start
SEVERE: Error in resourceStart()

what should i do ?

thanx

解决方案

Eclipse and Tomcat are both in confusion. I'd suggest to clean and rebuild all.

  1. Remove project from Tomcat (rightclick Tomcat, Add/Remove project, remove project)
  2. Close project in Eclipse (rightclick project, Close)
  3. Clean Tomcat (rightclick Tomcat, Clean)
  4. Reopen project in Eclipse (rightclick project, Open)
  5. Clean project in Eclipse (Project > Clean... > Clean selected projects below, select project)
  6. Add project to Tomcat (rightclick Tomcat, Add/Remove projects, add project)
  7. Start Tomcat (rightclick Tomcat, Start).

这篇关于在eclipse中导入动态Web项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 23:49