web connectors metrics uses long value as int in JBoss EAP 6.4
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6.4
Issue
- In JBoss EAP 6.4, the 'bytesSent' metrics on web subsystem connectors is defined in the code to be ModelType.INT, but the data it received from the JBossWeb is a long.
- We see the following exception checking
bytesSentvia CLI once it exceeds the int range:
java.lang.NumberFormatException: For input string: "2219513327"
at org.jboss.as.jmx.model.TypeConverters$IntegerValueAccessor.fromModelNode(TypeConverters.java:778)
at org.jboss.as.jmx.model.TypeConverters$SimpleTypeConverter.fromModelNode(TypeConverters.java:223)
at org.jboss.as.jmx.model.TypeConverters.fromModelNode(TypeConverters.java:114)
at org.jboss.as.jmx.model.ModelControllerMBeanHelper.getAttribute(ModelControllerMBeanHelper.java:257)
at org.jboss.as.jmx.model.ModelControllerMBeanHelper.getAttribute(ModelControllerMBeanHelper.java:212)
at org.jboss.as.jmx.model.ModelControllerMBeanServerPlugin.getAttribute(ModelControllerMBeanServerPlugin.java:127)
at org.jboss.as.jmx.PluggableMBeanServerImpl.getAttribute(PluggableMBeanServerImpl.java:356)
at org.jboss.as.jmx.BlockingNotificationMBeanServer.getAttribute(BlockingNotificationMBeanServer.java:148)
at org.jboss.remotingjmx.protocol.v2.ServerProxy$GetAttributeHandler.handle(ServerProxy.java:691)
at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1$1.run(ServerCommon.java:153)
at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:75)
at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:70)
at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor.handleEvent(ServerInterceptorFactory.java:70)
at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1.run(ServerCommon.java:149)
Resolution
- Check the bytesSent through jmx instead per How to Access JBossWeb mbeans and their Related statistics in JBoss EAP 6 ?
- A temporary workaround was implemented in EAP 6.4.6 of converting the value to an integer. This will no longer throw an exception, but the value is not correct (it will wrap to a negative number instead).
Root Cause
- This content is not included.BZ-1235514 - web connectors metrics uses long value as int
- This content is not included.BZ-1302042
Components
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.