Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7679765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:57:11+00:00 2026-05-31T17:57:11+00:00

After some struggle with smooks bean binding and CSV mapping, I managed to parse

  • 0

After some struggle with smooks bean binding and CSV mapping, I managed to parse a specific CSV with empty values as shown in this question. Somehow, I got some odd errors while creating smooks instance due to xml config file validation (expects a different xml document structure so it throws “expected blahblah/abstract-resource-config” thing). So I updated to smooks 1.5 and basically it stopped filtering input data. ¿¿What should I change in order to make it work getting the CSV from the messagePath path and filtering it using the given config??

The code block is this

protected List runSmooksTransform(int intType) throws IOException, SAXException, SmooksException {
    Smooks smooks = null;
    try {
        switch (intType) {
            case 0:
                // Header
                smooks = new Smooks("smooks-config_enc.xml");
                break;
            case 1:
                // Detail list
                smooks = SmooksFactoryServicio.getInstance().getSmooksDetalle();
                break;
            default:
                LogServicio.doLog("[CSVParserServicio, runSmooksTransform] Tipo de archivo a procesar no reconocido.", LogServicio.CErrorLvl);
                return null;
        }
        JavaResult javaResult = new JavaResult();

        File f = new File(messagePath);
        InputStream is = new FileInputStream(messagePath);
        StreamSource ss = new StreamSource( is );

        smooks.filterSource(ss, javaResult); //tried with file and inputstream to streamsource...

        LogServicio.doLog("[CSVParserServicio, runSmooksTransform] Finaliza procesamiento archivo"+ messagePath , LogServicio.CInfoLvl);
        return (List) javaResult.getBean("movimientoList");

    } catch (Exception e) {
        LogServicio.doLog("[CSVParserServicio, runSmooksTransform] Excepción procesando archivo: " + e.getMessage(), LogServicio.CErrorLvl);
        e.printStackTrace();
    } finally {
        smooks.close();
    }

    return null;
}

The config file is like this

<?xml version="1.0"?>
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
                      xmlns:csv1="http://www.milyn.org/xsd/smooks/csv-1.5.xsd"
                      xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.4.xsd"
                      xmlns:core="http://www.milyn.org/xsd/smooks/smooks-core-1.3.xsd">

    <!-- <core:filterSettings type="SAX" /> -->

    <csv1:reader fields="c01_ClaveBanco,c02_Cuenta,c03_Consecutivo,c04_FechaMovimientos,c05_ClaveMoneda,
    c06_SaldoInicial,c07_TotalDebitos, c08_TotalCreditos,c09_SaldoFinal,c10_TipoCuenta,c11,c12,c13,c14,
    c15,c16,c17,c18_NumeroMovs" separator=";" />

    <jb:bean beanId="movimiento" class="com.correval.conciliacion.procesador.bean.MulticashEncabezado"
     createOnElement="csv-record">

        <jb:value property="c01_ClaveBanco" data="csv-record/c01_ClaveBanco" />
        <jb:value property="c02_Cuenta" data="csv-record/c02_Cuenta" />
        <jb:value property="c03_Consecutivo" data="csv-record/c03_Consecutivo" decoder="Integer" default="0" />
        <jb:value property="c04_FechaMovimientos" data="csv-record/c04_FechaMovimientos" />
        <jb:value property="c05_ClaveMoneda" data="csv-record/c05_ClaveMoneda" />
        <jb:value property="c06_SaldoInicial" data="csv-record/c06_SaldoInicial" decoder="Double" default="0.0" />
        <jb:value property="c07_TotalDebitos" data="csv-record/c07_TotalDebitos" decoder="Double" default="0.0" />
        <jb:value property="c08_TotalCreditos" data="csv-record/c08_TotalCreditos" decoder="Double" default="0.0" />
        <jb:value property="c09_SaldoFinal" data="csv-record/c09_SaldoFinal" decoder="Double" default="0.0" />

        <jb:value property="c10_TipoCuenta" data="csv-record/c10_TipoCuenta" />
        <jb:value property="c11" data="csv-record/c11" />
        <jb:value property="c12" data="csv-record/c12" />
        <jb:value property="c13" data="csv-record/c13" />
        <jb:value property="c14" data="csv-record/c14" />
        <jb:value property="c15" data="csv-record/c15" />
        <jb:value property="c15" data="csv-record/c16" />
        <jb:value property="c16" data="csv-record/c17" />
        <jb:value property="c18_NumeroMovs" data="csv-record/c18_NumeroMovs" decoder="Integer" default="0" />
    </jb:bean>

    <jb:bean beanId="movimientoList" class="java.util.ArrayList" createOnElement="csv-set">
        <jb:wiring beanIdRef="movimiento" />
    </jb:bean>

</smooks-resource-list>

The error log for each file I try to parse is this:

2012-02-15 12:37:41,291 [-] [http-apr-9090-exec-4] ERROR LogServicio [CSVParserServicio, runSmooksTransform] Excepci¾n procesando archivo: F
ailed to filter source.
org.milyn.SmooksException: Failed to filter source.
        at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:97)
        at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:64)
        at org.milyn.Smooks._filter(Smooks.java:526)
        at org.milyn.Smooks.filterSource(Smooks.java:482)
        at org.milyn.Smooks.filterSource(Smooks.java:456)
        at com.correval.conciliacion.procesador.servicios.CSVParserServicio.runSmooksTransform(CSVParserServicio.java:92)
        at com.correval.conciliacion.procesador.servicios.CSVParserServicio.parseCSVFile(CSVParserServicio.java:33)
        at com.correval.conciliacion.procesador.servicios.ArchivoServicio.extractMulticashData(ArchivoServicio.java:502)
        at com.correval.conciliacion.logica.servlet.ProcesaBancoServlet.getMulticashHeaders(ProcesaBancoServlet.java:130)
        at com.correval.conciliacion.logica.servlet.ProcesaBancoServlet.doPost(ProcesaBancoServlet.java:68)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1824)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IllegalArgumentException: null or empty 'value' arg in method call.
        at org.milyn.assertion.AssertArgument.isNotNullAndNotEmpty(AssertArgument.java:78)
        at org.milyn.flatfile.Field.<init>(Field.java:39)
        at org.milyn.flatfile.variablefield.VariableFieldRecordParser.nextRecord(VariableFieldRecordParser.java:190)
        at org.milyn.flatfile.FlatFileReader.parse(FlatFileReader.java:132)
        at org.milyn.delivery.sax.SAXParser.parse(SAXParser.java:76)
        at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:86)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:57:12+00:00Added an answer on May 31, 2026 at 5:57 pm

    It has been fixed since, you can upgrade to 1.5.1 which is released with the fix.

    See http://jira.codehaus.org/browse/MILYN-636

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After some find and replace refactoring I ended up with this gem: const class
After some stupid musings about Klingon languages, that came from this post I began
After some code review I removed unnecessary properties which resulted in empty rules. So
after some tries to get this to work, i ask you, if you know
After some googling-fu on making subscript text in crystal report, I found this ,
after some pretty fanatic jumbled thingies i successfully managed to run FreeGlue with GLEW.
After some time this actor fills out stack. Possible solutions ? object Puller extends
I've deployed, after some struggle, a web-app on a (remote) Tomcat 5.5 server (Turnkey
After some Googling it appears this is a common problem but I have yet
After some time I wanted to update my git repo, and then something went

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.