[rules-users] java.lang.ArrayIndexOutOfBoundsException at Frame

Michael Anstis michael.anstis at gmail.com
Fri Jan 20 03:19:15 EST 2012


Does your problem remain?

The DRL and Java code appear fine.

If you are still having problems, please explain your entire process to
replicate the problem: from authoring in Guvnor, to creating a
KnowledgeBase, Session and calling fireAllRules. Can you please also advise
if the problem remains if you don't include the @Data and
@EqualsAndHashCode annotations on your bean (not knowing what they do, or
how they might affect drools-expert, it is worth removing them to try and
isolate the cause of your problem).

With kind regards,

Mike

2012/1/19 mujoko mujoko <mujoko.mujoko at gmail.com>

> Hi
>
>
>
> Here is my CDR class
>
> package com.rbtsb.tm.meter.model;
>
> import java.text.DateFormat;
> import java.text.ParseException;
> import java.text.SimpleDateFormat;
> import java.util.Date;
>
> import javax.persistence.Transient;
>
> import lombok.Data;
> import lombok.EqualsAndHashCode;
>
> import org.apache.log4j.Logger;
>
> /**
>  * This Class is the same as CDRRepository with additional 2 attribute, and
>  * created for Rule Purpose.
>  *
>  * @author akhfa
>  */
> @Data
> @EqualsAndHashCode(callSuper = false)
> public class CDR implements CSVData {
>
> /**
>  * log Injected.
>  */
> private static final Logger LOG = Logger.getLogger(CDR.class);
>
> /**
>  * nxxSrvUsageCode.
>  */
>  private String nxxSrvUsageCode;
> /**
>  * aNumber.
>  */
> private String aNumber;
> /**
>  * bNumber.
>  */
> private String bNumber;
>  /**
>  * cNumber.
>  */
>  private String cNumber;
> /**
>  * stdTollUsageDate.
>  */
> private String stdTollUsageDate;
>
> /** this is helper for stdTollUsage date with format 'yyyymmdd'. */
>  private Date usageDate;
>
> /** getter for usageDate, for ruleEngine purpose. */
>  public Date getUsageDate() {
> // txt format 'yyyymmdd'
> String strDate = this.stdTollUsageDate;
>  DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
> try {
>  this.usageDate = formatter.parse(strDate);
> } catch (ParseException pe) {
> LOG.error(pe.getMessage());
>  }
> return this.usageDate;
> }
>
> /**
>  * stdTollStartTime.
>  */
>  private String stdTollStartTime;
> /**
>  * tollRatedFullAmount.
>  */
> private String tollRatedFullAmount;
> /**
>  * tollRatedChargedAmount.
>  */
> private String tollRatedChargedAmount;
>  /**
>  * tollSurchargeAmount.
>  */
>  private String tollSurchargeAmount;
> /**
>  * stdTollDurationTime.
>  */
> private String stdTollDurationTime;
> /**
>  * geogLocName.
>  */
> private String geogLocName;
>  /**
>  * callClassCode.
>  */
>  private String callClassCode;
> /**
>  * callTypeCode.
>  */
> private String callTypeCode;
> /**
>  * billingChargeCode.
>  */
> private String billingChargeCode;
>  /**
>  * billingClassCode.
>  */
>  private String billingClassCode;
> /**
>  * tlDiscountCode.
>  */
> private String tlDiscountCode;
> /**
>  * remarksA.
>  */
> private String remarksA;
>  /**
>  * remarksB.
>  */
>  private String remarksB;
> /**
>  * rateBandCode.
>  */
> private String rateBandCode;
> /**
>  * emergenSpareOlnosIndicator.
>  */
> private String emergenSpareOlnosIndicator;
>  /**
>  * ttmc.
>  */
>  private String ttmc;
> /**
>  * mobileAlphaCode.
>  */
> private String mobileAlphaCode;
> /**
>  * customerProfile
>  */
> private CustomerProfile customerProfile;
>
> private String tag = "0";
>
> /**
>  * TosDatCode List
>  */
> // private List<TosDatCode> tosDatCodeList = null;
>
>  /** Boolean field for rule purpose. */
> private Boolean isDrop = false;
>
>  /** Boolean field for rule purpose. */
> // private Boolean isTag = false;
>
>  /** For rule purpose, describe reason why CDR is dropped. */
> private String dropReason;
>
> /** For rule purpose, ProductTagging. */
> private String productName;
>
> /** For rule purpose, ProductTagging. */
> private String specialIndicator;
>
> /** For rule purpose, ProductTagging. */
>
> private String productRuleName;
>
> public boolean isDrop() {
> return isDrop;
> }
>
> }
>
> On Wed, Jan 18, 2012 at 7:57 PM, Wolfgang Laun <wolfgang.laun at gmail.com>wrote:
>
>> Please show field and getter declarations in class CDR
>> -W
>>
>> On 18/01/2012, mujoko mujoko <mujoko.mujoko at gmail.com> wrote:
>> > For your info, for the same rules. It's not always happen, the error
>> some
>> > times coming.
>> > For me the rule is fine (I used guvnor)
>> > Here is the rule
>> >
>> > import com.rbtsb.tm.meter.model.CDR;
>> > import org.apache.log4j.Logger;
>> >
>> > global Logger log;
>> >
>> > rule "ProductTag-FixedSMS"
>> >
>> > when
>> > $cdr : CDR(callClassCode == "F1" || callClassCode == "F2" )
>> > then
>> > $cdr.setProductName("fixedsms");
>> > end
>> >
>> >
>> >
>> > 2012/1/18 Michael Anstis <michael.anstis at gmail.com>
>> >
>> >> You're going to give a little more information, such as the DRL you're
>> >> unable to compile.
>> >>
>> >> 2012/1/18 mujoko mujoko <mujoko.mujoko at gmail.com>
>> >>
>> >>> Hi Drools Users,
>> >>>
>> >>> I'm new member, Mujoko.
>> >>> I got issue regarding my rules. Several times got exception when
>> trying
>> >>> to
>> >>> create KnowledgeSession. I used drools-core 5.3.0.Final and
>> >>> drools-compiler 5.3.0.Final.
>> >>>
>> >>> java.lang.ArrayIndexOutOfBoundsException: -1
>> >>>        at org.mvel2.asm.Frame.merge(Frame.java:1373)
>> >>>        at org.mvel2.asm.Frame.merge(Frame.java:1350)
>> >>>        at org.mvel2.asm.MethodWriter.visitMaxs(MethodWriter.java:1282)
>> >>>        at
>> >>>
>> >>>
>> org.drools.rule.builder.dialect.asm.ClassGenerator$MethodDescr.write(ClassGenerator.java:480)
>> >>>        at
>> >>>
>> >>>
>> org.drools.rule.builder.dialect.asm.ClassGenerator.generateBytecode(ClassGenerator.java:50)
>> >>>        at
>> >>>
>> >>>
>> org.drools.rule.builder.dialect.asm.ASMEvalBuilder.createEvalBytecode(ASMEvalBuilder.java:63)
>> >>>        at
>> >>>
>> >>>
>> org.drools.rule.builder.dialect.asm.AbstractASMEvalBuilder.build(AbstractASMEvalBuilder.java:49)
>> >>>        at
>> >>>
>> >>>
>> org.drools.rule.builder.dialect.asm.AbstractASMEvalBuilder.build(AbstractASMEvalBuilder.java:15)
>> >>>        at
>> >>>
>> >>>
>> org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:65)
>> >>>        at
>> org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:80)
>> >>>        at
>> >>> org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:2289)
>> >>>        at
>> >>> org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:822)
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Mujoko
>> >>> http://www.linkedin.com/in/mujoko
>> >>>
>> >>>
>> >>> _______________________________________________
>> >>> rules-users mailing list
>> >>> rules-users at lists.jboss.org
>> >>> https://lists.jboss.org/mailman/listinfo/rules-users
>> >>>
>> >>>
>> >>
>> >> _______________________________________________
>> >> rules-users mailing list
>> >> rules-users at lists.jboss.org
>> >> https://lists.jboss.org/mailman/listinfo/rules-users
>> >>
>> >>
>> >
>> >
>> > --
>> > Mujoko
>> > http://www.linkedin.com/in/mujoko
>> >
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
> --
> Mujoko
> http://www.linkedin.com/in/mujoko
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120120/c1bd9d92/attachment.html 


More information about the rules-users mailing list