WebSphere Liberty 8.5.5.5和8.5.5.6+之间的巨大启动差异

时间:2015-09-19 12:41:13

标签: java-8 java-ee-7 websphere-liberty

我有一个标准的Java EE应用程序,我一直在部署到WAS Liberty 8.5.5.5,但由于Liberty 8.5.5.6引入了对Java EE 7的支持,我决定移植代码。

我不需要进行任何代码更改,无法使用WebProfile 7.0功能在Liberty 8.5.5.6中部署项目。该项目使用JSF 2.0 +,JPA 2.0 +,EJB 3.1 +。

我的问题是为什么启动时间差异很大?以前相同的应用程序在8.5.5.5中大约12秒开始,但现在在8.5.5.6+中开始需要50秒以上。

注意:我使用的是Oracles JDK 1.8.0_45。

8.5.5.5的控制台日志

Launching vamsServer (WebSphere Application Server 8.5.5.5/wlp-1.0.8.cl50520150221-0034) on Java HotSpot(TM) Client VM, version 1.8.0_45-b15 (en_US)
[AUDIT   ] CWWKE0001I: The server vamsServer has been launched.
[AUDIT   ] CWWKE0100I: This product is licensed for development and limited production use. The full license terms can be viewed here: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/8.5.5.5/lafiles/en.html
[INFO    ] TRAS0018I: The trace state has been changed. The new trace state is *=audit.
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications. 
[WARNING ] DSRA0174W: Warning: GenericDataStoreHelper is being used.
04:03:55.179 [Default Executor-thread-2] INFO  org.springframework.data.jpa.repository.cdi.JpaRepositoryExtension - Activating CDI extension for Spring Data JPA repositories.
04:03:55.349 [Default Executor-thread-2] INFO  org.springframework.data.jpa.repository.cdi.JpaRepositoryExtension - Activating CDI extension for Spring Data JPA repositories.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://localhost:9080/vams-web/
[AUDIT   ] CWWKZ0001I: Application vams started in 12.187 seconds.
[AUDIT   ] CWWKF0012I: The server installed the following features: [jsf-2.0, ejbLite-3.1, jsp-2.2, managedBeans-1.0, servlet-3.0, ssl-1.0, jndi-1.0, cdi-1.0, localConnector-1.0, jdbc-4.0, appSecurity-2.0, jaxrs-1.1, json-1.0, webProfile-6.0, distributedMap-1.0, beanValidation-1.0, jpa-2.0].
[AUDIT   ] CWWKF0011I: The server vamsServer is ready to run a smarter planet.

8.5.5.6的控制台日志

Launching defaultServer (WebSphere Application Server 8.5.5.6/wlp-1.0.9.cl50620150610-1749) on Java HotSpot(TM) Client VM, version 1.8.0_45-b15 (en_US)
[AUDIT   ] CWWKE0001I: The server defaultServer has been launched.
[AUDIT   ] CWWKE0100I: This product is licensed for development, and limited production use. The full license terms can be viewed here: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/8.5.5.6/lafiles/en.html
[INFO    ] CWWKE0002I: The kernel started after 1.485 seconds
[INFO    ] CWWKF0007I: Feature update started.
[INFO    ] CWWKS0007I: The security service is starting...
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications. 
[INFO    ] CWWKO0219I: TCP Channel defaultHttpEndpoint has been started and is now listening for requests on host localhost  (IPv4: 127.0.0.1) port 9081.
[INFO    ] CWWKS4105I: LTPA configuration is ready after 0.219 seconds.
[INFO    ] DYNA1001I: WebSphere Dynamic Cache instance named baseCache initialized successfully.
[INFO    ] DYNA1071I: The cache provider default is being used.
[INFO    ] DYNA1056I: Dynamic Cache (object cache) initialized successfully.
[INFO    ] CWWKZ0018I: Starting application labtracker.
[INFO    ] CWWJP9990I: Detected server platform: org.eclipse.persistence.platform.server.was.WebSphere_Liberty_Platform.
[INFO    ] CWWJP9990I: EclipseLink, version: Eclipse Persistence Services - 2.6.0.WAS-v20150513-26196d2
[INFO    ] CWWJP9990I: Not able to detect platform for vendor name [Generic Component Context DataSource0Generic Component Context DataSource : jdbc/labtracker-db]. Defaulting to [org.eclipse.persistence.platform.database.DatabasePlatform]. The database dialect used may not match with the database you are using. Please explicitly provide a platform using property "eclipselink.target-database".
[INFO    ] WELD-000900: SNAPSHOT
[AUDIT   ] CWWKZ0022W: Application labtracker has not started in 29.953 seconds.
[AUDIT   ] CWWKF0012I: The server installed the following features: [jsp-2.3, ejbLite-3.2, managedBeans-1.0, jsf-2.2, beanValidation-1.1, servlet-3.1, ssl-1.0, jndi-1.0, jsonp-1.0, appSecurity-2.0, jdbc-4.1, jaxrs-2.0, javaMail-1.5, jaxrsClient-2.0, el-3.0, json-1.0, cdi-1.2, distributedMap-1.0, webProfile-7.0, websocket-1.1, jpa-2.1].
[INFO    ] CWWKF0008I: Feature update completed in 33.496 seconds.
[AUDIT   ] CWWKF0011I: The server defaultServer is ready to run a smarter planet.
05:11:32.977 [Default Executor-thread-13] INFO  org.springframework.data.jpa.repository.cdi.JpaRepositoryExtension - Activating CDI extension for Spring Data JPA repositories.
[WARNING ] WELD-000411: Observer method [BackedAnnotatedMethod] public org.omnifaces.VetoAnnotatedTypeExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
[WARNING ] WELD-000411: Observer method [BackedAnnotatedMethod] public com.ibm.ws.beanvalidation.v11.cdi.internal.ValidationExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
[WARNING ] WELD-000411: Observer method [BackedAnnotatedMethod] private com.ibm.ws.beanvalidation.v11.cdi.internal.ValidationExtension.internalProcessAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
[WARNING ] WELD-000411: Observer method [BackedAnnotatedMethod] protected org.springframework.data.repository.cdi.CdiRepositoryExtensionSupport.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
[INFO    ] CNTR4000I: The labtracker.war EJB module in the labtracker application is starting.
[INFO    ] CNTR0167I: The server is binding the au.com.ibm.labtracker.service.impl.UserSvc interface of the UserSvc enterprise bean in the labtracker.war module of the labtracker application.  The binding location is: java:global/labtracker/UserSvc!au.com.ibm.labtracker.service.impl.UserSvc
[INFO    ] CNTR0167I: The server is binding the au.com.ibm.labtracker.service.IUserSvc interface of the UserSvc enterprise bean in the labtracker.war module of the labtracker application.  The binding location is: java:global/labtracker/UserSvc!au.com.ibm.labtracker.service.IUserSvc
[INFO    ] CNTR4001I: The labtracker.war EJB module in the labtracker application has started successfully.
[INFO    ] SRVE0169I: Loading Web Module: labtracker.
[INFO    ] SRVE0250I: Web Module labtracker has been bound to default_host.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://localhost:9081/labtracker/
[AUDIT   ] CWWKZ0001I: Application labtracker started in 50.783 seconds.

2 个答案:

答案 0 :(得分:0)

我想知道减速是否与EclipseLink有所不同。请注意,jpa-2.0功能使用Open JPA作为底层JPA提供程序,而jpa-2.1使用EclipseLink。

似乎已经过去的时间消息与您的控制台日志中的消息一致(尽管这没有任何证据)。而且我不是专家,但我想知道这条消息:

  

CWWJP9990I:无法检测供应商名称的平台...

可能与减速相关。

由于您不能将webProfile-7.0功能(包括jpa-2.1)与jpa-2.0一起使用,但遗憾的是,您仍然要么坚持使用EE 6级功能,要么深入了解减速。

并不是说CDI也没有相关差异。尽管如此,您的应用程序似乎实际上正在使用CDI注释,因此您可能无法将其完全关闭。

答案 1 :(得分:0)

更新如果将以下xml添加到liberty server.xml中,您应该会看到启动时间的显着改善

<cdi12 enableImplicitBeanArchives="false"/>