加速 RAD 7.5/WebSphere 7 部署的任何技巧

发布于 2024-10-19 06:15:35 字数 100 浏览 5 评论 0原文

最近,我开始使用 RAD 和 WebSphere 开发 Web 服务,发现一旦对代码进行更改,就需要一段时间才能重新发布 Ear 文件。

有什么技巧和建议可以加快速度吗?

Recently I started working with RAD and WebSphere on development of web services and found out that it takes a while to republish ear file once changes are made to the code.

Any tricks and suggestions to speed them up?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

謌踐踏愛綪 2024-10-26 06:15:35

有一个与此相关的已知问题,请参阅:http://www .ibm.com/support/docview.wss?rs=180&uid=swg21396021

在 web.xml 中将metadata-complete 值设置为 true 将阻止扫描注释并加快速度。

您还可以使用模块的清单文件中的注释扫描过滤器来选择性地阻止对 jar 文件的注释扫描。

There is a known problem about this, see: http://www.ibm.com/support/docview.wss?rs=180&uid=swg21396021

Setting the metadata-complete value to true in your web.xml will prevent scanning for annotations and speed up things.

You can also use the Annotation scanning filter in the manifest file of the module to selectively prevent annotation scanning of jar files.

七度光 2024-10-26 06:15:35

尝试一下,看看本文中是否有内容

https:// www.ibm.com/developerworks/wikis/download/attachments/113606723/radtipsv754.pdf

使您的 RAD 工作速度比当前更快。

华泰
曼鲁

Try this and see if there is something in this article

https://www.ibm.com/developerworks/wikis/download/attachments/113606723/radtipsv754.pdf

that make your RAD work faster for you than it is currently.

HTH
Manglu

丑疤怪 2024-10-26 06:15:35

这并不是 RAD 所特有的,但在使用 WebSphere 多年之后,我发现如果您不修改部署描述符或 Web 服务描述符,您可以简单地更新 WAS 应用程序服务器的 InstalledApps 文件夹中的展开的 EAR/WAR 文件。要更新,您只需将新 JAR 文件“解压缩”到该文件夹​​即可。

然后重新启动应用程序服务器。明显更快,尤其是当您的 WAS 启动速度很快时。

this is not specific with RAD, but after working years with WebSphere I found that if you're not modifying the deployment descriptor or the web service descriptor, you can simply update the exploded EAR/WAR file in the installedApps folder of your WAS application server. To update, you can simply "unzip" your new JAR file onto the folder.

Afterwards restart the application server. SIGNIFICANTLY faster, especially if your WAS startup is quick.

坚持沉默 2024-10-26 06:15:35

不幸的是,自从我们刚刚从 RAD 迁移到 Eclipse 以来,我还没有机会尝试它,但我建议您花几分钟时间检查 JRebel 是否可以与 RAD 配合使用。

如果它确实有效,它将减少构建/部署的数量到每天近 1 次(或计算机重新启动),就像我从 RAD+WAS7.5 迁移后使用 Eclipse+WAS8.5 所经历的那样。

@Edit:当然,RAD 不需要支持 JRebel,因为它被设计为独立运行 IDE,就像 maven、ant 和大量其他有用的工具一样。更重要的是它与 Websphere 一起运行,我假设 WAS 部署过程占用了您想要的大部分空闲时间。

Unfortunately i havent had the opportunity to try it out since we just moved from RAD to Eclipse but i recomend you to invest a few minutes in checking out if JRebel works with RAD.

If it does work it would reduce the amount of builds/ deploys to nearly 1 per day (or computer restart) as faar as i am experiencing it with Eclipse+WAS8.5 after moving from RAD+WAS7.5.

@Edit: For sure RAD does not need to support JRebel as it is designed to run IDE independent just as maven, ant and tonns of other helpful tools. More Important is the point it runs with Websphere and i assume the WAS deployment process takes the most of the time you want to spare.

不醒的梦 2024-10-26 06:15:35

有一些简单的步骤可以显着提高应用程序在 WebSphere 上的部署速度:

  1. 使用所有第三方 jar 定义 Ignore-Scanning-Archives,您不希望 Webshere 扫描注释。您可以在清单文件中或仅在 pom.xml 中执行此操作。请小心,没有正则表达式,如果您在清单中的一行中编写多个 jar,由于行长度的 manifest.mf 限制,它将无法工作。如果您将其写入manifest.mf,则需要转到新行,并在行首添加空格(请参见下面的示例)。

    但是你可以在maven war插件的配置中将其写在一行中(参见下面的完整示例),Maven会自动将其分成多行。

  2. 第二种方法是在Manifest/Maven/Websphere中定义
    Enable-Implicit-Bean-Archive 设置为 false
    它将禁用不包含 beans.xml 的包中的 CDI

  3. 第三种方法是增加 Websphere JVM 属性中的 java 堆大小。您需要转到:Websphere IBM Console ->服务器-> {您的服务器} ->服务器基础设施 -> Java 和进程管理 ->流程定义->附加属性 -> Java虚拟机->
    设置初始堆大小(MB) - 300(或更多)
    最大堆大小(MB) - 600(或更多)

pom.xml 中 maven-war-plugin 的代码示例:

 <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
            <failOnMissingWebXml>false</failOnMissingWebXml>
            <packagingExcludes>pom.xml</packagingExcludes>
            <archive>
                <manifestEntries>
                    <Enable-Implicit-Bean-Archive>false</Enable-Implicit-Bean-Archive>
                    <Ignore-Scanning-Archives>
                        hibernate-core-5.2.10.Final.jar,httpclient-4.4.1.jar,poi-ooxml-3.17.jar,poi-3.17.jar,poi-ooxml-schemas-3.17.jar,antlr-2.7.7.jar, apns-1.0.0.Beta6.jar,ews-java-api-2.0.jar,itextpdf-5.5.11.jar,byte-buddy-1.6.6.jar,xmlbeans-2.6.0.jar,guava-23.5-jre.jar,commons-collections4-4.1.jar
                    </Ignore-Scanning-Archives>
                </manifestEntries>
            </archive>
        </configuration>
    </plugin>

manifest.mf 示例

Manifest-Version: 1.0
Built-By: your-name
Enable-Implicit-Bean-Archive: false
Created-By: IntelliJ IDEA
Build-Jdk: 1.8.0_144
Ignore-Scanning-Archives: hibernate-core-5.2.10.Final.jar,httpclient-4
 .4.1.jar,poi-ooxml-3.17.jar,poi-3.17.jar,poi-ooxml-schemas-3.17.jar,a
 ntlr-2.7.7.jar, apns-1.0.0.Beta6.jar,ews-java-api-2.0.jar,itextpdf-5.
 5.11.jar,byte-buddy-1.6.6.jar,xmlbeans-2.6.0.jar,guava-23.5-jre.jar,c
 ommons-collections4-4.1.jar

There are some simple steps you can significantly improve deployment speed of your application on WebSphere:

  1. Define Ignore-Scanning-Archives with all third-party jars, that you don't want for Webshere scanning for annotations. You can do this in manifest file or simply in pom.xml. Be careful with it, there are no regex and if you write multiple jars in one line in manifest it will not work due to manifest.mf limitations of line length. If you write it in manifest.mf you need to go to new line with space at the start of line (see example below).

    But you can write it in one line in configuration of maven war plugin (see full example below) and Maven will automatically split it into multiple lines.

  2. Second approach is to define in Manifest/Maven/Websphere
    Enable-Implicit-Bean-Archive to false
    It will disable CDI in packages, which not contains beans.xml

  3. Third approach is to increase java heap size in Websphere JVM properties. You need to go: Websphere IBM Console -> Servers -> {your server} -> Server Infrastructure -> Java and Process Management -> Process definition -> Additional Properties -> Java Virtual Machine ->
    Set Initial heap size(MB) - 300 (or more)
    Maximum heap size(MB) - 600 (or more)

Code example for maven-war-plugin in pom.xml:

 <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
            <failOnMissingWebXml>false</failOnMissingWebXml>
            <packagingExcludes>pom.xml</packagingExcludes>
            <archive>
                <manifestEntries>
                    <Enable-Implicit-Bean-Archive>false</Enable-Implicit-Bean-Archive>
                    <Ignore-Scanning-Archives>
                        hibernate-core-5.2.10.Final.jar,httpclient-4.4.1.jar,poi-ooxml-3.17.jar,poi-3.17.jar,poi-ooxml-schemas-3.17.jar,antlr-2.7.7.jar, apns-1.0.0.Beta6.jar,ews-java-api-2.0.jar,itextpdf-5.5.11.jar,byte-buddy-1.6.6.jar,xmlbeans-2.6.0.jar,guava-23.5-jre.jar,commons-collections4-4.1.jar
                    </Ignore-Scanning-Archives>
                </manifestEntries>
            </archive>
        </configuration>
    </plugin>

Example of manifest.mf

Manifest-Version: 1.0
Built-By: your-name
Enable-Implicit-Bean-Archive: false
Created-By: IntelliJ IDEA
Build-Jdk: 1.8.0_144
Ignore-Scanning-Archives: hibernate-core-5.2.10.Final.jar,httpclient-4
 .4.1.jar,poi-ooxml-3.17.jar,poi-3.17.jar,poi-ooxml-schemas-3.17.jar,a
 ntlr-2.7.7.jar, apns-1.0.0.Beta6.jar,ews-java-api-2.0.jar,itextpdf-5.
 5.11.jar,byte-buddy-1.6.6.jar,xmlbeans-2.6.0.jar,guava-23.5-jre.jar,c
 ommons-collections4-4.1.jar
羁〃客ぐ 2024-10-26 06:15:35

减慢 RAD 速度的烦人的事情之一是服务器执行的自动发布。因此,如果您可以更改服务器配置编辑器(您可以通过双击服务器视图中的服务器来访问)中的选项,则有时可能会阻止发布不想。确保在需要更改时发布它。

另外,我认为如果您将选项更改为“发布而不复制资源”,也可以加快服务器的启动速度。

One of the annoying things that slows RAD is the automatic publishing that the server does.So if you can change the option in sever configuration editor (which you can access by double clicking the servers in server view) that could prevent publishing at times you don't want. Make sure you publish it when ever you need to make a change.

Also I think if you change the option to "publish without copying the resources" that could also speed up you sever startup.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文