Hi guys,<br><br>I am newbie in this kind of things, but I am facing some difficults to use Smooks 1.4 an d Drools 5.2. It seams that MVEL2 present in the drools 5.2 distribution is not compatible with Smooks 1.4. <br>Did anybody have similar problems ?<br>
<br>If a have a separate project, which uses Smooks 1.4, my program is able to read a CSV file and convert it to Java Bean List, in fact, a Java List.<br>However, If I use the same structure to read information from a CSV file and insert hem into a Drools Rule Engine, I got the error right below: Does anybody know how I can fix that ?<br>
<br>This is my smooks configuration file:<br>&lt;?xml version=&quot;1.0&quot;?&gt;<br>&lt;smooks-resource-list xmlns=&quot;<a href="http://www.milyn.org/xsd/smooks-1.1.xsd">http://www.milyn.org/xsd/smooks-1.1.xsd</a>&quot;<br>
    xmlns:csv=&quot;<a href="http://www.milyn.org/xsd/smooks/csv-1.3.xsd">http://www.milyn.org/xsd/smooks/csv-1.3.xsd</a>&quot;<br>    xmlns:jb=&quot;<a href="http://www.milyn.org/xsd/smooks/javabean-1.3.xsd">http://www.milyn.org/xsd/smooks/javabean-1.3.xsd</a>&quot;&gt;<br>
 <br>    &lt;params&gt;<br>        &lt;param name=&quot;stream.filter.type&quot;&gt;SAX&lt;/param&gt;<br>    &lt;/params&gt;<br> <br>    &lt;csv:reader fields=&quot;alarmName,Ne,board,serialNumber,slot,subrack,startDate,startTime,endDate,endTime&quot; skipLines=&quot;1&quot;/&gt;<br>
        &lt;jb:bean beanId=&quot;transformedProps&quot; class=&quot;java.util.HashMap&quot; createOnElement=&quot;csv-record&quot;&gt;<br>            &lt;jb:value property=&quot;@alarmName&quot; data=&quot;csv-record/alarmName&quot; /&gt;<br>
            &lt;jb:value property=&quot;@Ne&quot; data=&quot;csv-record/Ne&quot; /&gt;<br>            &lt;jb:value property=&quot;@board&quot; data=&quot;csv-record/board&quot;/&gt;<br>            &lt;jb:value property=&quot;@serialNumber&quot; data=&quot;csv-record/serialNumber&quot;/&gt;<br>
            &lt;jb:value property=&quot;@slot&quot; data=&quot;csv-record/slot&quot;/&gt;<br>            &lt;jb:value property=&quot;@subrack&quot; data=&quot;csv-record/subrack&quot;/&gt;<br>            &lt;jb:value property=&quot;@startDate&quot; data=&quot;csv-record/startDate&quot;/&gt;<br>
            &lt;jb:value property=&quot;@startTime&quot; data=&quot;csv-record/startTime&quot;/&gt;<br>            &lt;jb:value property=&quot;@endDate&quot; data=&quot;csv-record/endDate&quot;/&gt;<br>            &lt;jb:value property=&quot;@endTime&quot; data=&quot;csv-record/endTime&quot;/&gt;<br>
        &lt;/jb:bean&gt;<br><br>    &lt;jb:bean beanId=&quot;ListOfalarms&quot; class=&quot;java.util.ArrayList&quot; createOnElement=&quot;csv-set&quot;&gt;<br>        &lt;jb:wiring beanIdRef=&quot;alarms&quot; /&gt;<br>
    &lt;/jb:bean&gt;<br>    <br>    <br>    &lt;jb:bean beanId=&quot;alarms&quot; class=&quot;br.com.lavoisierfarias.correlator.model.Alarm&quot; createOnElement=&quot;csv-record&quot;&gt;<br>        &lt;jb:value property=&quot;alarmName&quot; data=&quot;csv-record/alarmName&quot;/&gt;<br>
        &lt;jb:value property=&quot;Ne&quot; data=&quot;csv-record/ne&quot;/&gt;<br>        &lt;jb:value property=&quot;board&quot; data=&quot;csv-record/board&quot;/&gt;<br>        &lt;jb:value property=&quot;serialNumber&quot; data=&quot;csv-record/serialNumber&quot;/&gt;<br>
        &lt;jb:value property=&quot;slot&quot; data=&quot;csv-record/slot&quot;/&gt;<br>        &lt;jb:value property=&quot;subrack&quot; data=&quot;csv-record/subrack&quot;/&gt;<br>        &lt;jb:wiring property=&quot;alarm&quot; beanIdRef=&quot;Alarm&quot; /&gt;<br>
        &lt;jb:expression property=&quot;startDate&quot; execOnElement=&quot;csv-record&quot;&gt;<br>        startDate = transformedProps[&quot;startDate&quot;] + &quot; &quot; + transformedProps[&quot;startTime&quot;];<br>
        new java.text.SimpleDateFormat(&quot;dd/MM/yyyy HH:mm:ss&quot;).parse(startDate)<br>        &lt;/jb:expression&gt;<br>       &lt;jb:value property=&quot;endDate&quot; decoder=&quot;Date&quot; data=&quot;csv-record/endDate&quot;&gt;<br>
            &lt;jb:decodeParam name=&quot;format&quot;&gt;dd/MM/yyyy&lt;/jb:decodeParam&gt;<br>        &lt;/jb:value&gt;<br>        &lt;jb:value property=&quot;endTime&quot; decoder=&quot;Date&quot; data=&quot;csv-record/endTime&quot;&gt;<br>
            &lt;jb:decodeParam name=&quot;format&quot;&gt;HH:mm:ss&lt;/jb:decodeParam&gt;<br>        &lt;/jb:value&gt;<br><br>    &lt;/jb:bean&gt;<br><br>&lt;/smooks-resource-list&gt;<br><br>This is an example of the file that has to bew parsed:<br>
<b><br>alarmName,Ne,board,serialNumber,slot,subrack,startDate,startTime,endDate,endTime</b><br clear="all">Tempo de resposta excedido (sc),SCSBS_SBSDWDM012,SPVL-4#2702,SPVL-4#2702,11,1,01/05/2011,09:01:43,01/05/2011,09:02:29<br>
Tempo de resposta excedido (sc),SCSBS_SBSDWDM012,SPVL-4#2702,SPVL-4#2702,11,1,01/05/2011,09:01:43,01/05/2011,09:02:29<br>Tempo de resposta excedido (sc),SCSBS_SBSDWDM012,SPVL-4#2702,SPVL-4#2702,11,1,01/05/2011,09:01:43,01/05/2011,09:02:29<br>
<br>Erro that I got:<br>org.milyn.cdr.SmooksConfigurationException: Error invoking @Initialize method &#39;initialize&#39; on class &#39;org.milyn.javabean.BeanInstancePopulator&#39;.<br>    at org.milyn.cdr.annotation.Configurator.invoke(Configurator.java:457)<br>
    at org.milyn.cdr.annotation.Configurator.initialise(Configurator.java:439)<br>    at org.milyn.cdr.annotation.Configurator.configure(Configurator.java:91)<br>    at org.milyn.cdr.annotation.Configurator.configure(Configurator.java:66)<br>
    at org.milyn.delivery.JavaContentHandlerFactory.create(JavaContentHandlerFactory.java:63)<br>    at org.milyn.delivery.ContentDeliveryConfigBuilder$ContentHandlerExtractionStrategy.addCDU(ContentDeliveryConfigBuilder.java:623)<br>
    at org.milyn.delivery.ContentDeliveryConfigBuilder$ContentHandlerExtractionStrategy.applyCDUStrategy(ContentDeliveryConfigBuilder.java:548)<br>    at org.milyn.delivery.ContentDeliveryConfigBuilder$ContentHandlerExtractionStrategy.applyStrategy(ContentDeliveryConfigBuilder.java:536)<br>
    at org.milyn.delivery.ContentDeliveryConfigBuilder$SmooksResourceConfigurationTableIterator.iterate(ContentDeliveryConfigBuilder.java:711)<br>    at org.milyn.delivery.ContentDeliveryConfigBuilder$SmooksResourceConfigurationTableIterator.access$300(ContentDeliveryConfigBuilder.java:690)<br>
    at org.milyn.delivery.ContentDeliveryConfigBuilder.extractContentHandlers(ContentDeliveryConfigBuilder.java:484)<br>    at org.milyn.delivery.ContentDeliveryConfigBuilder.load(ContentDeliveryConfigBuilder.java:349)<br>
    at org.milyn.delivery.ContentDeliveryConfigBuilder.getConfig(ContentDeliveryConfigBuilder.java:146)<br>    at org.milyn.container.standalone.StandaloneExecutionContext.&lt;init&gt;(StandaloneExecutionContext.java:91)<br>
    at org.milyn.container.standalone.StandaloneExecutionContext.&lt;init&gt;(StandaloneExecutionContext.java:65)<br>    at org.milyn.Smooks.createExecutionContext(Smooks.java:411)<br>    at org.milyn.Smooks.createExecutionContext(Smooks.java:374)<br>
    at br.com.lavoisierfarias.correlator.readers.CSVSmookReader.runSmooksTransform(CSVSmookReader.java:52)<br>    at br.com.lavoisierfarias.correlator.readers.CSVSmookReader.getAlarmList(CSVSmookReader.java:99)<br>    at br.com.lavoisierfarias.correlator.AlarmTest.testLoadAlarmsFromSmookFile(AlarmTest.java:277)<br>
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<br>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<br>    at java.lang.reflect.Method.invoke(Unknown Source)<br>
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)<br>    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)<br>    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)<br>
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)<br>    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)<br>    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)<br>
    at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)<br>    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)<br>    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)<br>
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)<br>    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)<br>    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)<br>    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)<br>
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)<br>    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)<br>    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)<br>
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)<br>    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)<br>    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)<br>
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)<br>    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)<br>    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)<br>
Caused by: [Error: unterminated &#39;[&#39;]<br>[Near : {... startDate = transformedProps[&quot;startDate&quot;] ....}]<br>             ^<br>[Line: 1, Column: 13]<br>    at org.mvel2.compiler.PropertyVerifier.getCollectionProperty(PropertyVerifier.java:361)<br>
    at org.mvel2.compiler.PropertyVerifier.analyze(PropertyVerifier.java:123)<br>    at org.mvel2.compiler.ExpressionCompiler.verify(ExpressionCompiler.java:390)<br>    at org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:283)<br>
    at org.mvel2.util.ParseTools.subCompileExpression(ParseTools.java:2137)<br>    at org.mvel2.ast.AssignmentNode.&lt;init&gt;(AssignmentNode.java:66)<br>    at org.mvel2.compiler.AbstractParser.nextToken(AbstractParser.java:797)<br>
    at org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:135)<br>    at org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:69)<br>    at org.mvel2.MVEL.compileExpression(MVEL.java:808)<br>
    at org.mvel2.MVEL.compileExpression(MVEL.java:818)<br>    at org.mvel2.MVEL.compileExpression(MVEL.java:721)<br>    at org.milyn.expression.MVELExpressionEvaluator.setExpression(MVELExpressionEvaluator.java:55)<br>    at org.milyn.javabean.BeanInstancePopulator.initialize(BeanInstancePopulator.java:240)<br>
    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)<br>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<br>    at java.lang.reflect.Method.invoke(Unknown Source)<br>    at org.milyn.cdr.annotation.Configurator.invoke(Configurator.java:453)<br>
    ... 45 more<br>Unhandled Exception<br><br><br><br><br>-- <br><b>Abraços,<br>Lavoisier José Leite Farias</b><br><font size="1">Skype: lavoisierfarias<br>Celular: 019-8122-1177<br>Twitter: <a href="http://twitter.com/LavoisierFarias" target="_blank">http://twitter.com/LavoisierFarias</a></font><br>
<br>