java Jboss 一步一步设置热部署

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28044429/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 12:55:03  来源:igfitidea点击:

Jboss step by step set hot deploy

javajakarta-eenetbeansjbossnetbeans-8

提问by Micha? Ziembiński

Hello i would like ask how it is possible configure jboss server for something like live, hot deploment:

您好,我想问一下如何为实时热部署之类的东西配置 jboss 服务器:

  • every time when i change some code of my jsp,html,js or css file i always need to clean and build project than deploy project to jboss and again, agian and again. That cost alot of my time. I waste time for that. It will be easy when i could work on files which already use a started jboss (deployed). But this files is in WAR file "project.war" and throught my IDE (Netbeans) i cant edit this files (jsp,css,html or js). Netbeans made this file uneditable.
  • 每次当我更改我的 jsp、html、js 或 css 文件的一些代码时,我总是需要清理和构建项目,而不是将项目部署到 jboss,一次又一次。那花费了我很多时间。我为此浪费时间。当我可以处理已经使用已启动 jboss(已部署)的文件时,这将很容易。但是这个文件在 WAR 文件“project.war”中,通过我的 IDE(Netbeans)我不能编辑这个文件(jsp、css、html 或 js)。Netbeans 使该文件不可编辑。

enter image description here

在此处输入图片说明

I Would glad for solution step by step how it is possible to avoid this boring process.

我很高兴逐步解决如何避免这个无聊的过程。

采纳答案by bondkn

  1. Edit Standalone.xml,change development to "true"
    <configuration> <jsp-configuration development="true"/> </configuration>

  2. Start JBoss.

  3. Go to ServerLocation-> standalone\tmp\vfs
  4. Sort by "Date Modified" descending
  5. Open the first folder(something like deployment*******)
  6. There will be your complete exploded war.
  7. Go to the jsps,js,css location,edit & save the changes.
  8. changes will be displayed live.
  1. 编辑 Standalone.xml,将 development 更改为“true”
    <configuration> <jsp-configuration development="true"/> </configuration>

  2. 启动 JBoss。

  3. 转到 ServerLocation-> standalone\tmp\vfs
  4. 按“修改日期”降序排序
  5. 打开第一个文件夹(类似于部署*******)
  6. 将会有你完整的爆发War。
  7. 转到 jsps,js,css 位置,编辑并保存更改。
  8. 更改将实时显示。

回答by Atish Bundhe

Follow this procedure to enable hot deployment enable in JBOSS

按照此步骤在 JBOSS 中启用热部署

It will work on JBoos AS 7.0.1 and should work on other versions with slight changes

它将在 JBoos AS 7.0.1 上工作,并且应该在稍有变化的其他版本上工作

  1. Go to JBoss administrative panel (by default localhost:9990)
  2. Now in profile settings open Core - Deployment Scanners
  3. Turn on Autodeploy-Exploded (set to true)
  4. You can set scanner time (by default 5000 ms) to appropriate as according to you your (I prefer to set 2000, for more fast incremental publishing when I make changes in projects)
  1. 转到 JBoss 管理面板(默认为 localhost:9990)
  2. 现在在配置文件设置中打开核心 - 部署扫描仪
  3. 打开 Autodeploy-Exploded(设置为 true)
  4. 您可以根据您的情况将扫描仪时间(默认为 5000 毫秒)设置为适当的(我更喜欢设置 2000,以便在我对项目进行更改时更快地进行增量发布)

That it.

那个。

Now JBoss make HOT deploy for almost all kind of files

现在 JBoss 可以为几乎所有类型的文件进行 HOT 部署

回答by Oueslati Bechir

I think that you're looking for something like JRebel. For those who haven't had the chance to hear about it, it's a magic tool made to get rid of such annoying redeploys after every modification made in your source files.

我认为您正在寻找类似JRebel 的东西。对于那些没有机会听说过它的人来说,它是一个神奇的工具,可以在对源文件进行每次修改后摆脱这种烦人的重新部署。

As you're using Netbeans IDE, this a dedicated tutoexplaining how to set up JRebel.

当您使用 Netbeans IDE 时,这是一个专门的教程,解释了如何设置 JRebel。

回答by Y.S. Chen

I have the same problem. My solution is to run the program on debug mode without editing config file. Once you are done, you can see the result without restarting.

我也有同样的问题。我的解决方案是在调试模式下运行程序而不编辑配置文件。完成后,您无需重新启动即可看到结果。

回答by Conete Cristian

Deploy the app as exploded (project.war folder), add in your web.xml:

将应用程序部署为已分解(project.war 文件夹),在您的 web.xml 中添加:

<web-app>
    <context-param>
        <param-name>org.jboss.weld.development</param-name>
        <param-value>true</param-value>
    </context-param>

Copy class/jsp/etc, update the web.xml time stamp every-time you deploy(append blank line):

复制class/jsp/etc,每次部署时更新web.xml时间戳(追加空行):

set PRJ_HOME=C:\Temp2\MyProject\src\main\webapp
set PRJ_CLSS_HOME=%PRJ_HOME%\WEB-INF\classes\com\myProject

set JBOSS_HOME= C:\Java\jboss-4.2.3.GA-jdk6\server\default\deploy\MyProject.war
set JBOSS_CLSS_HOME= %JBOSS_HOME%\WEB-INF\classes\com\myProject

copy %PRJ_CLSS_HOME%\frontend\actions\profile\ProfileAction.class %JBOSS_CLSS_HOME%\frontend\actions\profile\ProfileAction.class
copy %PRJ_CLSS_HOME%\frontend\actions\profile\AjaxAction.class %JBOSS_CLSS_HOME%\frontend\actions\profile\AjaxAction.class

ECHO.>>%JBOSS_HOME%\WEB-INF\web.xml

回答by bakoma

I am using JBOSS AS 7.2

我正在使用 JBOSS AS 7.2

in http://127.0.0.1:9990/console/index.html#deployment-scanner

http://127.0.0.1:9990/console/index.html#deployment-scanner

Configuration ? Subsystems? Subsystem ? Deployment Scanners

配置 ?子系统?子系统 ? 部署扫描器

Click on Edit, turn "Auto Deploy Exploded" to true.

单击“编辑”,将“Auto Deploy Exploded”设置为 true。

回答by Anu Shibin Joseph Raj

If you are running JBoss EAP 7.x, add the following to your standalone XML:

如果您正在运行 JBoss EAP 7.x,请将以下内容添加到您的独立 XML 中:

<subsystem xmlns="urn:jboss:domain:undertow:7.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" default-security-domain="other">
    ...
    <servlet-container name="default">
        <jsp-config development="true" />
        <websockets />
    </servlet-container>
    ...
</subsystem>

回答by Polux d'Alhdga

You can change to JBoss see the deployments folder each ten seconds

您可以更改为 JBoss,每十秒查看一次部署文件夹

<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
    <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" 
scan-interval="10000"/>
</subsystem>