Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0034179Openbravo ERPA. Platformpublic2016-10-10 10:582016-12-16 18:37
alostale 
alostale 
urgentminorrandom
closedfixed 
5
 
3.0PR17Q13.0PR17Q1 
caristu
Core
No
0034179: random request failures
If for some reason (was not able to reproduce it), weld listener leaves a request thread in an inconsistent state, the next time this thread is used to process another request, this request produces an error 500 and is rejected.

This causes random requests to fail from this point.

Weld tries to fix this problem and log a WARN, the error is caused internally when trying to log it.
I was unable to reproduce the cause the request is set in invalid state, so alternatively.

1. Add TestListener.java in the sources and modify web.xml to be used as 1st listener
2. Try to open openbravo:
  2.1 All requests are rejected
  2.2 In localhost.log see:
   Oct 05, 2016 10:18:42 AM org.apache.catalina.core.StandardContext fireRequestInitEvent
SEVERE: Exception sending request initialized lifecycle event to listener instance of class org.jboss.weld.environment.servlet.Listener
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:872)
        at java.lang.StringBuilder.substring(StringBuilder.java:72)
        at java.lang.AbstractStringBuilder.subSequence(AbstractStringBuilder.java:849)
        at java.lang.StringBuilder.subSequence(StringBuilder.java:72)
        at ch.qos.cal10n.util.LexicalUtil.convertSpecialCharacters(LexicalUtil.java:42)
        at ch.qos.cal10n.util.TokenStream.tokenizeLine(TokenStream.java:146)
        at ch.qos.cal10n.util.TokenStream.tokenize(TokenStream.java:67)
        at ch.qos.cal10n.util.Parser.<init>(Parser.java:56)
        at ch.qos.cal10n.util.CAL10NResourceBundle.read(CAL10NResourceBundle.java:56)
        at ch.qos.cal10n.util.CAL10NResourceBundle.<init>(CAL10NResourceBundle.java:50)
        at ch.qos.cal10n.util.CAL10NResourceBundleFinder.makePropertyResourceBundle(CAL10NResourceBundleFinder.java:83)
        at ch.qos.cal10n.util.CAL10NResourceBundleFinder.getBundle(CAL10NResourceBundleFinder.java:51)
        at ch.qos.cal10n.MessageConveyor.lookup(MessageConveyor.java:111)
        at ch.qos.cal10n.MessageConveyor.getMessage(MessageConveyor.java:77)
        at org.jboss.weld.logging.WeldMessageConveyor.getMessage(WeldMessageConveyor.java:68)
        at org.slf4j.cal10n.LocLogger.warn(LocLogger.java:141)
        at org.jboss.weld.context.http.HttpRequestContextImpl.associate(HttpRequestContextImpl.java:58)
        at org.jboss.weld.context.http.HttpRequestContextImpl.associate(HttpRequestContextImpl.java:41)
        at org.jboss.weld.servlet.WeldListener.requestInitialized(WeldListener.java:204)
        at org.jboss.weld.servlet.api.helpers.ForwardingServletListener.requestInitialized(ForwardingServletListener.java:47)
        at org.apache.catalina.core.StandardContext.fireRequestInitEvent(StandardContext.java:6166)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:166)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:193)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
The error is thrown when trying to get the localized message in cal10n library. Currently, the cal10n version is 0.7.4.

Weld 1.1.24 depends on newer cal10n 0.7.7 which correctly handles weld messages.
No tags attached.
related to feature request 0027245 closed alostale upgrade weld 
? TestListener.java (2,272) 2016-10-14 08:20
https://issues.openbravo.com/file_download.php?file_id=9910&type=bug
Issue History
2016-10-10 10:58alostaleNew Issue
2016-10-10 10:58alostaleAssigned To => platform
2016-10-10 10:58alostaleModules => Core
2016-10-10 10:58alostaleTriggers an Emergency Pack => No
2016-10-10 11:02alostaleDescription Updatedbug_revision_view_page.php?rev_id=13339#r13339
2016-10-10 11:02alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=13341#r13341
2016-10-10 11:02alostaleRelationship addedrelated to 0027245
2016-10-10 11:03alostaleReview Assigned To => caristu
2016-10-10 11:09alostaleProposed Solution updated
2016-10-10 11:46alostaleStatusnew => scheduled
2016-10-10 11:46alostaleTarget Version => 3.0PR17Q1
2016-10-14 08:11hgbotCheckin
2016-10-14 08:11hgbotNote Added: 0090561
2016-10-14 08:11hgbotStatusscheduled => resolved
2016-10-14 08:11hgbotResolutionopen => fixed
2016-10-14 08:11hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/2d6dd13cc6ddbbc2e5feee5159e1aafe348d4c00 [^]
2016-10-14 08:15alostaleAssigned Toplatform => alostale
2016-10-14 08:20alostaleFile Added: TestListener.java
2016-10-21 11:03caristuNote Added: 0090754
2016-10-21 11:03caristuStatusresolved => closed
2016-10-21 11:03caristuFixed in Version => 3.0PR17Q1
2016-12-16 18:37hudsonbotCheckin
2016-12-16 18:37hudsonbotNote Added: 0092505

Notes
(0090561)
hgbot   
2016-10-14 08:11   
Repository: erp/devel/pi
Changeset: 2d6dd13cc6ddbbc2e5feee5159e1aafe348d4c00
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Oct 10 11:45:08 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/2d6dd13cc6ddbbc2e5feee5159e1aafe348d4c00 [^]

fixed bug 34179: random request failures

  Updated cal10n-api from 0.7.4 to 0.7.7, which fixes parsing of Weld messages
  that were causing an exception.

---
M legal/Licensing.txt
A modules/org.openbravo.base.weld/lib/runtime/cal10n-api-0.7.7.jar
R modules/org.openbravo.base.weld/lib/runtime/cal10n-api-0.7.4.jar
---
(0090754)
caristu   
2016-10-21 11:03   
Verified
(0092505)
hudsonbot   
2016-12-16 18:37   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/dc8bf00badd0 [^]
Maturity status: Test