Intermittent SmooksException when SmooksAction with XML-to-Java enum mapping runs under heavy load in SOA-P 5

Solution Unverified - Updated -

Issue

  • We are using SmooksAction to convert from XML to Java beans. Here is the action definition:
<action name="TransformRequest" class="org.jboss.soa.esb.smooks.SmooksAction">
    <property name="smooksConfig" value="/smooks-config.xml" />
    <property name="resultType" value="JAVA" />
</action>
  • In the Smooks configuration, we use a constant value for an enum property:
<jb:bean beanId="request" class="com.example.model.MyRequest" createOnElement="Request">
    <jb:value property="myEnum" data="myEnum" default="com.example.model.MyEnumType.A" decoder="Enum">
        <jb:decodeParam name="enumType">com.example.model.MyEnumType</jb:decodeParam>
        <jb:decodeParam name="A">A</jb:decodeParam>
        <jb:decodeParam name="B">B</jb:decodeParam>
        <jb:decodeParam name="C">C</jb:decodeParam>
        ...
    </jb:value>
    ...
</jb:bean>
  • One transaction per run (of 35,000 or more transactions), Smooks translation will fail because of this constant. The exception is:
org.milyn.SmooksException: Unable to filter InputStream for target profile [org.milyn.profile.Profile#default_profile].
    at org.milyn.delivery.dom.SmooksDOMFilter.filter(SmooksDOMFilter.java:294)
    at org.milyn.delivery.dom.SmooksDOMFilter.doFilter(SmooksDOMFilter.java:243)
    at org.milyn.delivery.dom.SmooksDOMFilter.doFilter(SmooksDOMFilter.java:216)
    at org.milyn.Smooks._filter(Smooks.java:516)
    at org.milyn.Smooks.filterSource(Smooks.java:475)
    at org.milyn.container.plugin.PayloadProcessor.process(PayloadProcessor.java:112)
    at org.jboss.soa.esb.smooks.SmooksAction.process(SmooksAction.java:217)
    at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:667)
    at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:614)
    at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:442)
    at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:587)
    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:724)
Caused by: org.milyn.expression.ExpressionEvaluationException: Error evaluating MVEL expression 'this.myEnum = (com.example.model.MyEnumType.A);' against object type 'com.example.model.MyRequest'. Common issues include:
        1. Referencing a variable that is not bound into the context. In this case use the 'isdef' operator to check if the variable is bound in the context.
        2. Invalid expression reference to a List/Array based variable token.  Example List/Array referencing expression token: 'order.orderItems[0].productId'.
    at org.milyn.expression.MVELExpressionEvaluator.exec(MVELExpressionEvaluator.java:110)
    at org.milyn.expression.MVELExpressionEvaluator.exec(MVELExpressionEvaluator.java:115)
    at org.milyn.javabean.BeanInstanceCreator.createAndSetBean(BeanInstanceCreator.java:269)
    at org.milyn.javabean.BeanInstanceCreator.visitBefore(BeanInstanceCreator.java:210)
    at org.milyn.delivery.dom.SmooksDOMFilter$ElementProcessor.processMapping(SmooksDOMFilter.java:759)
    at org.milyn.delivery.dom.SmooksDOMFilter$ElementProcessor.process(SmooksDOMFilter.java:710)
    at org.milyn.delivery.dom.SmooksDOMFilter$ElementProcessor.access$000(SmooksDOMFilter.java:666)
    at org.milyn.delivery.dom.SmooksDOMFilter.filter(SmooksDOMFilter.java:385)
    at org.milyn.delivery.dom.SmooksDOMFilter.filter(SmooksDOMFilter.java:317)
    at org.milyn.delivery.dom.SmooksDOMFilter.filter(SmooksDOMFilter.java:292)
    ... 14 more
Caused by: [Error: value A]
[Near : {... this.myEnum = (com.exampl ....}]
             ^
[Line: 1, Column: 1]
    at org.mvel2.optimizers.impl.asm.ASMAccessorOptimizer.compileAccessor(ASMAccessorOptimizer.java:883)
    at org.mvel2.optimizers.impl.asm.ASMAccessorOptimizer.optimizeAccessor(ASMAccessorOptimizer.java:243)
    at org.mvel2.optimizers.dynamic.DynamicGetAccessor.optimize(DynamicGetAccessor.java:90)
    at org.mvel2.optimizers.dynamic.DynamicGetAccessor.getValue(DynamicGetAccessor.java:64)
    at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)
    at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:38)
    at org.mvel2.ast.Substatement.getReducedValueAccelerated(Substatement.java:44)
    at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:38)
    at org.mvel2.ast.DeepAssignmentNode.getReducedValueAccelerated(DeepAssignmentNode.java:92)
    at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
    at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:126)
    at org.mvel2.MVEL.executeExpression(MVEL.java:930)
    at org.milyn.expression.MVELExpressionEvaluator.exec(MVELExpressionEvaluator.java:99)
.... 23 more
Caused by: java.lang.IllegalArgumentException: value A
    at org.mvel2.asm.ClassWriter.newConstItem(ClassWriter.java:906)
    at org.mvel2.asm.MethodWriter.visitLdcInsn(MethodWriter.java:1014)
    at org.mvel2.optimizers.impl.asm.ASMAccessorOptimizer.getBeanProperty(ASMAccessorOptimizer.java:1229)
    at org.mvel2.optimizers.impl.asm.ASMAccessorOptimizer.compileAccessor(ASMAccessorOptimizer.java:758)
    ... 35 more
  • Here are the last few examples of when it occurred:
    • test: after 50 minutes of heavy load
    • test: after 40 minutes of heavy load
    • production: 2.5 hours after start, during moderate load
    • production: server up for a day, during heavy load
    • production: server up for two days, during heavy load
    • production: 2.5 hours after start, during moderate load
    • production: server up for two days, during heavy load
  • It generally happened toward the end of our runs, which lasted from 60-70 minutes.

Environment

  • Red Hat JBoss SOA Platform (SOA-P) 5

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In