Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformcriticalrandom2019-02-15 08:062019-11-12 15:48
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PriorityurgentResolutionfixedFixed in Version3.0PR19Q2
StatusclosedFix in branchFixed in SCM revision5318eb8145c5
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0040211: Servlets randomly become unavailable on 1st request

DescriptionIn environments with high concurrency, some Servlets can randomly become unlivable on their first request. When this occurs, the servlet cannot be recovered without restarting Tomcat, the effect is server returning HTTP 404 (unavailable) for this Servlet.
Steps To ReproduceIt cannot be easily reproduced, we've detected this problem in some customers with high concurrency occurring once a year.

When this happens this can be seen in localhost.log:

11-Feb-2019 23:08:24.695 INFO [ajp-nio-] org.apache.catalina.core.ApplicationContext.log Marking servlet [P43ADA4F09EAD4034A8F9B1F4759407B5] as unavailable
11-Feb-2019 23:08:24.696 SEVERE [ajp-nio-] org.apache.catalina.core.StandardWrapperValve.invoke Allocate exception for servlet [P43ADA4F09EAD4034A8F9B1F4759407B5]
        at org.jboss.weld.environment.servlet.inject.AbstractInjector.inject(
        at org.jboss.weld.environment.tomcat7.WeldInstanceManager.newInstance(
        at org.jboss.weld.environment.tomcat7.WeldForwardingInstanceManager.newInstance(
        at org.apache.catalina.core.StandardWrapper.loadServlet(
        at org.apache.catalina.core.StandardWrapper.allocate(
        at org.apache.catalina.core.StandardWrapperValve.invoke(
        at org.apache.catalina.core.StandardContextValve.invoke(
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
        at org.apache.catalina.core.StandardHostValve.invoke(
        at org.apache.catalina.valves.ErrorReportValve.invoke(
        at org.apache.catalina.core.StandardEngineValve.invoke(
        at org.apache.catalina.connector.CoyoteAdapter.service(
        at org.apache.coyote.ajp.AjpProcessor.service(
        at org.apache.coyote.AbstractProcessorLight.process(
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.base/java.util.concurrent.ThreadPoolExecutor$
        at org.apache.tomcat.util.threads.TaskThread$
        at java.base/
Proposed SolutionThis problem seems to be caused by this Weld issue [1]. Backporting it to our current Weld version (1.1.24) is not feasible as it depends, at least, on some other refactors [2].

The proper solution would be to upgrade Weld 0040193.

Temporary workaround
This problem should not occur if we eagerly initialize all Servlets in a single thread on Tomcat start. I've done a quick test by manually editing web.xml adding load-on-start to all servlets to measure the impact: startup time increases 1-2 seconds and retained heap ~12MB, so I don't think this should be problematic.

Note 0040192 is a dependency for this workaround, as XmlEngine defined as Servlet throws an exception on Tomcat startup:

SEVERE: StandardWrapper.Throwable
    at java.base/<init>(
    at org.openbravo.xmlEngine.XmlEngine.init(
    at org.apache.catalina.core.StandardWrapper.initServlet(
    at org.apache.catalina.core.StandardWrapper.loadServlet(
    at org.apache.catalina.core.StandardWrapper.load(
    at org.apache.catalina.core.StandardContext.loadOnStartup(
    at org.apache.catalina.core.StandardContext.startInternal(
    at or40192g.apache.catalina.util.LifecycleBase.start(
    at org.apache.catalina.core.ContainerBase$
    at org.apache.catalina.core.ContainerBase$
    at java.base/
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.base/java.util.concurrent.ThreadPoolExecutor$
    at java.base/

[1] [^]
[2] [^]
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 0040193 closedcaristu upgrade Weld to version 3.1.0.Final 
depends on defect 0040192 closedalostale XmlEngine should not be a Servlet 

-  Notes
hgbot (developer)
2019-02-18 08:53

Repository: erp/devel/pi
Changeset: 5318eb8145c5b04f82d59adc609d150e9b69c1fa
Author: Asier Lostalé <asier.lostale <at>>
Date: Fri Feb 15 09:11:12 2019 +0100
URL: [^]

fixed bug 40211: Servlets randomly become unavailable on 1st request

  Implemented temporary workaround until Weld gets updated. Now all Servlets that
  do not specify any startup order, are eagerly loaded on server startup. This is
  done by a single thread preventing in this way race conditions in Wel's buggy

  It's possible to prevent concrete Servlets to be load on startup by setting to
  a negative number their load on startup field.

M src-wad/src/org/openbravo/wad/
M src-wad/src/org/openbravo/wad/web.xml
caristu (developer)
2019-02-22 10:56

Reviewed + tested
hudsonbot (developer)
2019-03-28 14:56

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: [^]
Maturity status: Test
hgbot (developer)
2019-04-02 18:06

Repository: erp/devel/pi
Changeset: 211ad7c835e5e14e63568c737b975d4ea4edc3a4
Author: Carlos Aristu <carlos.aristu <at>>
Date: Thu Mar 07 18:47:52 2019 +0100
URL: [^]

[weld31] Revert change for bug 40211

  Fix for issue[1] was a temporary solution due to an issue in weld which is already solved in version 3.1.0. Therefore now the fix is reverted.

  [1] [^]
  [2] [^]

M src-wad/src/org/openbravo/wad/
M src-wad/src/org/openbravo/wad/web.xml
hudsonbot (developer)
2019-05-21 15:16

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2019-02-15 08:06 alostale New Issue
2019-02-15 08:06 alostale Assigned To => alostale
2019-02-15 08:06 alostale Modules => Core
2019-02-15 08:06 alostale Triggers an Emergency Pack => No
2019-02-15 08:07 alostale Relationship added related to 0040193
2019-02-15 08:17 alostale Proposed Solution updated
2019-02-15 08:17 alostale Relationship added depends on 0040192
2019-02-18 08:53 hgbot Checkin
2019-02-18 08:53 hgbot Note Added: 0109888
2019-02-18 08:53 hgbot Status new => resolved
2019-02-18 08:53 hgbot Resolution open => fixed
2019-02-18 08:53 hgbot Fixed in SCM revision => [^]
2019-02-18 09:00 alostale Review Assigned To => caristu
2019-02-22 10:56 caristu Note Added: 0110024
2019-02-22 10:56 caristu Status resolved => closed
2019-02-22 10:56 caristu Fixed in Version => 3.0PR19Q2
2019-03-28 14:56 hudsonbot Checkin
2019-03-28 14:56 hudsonbot Note Added: 0110820
2019-04-02 18:06 hgbot Checkin
2019-04-02 18:06 hgbot Note Added: 0110970
2019-05-21 15:16 hudsonbot Checkin
2019-05-21 15:16 hudsonbot Note Added: 0111957
2019-11-12 15:48 alostale Severity major => critical

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker