简体   繁体   English

关于Java中Web应用程序的“org.eclipse.wst.server.core”文件夹的一般问题很少

[英]Few general questions about “org.eclipse.wst.server.core” folder of a web application in Java

I have a few questions regarding the org.eclipse.wst.server.core folder in .metadata\\.plugins folder in a eclipse work space. 关于eclipse工作空间中.metadata\\.plugins文件夹中的org.eclipse.wst.server.core文件夹,我有几个问题。 I know that while running an application in local host, this is the folder where we have to replace files for front end, like JSP , JS files, CSS files, HTML files, Images etc. 我知道在本地主机中运行应用程序时,这是我们必须替换前端文件的文件夹,如JSPJS文件, CSS文件, HTML文件, Images等。

There will be some tmp folders into which I have to replace the files into respective locations. 将有一些tmp文件夹,我必须将文件替换到相应的位置。 This folder will be having another folder with structure of a WAR file which I'll take from my work space and sometimes there will be multiple tmp folders like tmp0 , tmp1 , tmp2 etc (most of them having all required files). 这个文件夹将有另一个文件夹,其结构为WAR文件,我将从我的工作空间中获取,有时会有多个tmp文件夹,如tmp0tmp1tmp2等(其中大部分都有所有必需的文件)。 When there are multiple folders it is really confusing to decide that into which folder I need to replace the file(s). 当有多个文件夹时,确定我需要替换文件到哪个文件夹是很困惑的。

在此输入图像描述

Then I'll have to stop the server, kill all the java running in background (manually) and have to clear all the tmp folders (because if the java is not killed properly the jar files inside tmp 's cannot be deleted saying its currently being used). 然后我将不得不停止服务器,杀死所有在后台运行的java (手动)并且必须清除所有tmp文件夹(因为如果没有正确杀死java, tmpjar文件无法删除说当前正在使用)。 I guess one among these tmp folders are used by the server to run the application. 我想服务器使用这些tmp文件夹中的一个来运行应用程序。

After cleaning all the tmp folders if I start the server again, the first file created in that folder ( org.eclipse.wst.server.core ) will be one servers.xml , then one tmp0 will be created may be tmp1 . 如果我再次启动服务器清理所有tmp文件夹后,在该文件夹( org.eclipse.wst.server.core )中创建的第一个文件将是一个servers.xml ,那么将创建一个tmp0可能是tmp1 When entire project is published only one tmp folder will be there, if I publish multiple times, another tmp folder will be created, may be 2nd time, 3rd time or nth time. 发布整个项目时,只有一个tmp文件夹,如果我多次发布,则会创建另一个tmp文件夹,可能是第二次,第三次或第n次。

So my questions are 所以我的问题是

  1. Is there a general name for org.eclipse.wst.server.core folder? org.eclipse.wst.server.core文件夹是否有通用名称?
  2. Why multiple tmp folders are created when publised multiple times? 为什么多次公布时会创建多个tmp文件夹? Can we restrict it into a single tmp folder? 我们可以将它限制在一个tmp文件夹中吗?

  3. After the project is published, is there a possibility that server will use multiple tmp folders for different request. 项目发布后,服务器是否有可能使用多个tmp文件夹来处理不同的请求。 Like for first request I uses tmp0 and when I refresh the page it uses tmp1 folder? 喜欢第一个请求我使用tmp0 ,当我刷新页面时,它使用tmp1文件夹?

Edited regarding the 3rd question 关于第3个问题编辑

I opened all the xml files in the folder given in the above image, and in tmp-data.xml , I found this content 我打开了上图中给出的文件夹中的所有xml文件,在tmp-data.xml ,我找到了这个内容

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<temp-directories>
  <temp-directory age="0" key="GlassFish v2.1 Java EE 5 at localhost" path="tmp0"/>
</temp-directories>

Where path attribute is given value as tmp0 . 其中path属性的值为tmp0 So I'm guessing that will be the answer to my third question. 所以我猜这将是我第三个问题的答案。 I'm guessing this file will be created when there are multiple tmp folders, because after deleting all tmp folders and files in the folder and after publishing the work space the tmp-data.xml file was not present. 我猜这个文件将在有多个tmp文件夹时创建,因为删除文件夹中的所有tmp文件夹和文件后,在发布工作空间后, tmp-data.xml文件不存在。

Edited regarding the WTP 编辑了WTP

I don't have much details about WTP, but when I clicked Help and selected About Eclipse in my eclipse I got this window 我没有太多关于WTP的细节,但当我点击Help并在我的日食中选择About Eclipse ,我得到了这个窗口

在此输入图像描述

  1. Not that I know of. 从来没听说过。 It is created by WTP (Web Tools Platform) using WST (Web Standard Tools). 它由WTP(Web工具平台)使用WST(Web标准工具)创建。 If you find, let me know too. 如果你找到了,也让我知道。

  2. That depends upon different checks that WTP and WST do before publishing the artifacts. 这取决于WTP和WST在发布工件之前所做的不同检查。 It does not happen all the time, but it does a lot more than expected, because of file locks that stop eclipse from publishing a fresh copy of the application. 它不会一直发生,但它比预期的要多得多,因为文件锁可以阻止eclipse发布应用程序的新副本。 And hence, the code must be trying to create new tmp folder just as a workaround. 因此,代码必须尝试创建新的tmp文件夹,就像解决方法一样。 The metadata (publish.xml) is then updated, and everything works as normal, which I feel is much better since the developer does not have to know a lot of stuff about these failures. 然后更新元数据(publish.xml),一切正常,我觉得这样做要好得多,因为开发人员不必知道很多关于这些失败的东西。 We can change this setting in the server properties in your eclipse. 我们可以在eclipse中的服务器属性中更改此设置。 Note that different plugins have different ways of doing this, my STS has default deploy path set to wtpwebapps. 请注意,不同的插件有不同的方法,我的STS默认部署路径设置为wtpwebapps。

  3. This must be available in your publish xml file. 这必须在您的发布xml文件中可用。 And it also depends upon the version of WTP / WST you are using. 它还取决于您使用的WTP / WST版本。 It is hard to see where the folder generation is happening (at least for me at this time), but you can look at PublishUtils.java and PublishDelegate.java in WTP. 很难看到文件夹生成的位置(至少在我这个时候),但你可以在WTP中查看PublishUtils.java和PublishDelegate.java。 Github here . Github在这里

  4. No certainly not, after a project is published the whole server points to the location at which the artifacts reside. 当然,在项目发布后,整个服务器指向工件所在的位置。 Though the context refresh might fail because of overlapping threads or wait time, it is not possible for two different instances to be deployed into the same server with the same application/context name. 虽然由于线程重叠或等待时间而导致上下文刷新失败,但是不可能将两个不同的实例部署到具有相同应用程序/上下文名称的同一服务器中。

Read this and this 阅读本文此内容

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以创建 websphere 服务器实例并使用 org.eclipse.wst.server.core 插件进行配置吗? - Can i create websphere server instance and configure using org.eclipse.wst.server.core plugin? 访问工作空间\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\中的文件 - Access files inside workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ 无法删除 /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/appname/WEB-INF/lib。 可能被另一个进程锁定 - Could not delete /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/appname/WEB-INF/lib. May be locked by another process IllegalArgumentException:文档库\\ .metadata \\ .plugins \\ org.eclipse.wst.server.core \\ tmp0 \\ wtpwebapps不存在或不是可读目录 - IllegalArgumentException: Document base \.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps does not exist or is not a readable directory 找不到org.eclipse.wst.server.core.serverTypes扩展点的架构 - No schema found for the org.eclipse.wst.server.core.serverTypes extension point Eclipse无法解析插件org.eclipse.wst.server.ui - Eclipse unable to resolve plugin org.eclipse.wst.server.ui 有关Java反射的几个问题 - A few questions about Java Reflection 关于 JSP 和 SQL 的问题。 Java web应用 - Questions about JSP & SQL. Java web application 关于Java Web Start的问题 - Questions about Java Web Start 什么是org.eclipse.wst.common.component以及如何将它用于ant - what is org.eclipse.wst.common.component and how to use it for ant
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM