[GLASSFISH-17550] ClassCastException when create alert Created: 01/Nov/11  Updated: 07/Feb/13  Resolved: 07/Feb/13

Status: Closed
Project: glassfish
Component/s: elasticity
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: mzh777 Assignee: Mahesh Kannan
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Oracle Linux 5.4


Tags: 3_1_x-exclude

 Description   

GF4 b08.

Steps to reproduce:
1. Deploy ConferencePlanner app.
2. Create the 1st alert for auto-scale up: asadmin create-memory-alert --servicename ConferencePlanner alert1
3. Click the "Increase Load" button, was able to see the auto-scale up.
4. Create the 2nd alert for auto-scale down:

  1. asadmin create-alert --service ConferencePlanner --expression "countTrue [avg(jvm_memory.heap.used)*100/jvm_memory.maxMemory < 20] /cluster_instance_size.currentSize * 100 > 66" alert2
  2. asadmin add-alert-action --service ConferencePlanner --actionref scale-down-action --state alarm-state alert2
    5. Got ClassCastException exception:
    [#|2011-11-01T00:20:44.333+0000|INFO|44.0|elasticity-logger|_ThreadID=13;_ThreadName=Thread-2;|SCHEDULED Alert[name=alert2; schedule=30s; expression=countTrue [avg(jvm_memory.heap.used)*100/jvm_memory.maxMemory < 20] /cluster_instance_size.currentSize * 100 > 66; will be executed every= 30|#]

[#|2011-11-01T00:21:14.344+0000|WARNING|44.0|elasticity-logger|_ThreadID=34;_ThreadName=Thread-2;|Exception during alert execution
java.lang.ClassCastException: org.glassfish.elasticity.engine.util.ClusterSizeMetricHolder cannot be cast to java.lang.Number
at org.glassfish.elasticity.expression.ElasticExpressionEvaluator.evaluate(ElasticExpressionEvaluator.java:143)
at org.glassfish.elasticity.expression.ElasticExpressionEvaluator.evaluate(ElasticExpressionEvaluator.java:137)
at org.glassfish.elasticity.expression.ElasticExpressionEvaluator.evaluate(ElasticExpressionEvaluator.java:50)
at org.glassfish.elasticity.engine.util.ExpressionBasedAlert.execute(ExpressionBasedAlert.java:91)
at org.glassfish.elasticity.engine.container.AlertContextImpl.run(AlertContextImpl.java:71)
...
6. # asadmin list-metric-gatherers
Enter the value for the service option> ConferencePlanner
session_count
processingtime
cluster_instance_size
jvm_memory
Command list-metric-gatherers executed successfully.

  1. asadmin describe-metric-attributes cluster_instance-size
    Enter the value for the service option> ConferencePlanner
    remote failure: java.lang.NullPointerException
    Command describe-metric-attributes failed.


 Comments   
Comment by Tom Mueller [ 07/Feb/13 ]

The elasticity code has been moved out of GlassFish, so closing this issue.

Generated at Tue Aug 04 09:42:50 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.