Page 1 of 1

WebApplicationInitializer creating a huge build delay

Posted: Mon Mar 09, 2015 8:03 pm
by jnate
Hi, I am new to braodlead and I managed to configure it to get the demo site running. However each time I run the jetty-demo, it takes almost 3 minutes sometimes as you can see below between these 2 build steps:
[artifact:mvn] 2015-03-09 20:50:33.391:INFO:oejpw.PlusConfiguration:No Transaction manager found - if your webapp requires one, please configure one.
[artifact:mvn] 2015-03-09 20:52:40.819:INFO:/:No Spring WebApplicationInitializer types detected on classpath


I believe there is an issue with the searching of "WebApplicationInitializer". Is that necessary? Can such step be simply ignored? If so, how to have it ignored?

I searched for the solution around the web but most answers seem outdated and their solution can't seem to work anymore.
For instance, I entered in the web.xml the following line:

Code: Select all

<absolute-ordering/>

but that gets outlined with the following message:
cvc-complex-type.2.4.a: Invalid content was found starting with element 'absolute-ordering'. One of '{"http://
java.sun.com/xml/ns/j2ee":description, "http://java.sun.com/xml/ns/j2ee":display-name, "http://java.sun.com/xml/ns/
j2ee":icon, "http://java.sun.com/xml/ns/j2ee":distributable, "http://java.sun.com/xml/ns/j2ee":context-param, "http://
java.sun.com/xml/ns/j2ee":filter, "http://java.sun.com/xml/ns/j2ee":filter-mapping, "http://java.sun.com/xml/ns/
j2ee":listener, "http://java.sun.com/xml/ns/j2ee":servlet, "http://java.sun.com/xml/ns/j2ee":servlet-mapping, "http://
java.sun.com/xml/ns/j2ee":session-config, "http://java.sun.com/xml/ns/j2ee":mime-mapping, "http://java.sun.com/xml/
ns/j2ee":welcome-file-list, "http://java.sun.com/xml/ns/j2ee":error-page, "http://java.sun.com/xml/ns/j2ee":jsp-config,
"http://java.sun.com/xml/ns/j2ee":security-constraint, "http://java.sun.com/xml/ns/j2ee":login-config, "http://
java.sun.com/xml/ns/j2ee":security-role, "http://java.sun.com/xml/ns/j2ee":env-entry, "http://java.sun.com/xml/ns/
j2ee":ejb-ref, "http://java.sun.com/xml/ns/j2ee":ejb-local-ref, "http://java.sun.com/xml/ns/j2ee":service-ref, "http://
java.sun.com/xml/ns/j2ee":resource-ref, "http://java.sun.com/xml/ns/j2ee":resource-env-ref, "http://java.sun.com/xml/ns/
j2ee":message-destination-ref, "http://java.sun.com/xml/ns/j2ee":message-destination, "http://java.sun.com/xml/ns/
j2ee":locale-encoding-mapping-list}' is expected.


It would be greatly appreciated if someone could help me out with this issue.
Thanks in advance!

Re: WebApplicationInitializer creating a huge build delay

Posted: Wed Mar 11, 2015 10:09 am
by phillipuniverse
The problem with Jetty taking a long time is the way that it initializes SSL. It relies on entropy of your system (moving the mouse, typing, etc) to generate randomness. In the later versions of Broadleaf we are going to be using embedded Tomcat which was done in this pull request: https://github.com/BroadleafCommerce/De ... /160/files.

Re: WebApplicationInitializer creating a huge build delay

Posted: Sun Mar 15, 2015 2:07 am
by jnate
phillipuniverse wrote:The problem with Jetty taking a long time is the way that it initializes SSL. It relies on entropy of your system (moving the mouse, typing, etc) to generate randomness. In the later versions of Broadleaf we are going to be using embedded Tomcat which was done in this pull request: https://github.com/BroadleafCommerce/De ... /160/files.


Thank you for your reply. I am looking forward to its release.

In the mean time, I thought of creating a dummy WebApplicationInitializer class (called MyWebAppIni) and placed it under the package com.luuma.controller.seo . During the build, the console mentioned this time that WebApplicationInitializer was detected. It still took long to detect it. It's as if it continues to scan other files for the class even if it was already detected.

I then tried another alternative from the tutorial here: http://stefan-isele.logdown.com/posts/201646
From my understanding, I had to package MyWebAppIni class in a jar file(which I did), and using "webInfIncludeJarPattern" property, it should only look and scan for a specified jar pattern. However I'm not sure about the "contextPath" that I have to use or where I should be placing the jar file, hence the class in the jar was never detected during the build.

What am I doing wrong? Could this be a good alternative for the broadleaf framework?
Thanks