本文介绍了将WAR部署到WebSphere 9需要3个小时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以前花了3分钟将我们的WAR部署到WebSphere 8.5.5.0。



将相同的WAR部署到WebSphere 9.0.0.2需要3个小时。 / p>

这是WebSphere 9.0.0.2中的错误的表现?
有没有人有类似的经验?



更新:
IBM的建议实验结果:



我们的WAR文件包含160个JAR文件,总大小为160MB。



对于新应用程序向导,从第一个屏幕,直到显示下一个屏幕。




  • WebSphere 8.5.5 - 3分钟


  • WebSphere 9 - 3小时


  • 添加Ignore-Scanning-Packages: org,net,com,javax行到WAR中的清单文件 - 30分钟


  • 将Enable-CDI:false EAR - 30分钟


  • 添加的行




Enable-CDI = false



Enable-Implicit-Bean-Archive = false



to C:\ Program Files\IBM \\WebSphere\AppServer\properties\amm.filter.properties文件 - 30分钟




  • 添加JVM属性



com.ibm.ws.cdi.enableImplicitBeanArchives



false



com.ibm.ws.cdi.enableCDI



false



在Servers- >服务器类型 - > WebSphere Application Server - > server1->服务器基础设施 - > Java和进程管理 - >进程定义 - > Java虚拟Mashine->自定义属性 - 30分钟




  • 添加JVM属性



-Dcom.ibm.ws.cdi.enableImplicitBeanArchives = false



-Dcom.ibm.ws.cdi.enableCDI = false



在服务器 - >服务器类型 - > WebSphere应用程序服务器 - > server1->服务器基础设施 - > Java和流程管理 - >流程定义 - > Java虚拟Mashine->通用JVM参数 - 30分钟



更新:SystemOut.log包含消息:



线程WebContainer :...已启用668644毫秒,可能会挂起。



堆栈跟踪包含:



at org.apache.commons.fileupload.MultipartStream.readBodyData



看起来WebSphere正在处理HTTP请求以上传文件。

解决方案

初步检查:对于这两个部署,应用程序被假定为正确相同。这是多或少的假设,但是有很多情况下,应用程序被推定为相同但不是,所以这需要验证。



在IBM WebSphere Application Server v8.5.5.0和v9.0之间,对支持的CDI级别进行了重大升级。也就是说,v9.0增加了对CDI 1.2的支持,它具有新的类和注释扫描要求。这些新的要求以及CDI在v9.0中使用的初始类和扫描实现中的一些问题可能导致应用程序部署的非常大的减速。



特别是中到大型网络模块的问题。这里中等到大是指具有许多WEB-INF / lib JAR文件的Web模块,总共大小为50MB或更大。



在简单的情况下,有两个已添加的修改默认CDI处理的自定义属性。有关这两个属性的信息,请参阅此页:





两个属性是(1)完全禁用CDI处理;或(2)禁用不包含beans.xml的归档的CDI处理。请参阅链接页面了解更多详细信息。



这两个属性在许多情况下提供了一个好处。应该先尝试他人,因为其他选项比较复杂。


It used to take 3 minutes to deploy our WAR to WebSphere 8.5.5.0.

It takes 3 hours to deploy the same WAR to WebSphere 9.0.0.2.

Is that a manifestation of a bug in WebSphere 9.0.0.2?Did anybody have similar experience?

UPDATE:Results of my experiments with settings suggested by IBM:http://www-01.ibm.com/support/docview.wss?uid=swg21983564

Our WAR file contains 160 JAR files with total size of 160MB.

Time is measured for the "New Application" wizard, from first screen, until the next screen is shown.

  • WebSphere 8.5.5 - 3 minutes

  • WebSphere 9 - 3 hours

  • Added "Ignore-Scanning-Packages: org, net, com, javax" line to manifest file in the WAR - 30 minutes

  • Added "Enable-CDI: false" line to manifest file in the EAR - 30 minutes

  • Added lines

Enable-CDI=false

Enable-Implicit-Bean-Archive=false

to C:\Program Files\IBM\WebSphere\AppServer\properties\amm.filter.properties file - 30 minutes

  • Added JVM properties

com.ibm.ws.cdi.enableImplicitBeanArchives

false

com.ibm.ws.cdi.enableCDI

false

in Servers->Server Types->WebSphere application servers->server1->Server Infrastrucure->Java and Process Management->Process definition->Java Virtual Mashine->Custom properties - 30 minutes

  • Added JVM properties

-Dcom.ibm.ws.cdi.enableImplicitBeanArchives=false

-Dcom.ibm.ws.cdi.enableCDI=false

in Servers->Server Types->WebSphere application servers->server1->Server Infrastrucure->Java and Process Management->Process definition->Java Virtual Mashine->Generic JVM arguments - 30 minutes

UPDATE: SystemOut.log contains message:

Thread "WebContainer : ... has been active for 668644 milliseconds and may be hung.

Stack Trace contains:

at org.apache.commons.fileupload.MultipartStream.readBodyData

It looks like WebSphere is processing HTTP request to upload a file.

解决方案

A preliminary check: The application is presumed to be exactly the same for both deployments. This is more-or-less assumed, but there have been a lot of cases where the application was presumed to be the same but it wasn't, so this needs to be verified.

Between IBM WebSphere Application Server v8.5.5.0 and v9.0, a significant upgrade was made to the CDI level which is supported. That is, v9.0 adds support for CDI 1.2, which has new class and annotation scanning requirements. These new requirements, together with some problems in the initial class and scanning implementation which is used by CDI in v9.0 can cause a very large slowdown of application deployments.

The problem has been noted in particular with medium to large web modules. Here "medium to large" means web modules which have many WEB-INF/lib JAR files with a total size of 50MB or more.

In simple cases, there are two custom properties which have been added which modify the default CDI processing. See this page for information about the two properties:

http://www-01.ibm.com/support/docview.wss?uid=swg21983564

The two properties are to (1) disable CDI processing entirely; or (2) disable CDI processing for archives which do not contain a "beans.xml". See the linked page for additional details.

These two properties provide a benefit in many cases. They should be tried first, as other options are more complicated to try.

这篇关于将WAR部署到WebSphere 9需要3个小时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 08:56