[JBoss JIRA] (DROOLS-394) java.lang.RuntimeException: cannot invoke getter
by leonardo lizana (JIRA)
[ https://issues.jboss.org/browse/DROOLS-394?page=com.atlassian.jira.plugin... ]
leonardo lizana updated DROOLS-394:
-----------------------------------
Description:
we are using drools 5.4.final. and below is the rule
rule "EnergyUsage data not empty"
dialect "java"
salience 100
no-loop
when
$httpResponse : HttpResponse(
(((EnergyUsage)responseData).energyUsageDetail.billingGroup!=null && ((EnergyUsage)responseData).energyUsageDetail.billingGroup!=0) ||
((EnergyUsage)responseData).energyUsageDetail.capacityPLCs.size()>0 ||
((EnergyUsage)responseData).energyUsageDetail.networkServicePLCs.size()>0 ||
((EnergyUsage)responseData).energyUsageDetail.servicePoint!=null ||
((EnergyUsage)responseData).energyUsageDetail.historicalUsages.size() > 0
);
then
System.out.println("[EnergyUsage data not empty] rule has been fired...");
$httpResponse.setStatusCode(EisConstants.STATUS_OK);
$httpResponse.setErrorMessage("");
end
rule "EnergyUsage data empty"
dialect "java"
no-loop
when
$httpResponse : HttpResponse(
(((EnergyUsage)responseData).energyUsageDetail.billingGroup==null || ((EnergyUsage)responseData).energyUsageDetail.billingGroup==0) &&
((EnergyUsage)responseData).energyUsageDetail.capacityPLCs.size()==0 &&
((EnergyUsage)responseData).energyUsageDetail.networkServicePLCs.size()==0 &&
((EnergyUsage)responseData).energyUsageDetail.servicePoint==null &&
((EnergyUsage)responseData).energyUsageDetail.historicalUsages.size() == 0
);
then
System.out.println("[EnergyUsage data empty] rule has been fired...");
$httpResponse.setStatusCode(EisConstants.STATUS_OK);
$httpResponse.setErrorMessage("Data Screen Scrapping is empty for this account");
end
Here is log error:
-------------------------
java.lang.RuntimeException: cannot invoke getter: getEnergyUsageDetail [declr.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage; act.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage] (see trace)
at org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:74)
at org.mvel2.ast.Union.getReducedValueAccelerated(Union.java:41)
at org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:107)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:123)
at org.mvel2.MVEL.executeExpression(MVEL.java:930)
at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:70)
at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:49)
at org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:167)
at org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:124)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:337)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:298)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:888)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
at com.aepenergy.b2b.services.energyusage.UsageRulesServiceImpl.ruleCompliance(UsageRulesServiceImpl.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy161.ruleCompliance(Unknown Source)
at com.aepenergy.b2b.services.energyusage.EnergyUsageCommunicationServiceImpl.processRequestEnergyUsageHttp(EnergyUsageCommunicationServiceImpl.java:52)
was:
we are using drools 5.4.final.
this is the log error:
-------------------------
java.lang.RuntimeException: cannot invoke getter: getEnergyUsageDetail [declr.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage; act.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage] (see trace)
at org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:74)
at org.mvel2.ast.Union.getReducedValueAccelerated(Union.java:41)
at org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:107)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:123)
at org.mvel2.MVEL.executeExpression(MVEL.java:930)
at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:70)
at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:49)
at org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:167)
at org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:124)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:337)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:298)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:888)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
at com.aepenergy.b2b.services.energyusage.UsageRulesServiceImpl.ruleCompliance(UsageRulesServiceImpl.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy161.ruleCompliance(Unknown Source)
at com.aepenergy.b2b.services.energyusage.EnergyUsageCommunicationServiceImpl.processRequestEnergyUsageHttp(EnergyUsageCommunicationServiceImpl.java:52)
> java.lang.RuntimeException: cannot invoke getter
> ------------------------------------------------
>
> Key: DROOLS-394
> URL: https://issues.jboss.org/browse/DROOLS-394
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Reporter: leonardo lizana
> Assignee: Mark Proctor
>
> we are using drools 5.4.final. and below is the rule
> rule "EnergyUsage data not empty"
> dialect "java"
> salience 100
> no-loop
> when
> $httpResponse : HttpResponse(
> (((EnergyUsage)responseData).energyUsageDetail.billingGroup!=null && ((EnergyUsage)responseData).energyUsageDetail.billingGroup!=0) ||
> ((EnergyUsage)responseData).energyUsageDetail.capacityPLCs.size()>0 ||
> ((EnergyUsage)responseData).energyUsageDetail.networkServicePLCs.size()>0 ||
> ((EnergyUsage)responseData).energyUsageDetail.servicePoint!=null ||
> ((EnergyUsage)responseData).energyUsageDetail.historicalUsages.size() > 0
> );
>
>
> then
> System.out.println("[EnergyUsage data not empty] rule has been fired...");
> $httpResponse.setStatusCode(EisConstants.STATUS_OK);
> $httpResponse.setErrorMessage("");
> end
> rule "EnergyUsage data empty"
> dialect "java"
> no-loop
> when
> $httpResponse : HttpResponse(
> (((EnergyUsage)responseData).energyUsageDetail.billingGroup==null || ((EnergyUsage)responseData).energyUsageDetail.billingGroup==0) &&
> ((EnergyUsage)responseData).energyUsageDetail.capacityPLCs.size()==0 &&
> ((EnergyUsage)responseData).energyUsageDetail.networkServicePLCs.size()==0 &&
> ((EnergyUsage)responseData).energyUsageDetail.servicePoint==null &&
> ((EnergyUsage)responseData).energyUsageDetail.historicalUsages.size() == 0
> );
>
>
> then
> System.out.println("[EnergyUsage data empty] rule has been fired...");
> $httpResponse.setStatusCode(EisConstants.STATUS_OK);
> $httpResponse.setErrorMessage("Data Screen Scrapping is empty for this account");
> end
> Here is log error:
> -------------------------
> java.lang.RuntimeException: cannot invoke getter: getEnergyUsageDetail [declr.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage; act.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage] (see trace)
> at org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:74)
> at org.mvel2.ast.Union.getReducedValueAccelerated(Union.java:41)
> at org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:107)
> at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
> at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
> at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
> at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
> at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
> at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:123)
> at org.mvel2.MVEL.executeExpression(MVEL.java:930)
> at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:70)
> at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:49)
> at org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:167)
> at org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:124)
> at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
> at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
> at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
> at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
> at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
> at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:337)
> at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:298)
> at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:888)
> at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
> at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
> at com.aepenergy.b2b.services.energyusage.UsageRulesServiceImpl.ruleCompliance(UsageRulesServiceImpl.java:19)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
> at $Proxy161.ruleCompliance(Unknown Source)
> at com.aepenergy.b2b.services.energyusage.EnergyUsageCommunicationServiceImpl.processRequestEnergyUsageHttp(EnergyUsageCommunicationServiceImpl.java:52)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months
[JBoss JIRA] (DROOLS-394) java.lang.RuntimeException: cannot invoke getter
by leonardo lizana (JIRA)
[ https://issues.jboss.org/browse/DROOLS-394?page=com.atlassian.jira.plugin... ]
leonardo lizana updated DROOLS-394:
-----------------------------------
Description:
this is the log error:
----------------------------
java.lang.RuntimeException: cannot invoke getter: getEnergyUsageDetail [declr.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage; act.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage] (see trace)
at org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:74)
at org.mvel2.ast.Union.getReducedValueAccelerated(Union.java:41)
at org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:107)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:123)
at org.mvel2.MVEL.executeExpression(MVEL.java:930)
at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:70)
at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:49)
at org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:167)
at org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:124)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:337)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:298)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:888)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
at com.aepenergy.b2b.services.energyusage.UsageRulesServiceImpl.ruleCompliance(UsageRulesServiceImpl.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy161.ruleCompliance(Unknown Source)
at com.aepenergy.b2b.services.energyusage.EnergyUsageCommunicationServiceImpl.processRequestEnergyUsageHttp(EnergyUsageCommunicationServiceImpl.java:52)
> java.lang.RuntimeException: cannot invoke getter
> ------------------------------------------------
>
> Key: DROOLS-394
> URL: https://issues.jboss.org/browse/DROOLS-394
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Reporter: leonardo lizana
> Assignee: Mark Proctor
>
> this is the log error:
> ----------------------------
> java.lang.RuntimeException: cannot invoke getter: getEnergyUsageDetail [declr.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage; act.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage] (see trace)
> at org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:74)
> at org.mvel2.ast.Union.getReducedValueAccelerated(Union.java:41)
> at org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:107)
> at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
> at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
> at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
> at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
> at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
> at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:123)
> at org.mvel2.MVEL.executeExpression(MVEL.java:930)
> at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:70)
> at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:49)
> at org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:167)
> at org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:124)
> at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
> at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
> at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
> at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
> at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
> at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:337)
> at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:298)
> at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:888)
> at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
> at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
> at com.aepenergy.b2b.services.energyusage.UsageRulesServiceImpl.ruleCompliance(UsageRulesServiceImpl.java:19)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
> at $Proxy161.ruleCompliance(Unknown Source)
> at com.aepenergy.b2b.services.energyusage.EnergyUsageCommunicationServiceImpl.processRequestEnergyUsageHttp(EnergyUsageCommunicationServiceImpl.java:52)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months
[JBoss JIRA] (WFLY-2727) @DataSourceDefinition defined data source can't be used in persistence.xml with CDI entity listeners
by Scott Marlow (JIRA)
[ https://issues.jboss.org/browse/WFLY-2727?page=com.atlassian.jira.plugin.... ]
Scott Marlow commented on WFLY-2727:
------------------------------------
{quote}
Maybe I don't fully understand, but since Hibernate is used by WildFly and part of the JBoss community, what is stopping things from working out of the box now? Or is the extension you mention for a version of Hibernate newer than what WildFly is currently using?
{quote}
We did implement the 2-phase PU bootstrap in Hibernate (as an extension), however, we (Hibernate) still needs access to the datasource in the first phase. With regard to DataSourceDefinition, I think it will help when HHH-8659 is addressed in Hibernate (to move datasource access to the second pu bootstrap phase).
{quote}
Okay, so that's indeed more clear. But practically speaking there's also the issue now that users have to add the above mentioned property, isn't there? Since @DataSourceDefinition is largely an ease-of-use feature, this may be a bit problematic for exactly those users who are the intended target. If the issue can't be solved otherwise for the short term, would it be an option to provide a hint to the user when logging the error that this property needs to be set?
{quote}
I agree, that it is an issue that the user has to know to add the property. In this case, the thrown error is generic and doesn't understand the context of what is causing the error. It would be pretty cool if WildFly could determine that it is a datasource error and that the @DataSourceDefinition isn't available. Even better, if a suggestion to address the failure (add a PU hint) could be given.
{quote}
This sounds like a very important improvement indeed and certainly worth it to create a JIRA issue on the JPA tracker for.
{quote}
Great idea!
> @DataSourceDefinition defined data source can't be used in persistence.xml with CDI entity listeners
> ----------------------------------------------------------------------------------------------------
>
> Key: WFLY-2727
> URL: https://issues.jboss.org/browse/WFLY-2727
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: EE, JPA / Hibernate
> Affects Versions: 8.0.0.CR1
> Reporter: arjan tijms
> Assignee: Scott Marlow
>
> Defining a data source from within the application using either {{@DataSourceDefinition}} on a class or the {{data-source}} element in {{web.xml}}, and then using this in {{persistence.xml}} will cause a deployment failure.
> E.g.
> {code:xml|title=web.xml}
> <data-source>
> <name>java:app/MyApp/MyDS</name>
> <class-name>org.h2.jdbcx.JdbcDataSource</class-name>
> <url>jdbc:h2:mem:test</url>
> </data-source>
> {code}
> and
> {code:xml|title=persistence.xml}
> <persistence-unit name="testPU">
> <jta-data-source>java:app/MyApp/MyDS</jta-data-source>
> </persistence-unit>
> {code}
> will result in:
> {noformat}
> ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 3) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "dca783dd-b383-4a16-85a4-1331a2f89354.war")]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"dca783dd-b383-4a16-85a4-1331a2f89354.war#testPU\".__FIRST_PHASE__ is missing [jboss.naming.context.java.app.dca783dd-b383-4a16-85a4-1331a2f89354.MyApp.MyDS]"]}
> ERROR [org.jboss.as.server] (management-handler-thread - 3) JBAS015870: Deploy of deployment "dca783dd-b383-4a16-85a4-1331a2f89354.war" was rolled back with the following failure message: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"dca783dd-b383-4a16-85a4-1331a2f89354.war#testPU\".__FIRST_PHASE__ is missing [jboss.naming.context.java.app.dca783dd-b383-4a16-85a4-1331a2f89354.MyApp.MyDS]"]}
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months
[JBoss JIRA] (DROOLS-394) java.lang.RuntimeException: cannot invoke getter
by leonardo lizana (JIRA)
[ https://issues.jboss.org/browse/DROOLS-394?page=com.atlassian.jira.plugin... ]
leonardo lizana updated DROOLS-394:
-----------------------------------
Description:
we are using drools 5.4.final.
this is the log error:
-------------------------
java.lang.RuntimeException: cannot invoke getter: getEnergyUsageDetail [declr.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage; act.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage] (see trace)
at org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:74)
at org.mvel2.ast.Union.getReducedValueAccelerated(Union.java:41)
at org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:107)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:123)
at org.mvel2.MVEL.executeExpression(MVEL.java:930)
at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:70)
at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:49)
at org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:167)
at org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:124)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:337)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:298)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:888)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
at com.aepenergy.b2b.services.energyusage.UsageRulesServiceImpl.ruleCompliance(UsageRulesServiceImpl.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy161.ruleCompliance(Unknown Source)
at com.aepenergy.b2b.services.energyusage.EnergyUsageCommunicationServiceImpl.processRequestEnergyUsageHttp(EnergyUsageCommunicationServiceImpl.java:52)
was:
this is the log error:
----------------------------
java.lang.RuntimeException: cannot invoke getter: getEnergyUsageDetail [declr.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage; act.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage] (see trace)
at org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:74)
at org.mvel2.ast.Union.getReducedValueAccelerated(Union.java:41)
at org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:107)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:123)
at org.mvel2.MVEL.executeExpression(MVEL.java:930)
at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:70)
at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:49)
at org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:167)
at org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:124)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:337)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:298)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:888)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
at com.aepenergy.b2b.services.energyusage.UsageRulesServiceImpl.ruleCompliance(UsageRulesServiceImpl.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy161.ruleCompliance(Unknown Source)
at com.aepenergy.b2b.services.energyusage.EnergyUsageCommunicationServiceImpl.processRequestEnergyUsageHttp(EnergyUsageCommunicationServiceImpl.java:52)
> java.lang.RuntimeException: cannot invoke getter
> ------------------------------------------------
>
> Key: DROOLS-394
> URL: https://issues.jboss.org/browse/DROOLS-394
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Reporter: leonardo lizana
> Assignee: Mark Proctor
>
> we are using drools 5.4.final.
> this is the log error:
> -------------------------
> java.lang.RuntimeException: cannot invoke getter: getEnergyUsageDetail [declr.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage; act.class: com.bluestarenergy.core.eis.common.usage.EnergyUsage] (see trace)
> at org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:74)
> at org.mvel2.ast.Union.getReducedValueAccelerated(Union.java:41)
> at org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:107)
> at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
> at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
> at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
> at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
> at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
> at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:123)
> at org.mvel2.MVEL.executeExpression(MVEL.java:930)
> at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:70)
> at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:49)
> at org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:167)
> at org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:124)
> at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
> at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
> at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
> at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
> at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
> at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:337)
> at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:298)
> at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:888)
> at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
> at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
> at com.aepenergy.b2b.services.energyusage.UsageRulesServiceImpl.ruleCompliance(UsageRulesServiceImpl.java:19)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
> at $Proxy161.ruleCompliance(Unknown Source)
> at com.aepenergy.b2b.services.energyusage.EnergyUsageCommunicationServiceImpl.processRequestEnergyUsageHttp(EnergyUsageCommunicationServiceImpl.java:52)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months
[JBoss JIRA] (JASSIST-210) MethodCall.replace() throws inconsistent stack height in certain scenarios
by Patson Luk (JIRA)
[ https://issues.jboss.org/browse/JASSIST-210?page=com.atlassian.jira.plugi... ]
Patson Luk edited comment on JASSIST-210 at 1/8/14 6:03 PM:
------------------------------------------------------------
Many thanks for the detailed reply!
There is still one piece that I do not quite understand, would you please kindly elaborate?
You mentioned that after the translation 2 and 3 are replaced with a try-catch statement, but in the sample code, the replacement block $_ = $proceed($$) itself is NOT surrounded by try-catch, only the injected System.out... was surrounded by try-catch:
"{ try
{ System.out.println(\"injected\"); }
catch (Exception e)
{ e.printStackTrace(); }
$_ = $proceed($$); }";
Therefore, if $_ = $proceed($$) does throw exception, it should still follow the same flow as if there is no try-catch? (as that piece of the code is not really wrapped)
Many thanks for your clarification in advanced
was (Author: pluk):
Many thanks for the detailed reply!
There is still one piece that I do not quite understand, would please please kindly elaborate?
You mentioned that after the translation 2 and 3 are replaced with a try-catch statement, but in the sample code, the replacement block $_ = $proceed($$) itself is NOT surrounded by try-catch, only the injected System.out... was surrounded by try-catch:
"{ try
{ System.out.println(\"injected\"); }
catch (Exception e)
{ e.printStackTrace(); }
$_ = $proceed($$); }";
Therefore, if $_ = $proceed($$) does throw exception, it should still follow the same flow as if there is no try-catch? (as that piece of the code is not really wrapped)
Many thanks for your clarification in advanced
> MethodCall.replace() throws inconsistent stack height in certain scenarios
> --------------------------------------------------------------------------
>
> Key: JASSIST-210
> URL: https://issues.jboss.org/browse/JASSIST-210
> Project: Javassist
> Issue Type: Bug
> Affects Versions: 3.16.1-GA, 3.18.1-GA
> Reporter: Patson Luk
> Assignee: Shigeru Chiba
>
> Tested on 3.16.1-GA
> This is similar to https://issues.jboss.org/browse/JASSIST-52, but the try-catch block usage is different (not wrapping the $proceed($$))
> Based on the javassist tutorial, the substituted code for MethodCall.replace():
> {{Note that the substituted code is not an expression but a statement or a block. It cannot be or contain a try-catch statement.}}
> However in the case that try-catch does not wrap the $_=$proceed($$);
> It seems to work properly. For example:
> ctClass.instrument(new ExprEditor() {
> public void edit(MethodCall m) throws CannotCompileException {
> if (m.getMethodName().equals("testMethod2")) {
> String newBlock = "{ try { System.out.println(\"injected\"); } catch (Exception e) { e.printStackTrace(); } $_ = $proceed($$); }";
> m.replace(newBlock);
> }
> }
> });
> {{which ctClass is class TestReplace, which has code as below:}}
> public class TestReplace {
> public static void main(String[] args) {
> RefClass ref = new RefClass();
> ref.testMethod2();
> }
> }
> class RefClass {
> public void testMethod1(Object o) {}
> public Object testMethod2() { return null; }
> }
> {{running TestReplace with the modified bytecode correctly prints "injected" to the screen. However if I add one more line to the TestReplace's main() method}}
> ref.testMethod1(ref.testMethod2());
> {{It throws exception as below}}
> javassist.bytecode.BadBytecode: inconsistent stack height -1
> javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:106)
> *So is try-catch acceptable if it does not wrap the $_=$proceed($$)? If so, is it a bug if it does not work properly for method invocation within another method invocation?*
> Many thanks in advance!
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months
[JBoss JIRA] (JASSIST-210) MethodCall.replace() throws inconsistent stack height in certain scenarios
by Patson Luk (JIRA)
[ https://issues.jboss.org/browse/JASSIST-210?page=com.atlassian.jira.plugi... ]
Patson Luk commented on JASSIST-210:
------------------------------------
Many thanks for the detailed reply!
There is still one piece that I do not quite understand, would please please kindly elaborate?
You mentioned that after the translation 2 and 3 are replaced with a try-catch statement, but in the sample code, the replacement block $_ = $proceed($$) itself is NOT surrounded by try-catch, only the injected System.out... was surrounded by try-catch:
"{ try
{ System.out.println(\"injected\"); }
catch (Exception e)
{ e.printStackTrace(); }
$_ = $proceed($$); }";
Therefore, if $_ = $proceed($$) does throw exception, it should still follow the same flow as if there is no try-catch? (as that piece of the code is not really wrapped)
Many thanks for your clarification in advanced
> MethodCall.replace() throws inconsistent stack height in certain scenarios
> --------------------------------------------------------------------------
>
> Key: JASSIST-210
> URL: https://issues.jboss.org/browse/JASSIST-210
> Project: Javassist
> Issue Type: Bug
> Affects Versions: 3.16.1-GA, 3.18.1-GA
> Reporter: Patson Luk
> Assignee: Shigeru Chiba
>
> Tested on 3.16.1-GA
> This is similar to https://issues.jboss.org/browse/JASSIST-52, but the try-catch block usage is different (not wrapping the $proceed($$))
> Based on the javassist tutorial, the substituted code for MethodCall.replace():
> {{Note that the substituted code is not an expression but a statement or a block. It cannot be or contain a try-catch statement.}}
> However in the case that try-catch does not wrap the $_=$proceed($$);
> It seems to work properly. For example:
> ctClass.instrument(new ExprEditor() {
> public void edit(MethodCall m) throws CannotCompileException {
> if (m.getMethodName().equals("testMethod2")) {
> String newBlock = "{ try { System.out.println(\"injected\"); } catch (Exception e) { e.printStackTrace(); } $_ = $proceed($$); }";
> m.replace(newBlock);
> }
> }
> });
> {{which ctClass is class TestReplace, which has code as below:}}
> public class TestReplace {
> public static void main(String[] args) {
> RefClass ref = new RefClass();
> ref.testMethod2();
> }
> }
> class RefClass {
> public void testMethod1(Object o) {}
> public Object testMethod2() { return null; }
> }
> {{running TestReplace with the modified bytecode correctly prints "injected" to the screen. However if I add one more line to the TestReplace's main() method}}
> ref.testMethod1(ref.testMethod2());
> {{It throws exception as below}}
> javassist.bytecode.BadBytecode: inconsistent stack height -1
> javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:106)
> *So is try-catch acceptable if it does not wrap the $_=$proceed($$)? If so, is it a bug if it does not work properly for method invocation within another method invocation?*
> Many thanks in advance!
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months