Eclipse creates a dynamic Web deployment
http://blog.csdn.net/sweblish/article/details/6686046
eclipse3.x in hot Deployment project, startup error issue:
It's always been the eclipse that created MAVEN projects, and then one day a colleague asked me to build a dynamic Web project for him, and I said, well, that's not easy. So I built one, actually can't run up. After trying a few times, I didn't find the reason, I was depressed. The content of the compilation is also not under the WebApp under Tomcat, I am very strange, why do not compile the past. So Baidu, Google a lot of this problem. Get the following answer:
Severity: Error starting static Resources
Java.lang.IllegalArgumentException:Document Base D:\companyworkspace\.metadata\.plugins\ Org.eclipse.wst.server.core\tmp0\wtpwebapps\longlong does not exist or was not a readable directory
At Org.apache.naming.resources.FileDirContext.setDocBase (filedircontext.java:141)
At Org.apache.catalina.core.StandardContext.resourcesStart (standardcontext.java:3957)
At Org.apache.catalina.core.StandardContext.start (standardcontext.java:4126)
At Org.apache.catalina.core.ContainerBase.addChildInternal (containerbase.java:791)
At Org.apache.catalina.core.ContainerBase.addChild (containerbase.java:771)
At Org.apache.catalina.core.StandardHost.addChild (standardhost.java:525)
At Org.apache.catalina.startup.HostConfig.deployDescriptor (hostconfig.java:626)
At Org.apache.catalina.startup.HostConfig.deployDescriptors (hostconfig.java:553)
At Org.apache.catalina.startup.HostConfig.deployApps (hostconfig.java:488)
At Org.apache.catalina.startup.HostConfig.start (hostconfig.java:1147)
At Org.apache.catalina.startup.HostConfig.lifecycleEvent (hostconfig.java:311)
At Org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent (lifecyclesupport.java:117)
At Org.apache.catalina.core.ContainerBase.start (containerbase.java:1053)
At Org.apache.catalina.core.StandardHost.start (standardhost.java:719)
At Org.apache.catalina.core.ContainerBase.start (containerbase.java:1045)
At Org.apache.catalina.core.StandardEngine.start (standardengine.java:443)
At Org.apache.catalina.core.StandardService.start (standardservice.java:516)
At Org.apache.catalina.core.StandardServer.start (standardserver.java:710)
At Org.apache.catalina.startup.Catalina.start (catalina.java:578)
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:39)
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:25)
At Java.lang.reflect.Method.invoke (method.java:597)
At Org.apache.catalina.startup.Bootstrap.start (bootstrap.java:288)
At Org.apache.catalina.startup.Bootstrap.main (bootstrap.java:413)
2011-8-14 14:56:39 org.apache.catalina.core.StandardContext Start
Severity: Error in Resourcestart ()
2011-8-14 14:56:39 org.apache.catalina.core.StandardContext Start
Severity: Error getconfigured
2011-8-14 14:56:39 org.apache.catalina.core.StandardContext Start
Severity: Context [] startup failed due to previous error
The problem arises because the server service is not properly configured after you create a new server and Web project and is now correctly configured as follows
Workaround:
1. On the new server in Servers, right-click the--property under the general item to the right Location property, click the Switchlocation button, set to/servers/tomcat v6.0 Server at Localhost.server
(Server s:properties, general, location =/servers/tomcat v6.0 Server at Localhost.server;)
2. Double-click the new server and modify the server Options settings: Publish module contexts to separate XML files tick (bottom)
3. Configure the Web project's server options: Right-click Web Project--Properties--server (default is none after new Web project) Select the server that you created in Servers hot deployment (my is Tomcat v6.0 Server at Localhost.server).
Relevant explanations for the search:
(
Explaination:
? Tomcat of previous version doesn ' t support the "source" attribute in the "Context" node of "server. xml" file.
Result:
? A separate XML file named "Demo.xml" is created in the "$server path$\conf\catalina\localhost\".
)
Note: "Metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\t does not exist or was not a readable directory" The problem is that the Web project improperly renamed the relevant folder, or accidentally deleted some directories and re-created, causing Eclipse to be unable to automatically synchronize the relevant configuration when using hot deployment.
At this point: The fixed Web deployment directory structure can be created manually under the Metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ directory by means of manual deployment. For example: The MyTest project can be created as follows: Create a mytest directory, create Meta-inf, web-inf two folder directories in the MyTest folder directory. Configure to this, the two folder directory should put what content, everyone should be clear. Normal project Tomcat in structure. If it's a new project, it's not written yet. It is recommended to remove the re-creation of a Web project when eclipse is automatically sensed.
If there are errors, then the configuration: Project-left-click-Fracets the following configuration. Choose Java 6.0, the lower right corner of apply, select the dynamic Web in the lower right corner of apply is OK.