Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Problem: Repeated instantiation of ViolationMessageBuilder.java causes thread to block at java.util.Hashtable.
Current field :
private final String lineSeparator = System.getProperty("line.separator");
Currently it is getting initialized every time ViolationMessageBuilder is instantiated by the code.
Fix :
Change it to static variable :
private static final String lineSeparator = System.getProperty("line.separator");
This will prevent java.util.HashTable (System.getProperty("line.separator") being called every time ViolationMessageBuilder instantiated.
Sample thread block noticed at high concurrency
java.lang.Thread.State: BLOCKED (on object monitor)
at java.util.Hashtable.get(Ljava/lang/Object;)Ljava/lang/Object;(Hashtable.java:363)
- waiting to lock <0x000000069a4fc6e0> (a java.util.Properties)
at java.util.Properties.getProperty(Ljava/lang/String;)Ljava/lang/String;(Properties.java:1093)
at java.lang.System.getProperty(Ljava/lang/String;)Ljava/lang/String;(System.java:732)
at org.apache.webbeans.exception.helper.ViolationMessageBuilder.<init>()V(ViolationMessageBuilder.java:25)
at org.apache.webbeans.exception.helper.ViolationMessageBuilder.newViolation([Ljava/lang/String;)Lorg/apache/webbeans/exception/helper/ViolationMessageBuilder;(ViolationMessageBuilder.java:34)
at org.apache.webbeans.util.InjectionExceptionUtil.throwUnsatisfiedResolutionException(Ljava/lang/Class;Ljavax/enterprise/inject/spi/InjectionPoint;[Ljava/lang/annotation/Annotation;)V(InjectionExceptionUtil.java:51)
at org.apache.webbeans.container.InjectionResolver.getInjectionPointBean(Ljavax/enterprise/inject/spi/InjectionPoint;)Ljavax/enterprise/inject/spi/Bean;(InjectionResolver.java:293)
Attachments
Issue Links
- is related to
-
TOMEE-3776 WebappBeanManager calls to getInjectionPointBean(injectionPoint) results in UnsatisfiedResolutionException lot of times
- Resolved