Announcement Announcement Module
Collapse
No announcement yet.
problem with listener Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • problem with listener

    Hi all,

    where do i have to put listener reference in configuration file. I have the following:

    <batch:job id="leerBBDDJob">
    <batch:step id="imprimirPorConsola">
    <batch:tasklet>
    <batch:chunk reader="gestionesItemReader"
    processor="tratarFila"
    writer="gestionesItemWriter"
    commit-interval="1" />
    <!-- Con listener definimos un handler para los errores que surjan en el step -->
    <batch:listeners>
    <batch:listener class="com.GestionesItemListener" />
    </batch:listeners>
    </batch:tasklet>
    </batch:step>
    </batch:job>


    but i get the following exception when i try to execute:
    org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 77 in XML document from class path resource [LeerBBDDJob.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: it's not permitted that 'class' attribute appears in the element 'batch:listener'.

    It's the same from an internet example, so i don't understand why don't run

    i hope someone can help me.

  • #2
    I've just solved doing this:

    <batch:job id="leerBBDDJob"> <!-- incrementer="dynamicJobParameters">-->
    <batch:step id="imprimirPorConsola">
    <batch:tasklet>
    <batch:chunk reader="gestionesItemReader"
    processor="tratarFila"
    writer="gestionesItemWriter"
    commit-interval="1" />

    <batch:listeners>
    <batch:listener ref="gestionesListener"/>
    </batch:listeners>

    </batch:tasklet>


    </batch:step>
    </batch:job>


    <bean id="gestionesListener" class="com.GestionesItemListener" />

    Comment

    Working...
    X