0

I have a standard Java EE application which I had been deploying to WAS Liberty 8.5.5.5 but since Liberty 8.5.5.6 introduced support for Java EE 7 I decided to port the code.

I didn't need to make any code changes to get the project to deploy in Liberty 8.5.5.6 using the WebProfile 7.0 feature. The project uses JSF 2.0+, JPA 2.0+, EJB 3.1+.

My question is why the big difference in startup time? Previously the same application started in roughly 12 seconds in 8.5.5.5 but now in 8.5.5.6+ it takes 50+ seconds to start.

Note: I am using Oracles JDK 1.8.0_45.

Console Log for 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.

Console Log for 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.
  • 1
    I don't know why webProfile-7.0 is that much slower, but my first guess would be CDI: in EE 6, CDI is disabled by default, but in EE 7, it is enabled by default, which means all your applications must be scanned for annotations. The webProfile features are intended for convenience, but if you don't actually need all the capabilities, then I would strongly recommend replacing it with the subset of features you actually need. – Brett Kail Sep 19 '15 at 15:38
  • 2
    Bkail is right, if you don't need JavaEE 7 capabilities you should stick with the JavaEE 6 features. CDI in EE 7 requires a lot more scanning to be done which does slow things down quite a bit. We are working on improving the performance and the latest beta should perform better. – Alasdair Sep 19 '15 at 15:42
  • Hi Alasdair thanks for responding ... not really buying the "don''t use if you don't need it argument" :) ? For the most part I don't need Java EE 7 features but the spec is more than 2 years old now so I want to start using it. Is there anyway to optimize the scanning. Does liberty honor this -> http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.0.0/com.ibm.websphere.nd.doc/info/ae/ae/trun_app_reduce_annot.html – Edwin Quai Hoi Sep 23 '15 at 06:21

2 Answers2

1

Update If you add the following xml into your liberty server.xml you should see a dramatic improvement in startup time

<cdi12 enableImplicitBeanArchives="false"/>
0

I wonder if the slowdown has to do with EclipseLink somehow. Note the jpa-2.0 feature uses Open JPA as the underlying JPA provider while jpa-2.1 uses EclipseLink.

Seems like the time elapsed messages are consistent with that in your console logs (though that doesn't prove anything). And I'm no expert but am wondering if the message:

CWWJP9990I: Not able to detect platform for vendor name...

might correlate with the slowdown.

Since you can't use the webProfile-7.0 feature (which includes jpa-2.1) together with jpa-2.0, that still unfortunately leaves you either sticking with the EE 6 level features or digging deeper into understanding the slowdown.

Not to say there couldn't be a difference related to CDI as well. Still, it seems like your app is actually using CDI annotations, so you probably wouldn't be able to turn it off altogether.

Scott Kurz
  • 4,985
  • 1
  • 18
  • 40