org.springframework.dao.DataAccessResourceFailureException: Error while reading from event reader; nested exception is javax.xml.stream.XMLStreamException: ParseError at [row,col]:[8,2] Message: Element type "thing" must be followed by either attribute specifications, ">" or "/>".

Spring JIRA | drekbour | 6 years ago
  1. 0

    Scenario MRIR with a StaxEventItemReader as the delegate and several resources to loop through. Simplest failure scenario is if one of the XML files is truncated. A call to MRIR.read() gets the following exception: org.springframework.dao.DataAccessResourceFailureException: Error while reading from event reader; nested exception is javax.xml.stream.XMLStreamException: ParseError at [row,col]:[8,2] Message: Element type "thing" must be followed by either attribute specifications, ">" or "/>". at org.springframework.batch.item.xml.StaxEventItemReader.moveCursorToNextFragment(OXMStaxEventItemReader.java:198) at org.springframework.batch.item.xml.StaxEventItemReader.doRead(OXMStaxEventItemReader.java:336) at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.read(AbstractItemCountingItemStreamItemReader.java:85) at org.springframework.batch.item.file.MultiResourceItemReader.readNextItem(MultiResourceItemReader.java:111) at org.springframework.batch.item.file.MultiResourceItemReader.read(MultiResourceItemReader.java:99) Without any particular handling of the scenario, MRIR treats this as an item-specific problem and will keep retrying to reaD() the delegate without ever giving up. DataAccessResourceException javadoc : "Data access exception thrown when a resource fails completely: for example, if we can't connect to a database using JDBC." A) MRIR should recognise the resource has failed completely and "jump" to the next on the next call to read(). B) I'm not sure what exception to base this behaviour upon because the Exception inheritance is topsy-turvy. The generated exception is actually a child of NonTransientDataAccessResourceException (though the classname hints that it is more specific) with identical javadoc "Data access exception thrown when a resource fails completely and the failure is permanent." I'll be attaching a proposed patch for handling of this.

    Spring JIRA | 6 years ago | drekbour
    org.springframework.dao.DataAccessResourceFailureException: Error while reading from event reader; nested exception is javax.xml.stream.XMLStreamException: ParseError at [row,col]:[8,2] Message: Element type "thing" must be followed by either attribute specifications, ">" or "/>".
  2. 0

    Scenario MRIR with a StaxEventItemReader as the delegate and several resources to loop through. Simplest failure scenario is if one of the XML files is truncated. A call to MRIR.read() gets the following exception: org.springframework.dao.DataAccessResourceFailureException: Error while reading from event reader; nested exception is javax.xml.stream.XMLStreamException: ParseError at [row,col]:[8,2] Message: Element type "thing" must be followed by either attribute specifications, ">" or "/>". at org.springframework.batch.item.xml.StaxEventItemReader.moveCursorToNextFragment(OXMStaxEventItemReader.java:198) at org.springframework.batch.item.xml.StaxEventItemReader.doRead(OXMStaxEventItemReader.java:336) at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.read(AbstractItemCountingItemStreamItemReader.java:85) at org.springframework.batch.item.file.MultiResourceItemReader.readNextItem(MultiResourceItemReader.java:111) at org.springframework.batch.item.file.MultiResourceItemReader.read(MultiResourceItemReader.java:99) Without any particular handling of the scenario, MRIR treats this as an item-specific problem and will keep retrying to reaD() the delegate without ever giving up. DataAccessResourceException javadoc : "Data access exception thrown when a resource fails completely: for example, if we can't connect to a database using JDBC." A) MRIR should recognise the resource has failed completely and "jump" to the next on the next call to read(). B) I'm not sure what exception to base this behaviour upon because the Exception inheritance is topsy-turvy. The generated exception is actually a child of NonTransientDataAccessResourceException (though the classname hints that it is more specific) with identical javadoc "Data access exception thrown when a resource fails completely and the failure is permanent." I'll be attaching a proposed patch for handling of this.

    Spring JIRA | 6 years ago | drekbour
    org.springframework.dao.DataAccessResourceFailureException: Error while reading from event reader; nested exception is javax.xml.stream.XMLStreamException: ParseError at [row,col]:[8,2] Message: Element type "thing" must be followed by either attribute specifications, ">" or "/>".
  3. 0

    XML document structures must start and end within the same entity - Spring Forum

    spring.io | 1 year ago
    org.springframework.dao.DataAccessResourceFailureException: Error while reading from event reader; nested exception is javax.xml.stream.XMLStreamException: ParseError at [row,col]:[48959,15] Message: XML document structures must start and end within the same entity.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    GitHub comment 18770#166278080

    GitHub | 12 months ago | Dreampie
    org.springframework.dao.DataAccessResourceFailureException: Timed out after 10000 ms while waiting to connect. Client view of cluster state is {type=Unknown, servers=[{address=192.168.60.41:27017, type=Unknown, state=Connecting, exception={com.mongodb.MongoException$Network: Exception opening the socket}, caused by {java.net.SocketTimeoutException: connect timed out}}]; nested exception is com.mongodb.MongoTimeoutException: Timed out after 10000 ms while waiting to connect. Client view of cluster state is {type=Unknown, servers=[{address=192.168.60.41:27017, type=Unknown, state=Connecting, exception={com.mongodb.MongoException$Network: Exception opening the socket}, caused by {java.net.SocketTimeoutException: connect timed out}}]","path":"/users"}
  6. 0

    Using a plain DefaultDirContextValidator results in errors, with both Active Directory and Sun Directory Server. As soon as a valid base DN is set it works as expected. First a warning is logged: 14:05:50,355 WARN [DefaultDirContextValidator] DirContext 'javax.naming.ldap.InitialLdapContext@799f9a' failed validation with an exception. javax.naming.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-031001A8, problem 2001 (NO_OBJECT), data 0, best match of: '' ]; remaining name '' at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3010) at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2931) at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2737) at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1808) at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1731) at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:368) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:338) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:321) at javax.naming.directory.InitialDirContext.search(InitialDirContext.java:248) at org.springframework.ldap.pool.validation.DefaultDirContextValidator.validateDirContext(DefaultDirContextValidator.java:154) at org.springframework.ldap.pool.factory.DirContextPoolableObjectFactory.validateObject(DirContextPoolableObjectFactory.java:169) at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1035) at org.springframework.ldap.pool.factory.PoolingContextSource.getContext(PoolingContextSource.java:394) at org.springframework.ldap.pool.factory.PoolingContextSource.getReadOnlyContext(PoolingContextSource.java:374) at org.springframework.ldap.core.LdapTemplate.executeReadOnly(LdapTemplate.java:770) at org.springframework.ldap.core.LdapTemplate.lookup(LdapTemplate.java:897) [...] then an error: 14:05:50,358 ERROR [SequentialChannelRunner] Channel run error! Channel: channel1 org.springframework.dao.DataAccessResourceFailureException: Failed to borrow DirContext from pool.; nested exception is java.util.NoSuchElementException: Could not create a validated object at org.springframework.ldap.pool.factory.PoolingContextSource.getContext(PoolingContextSource.java:397) at org.springframework.ldap.pool.factory.PoolingContextSource.getReadOnlyContext(PoolingContextSource.java:374) at org.springframework.ldap.core.LdapTemplate.executeReadOnly(LdapTemplate.java:770) at org.springframework.ldap.core.LdapTemplate.lookup(LdapTemplate.java:897) [...] Caused by: java.util.NoSuchElementException: Could not create a validated object at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1049) at org.springframework.ldap.pool.factory.PoolingContextSource.getContext(PoolingContextSource.java:394) ... 9 more

    Spring JIRA | 8 years ago | Marius Scurtescu
    org.springframework.dao.DataAccessResourceFailureException: Failed to borrow DirContext from pool.; nested exception is java.util.NoSuchElementException: Could not create a validated object

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.dao.DataAccessResourceFailureException

      Error while reading from event reader; nested exception is javax.xml.stream.XMLStreamException: ParseError at [row,col]:[8,2] Message: Element type "thing" must be followed by either attribute specifications, ">" or "/>".

      at org.springframework.batch.item.xml.StaxEventItemReader.moveCursorToNextFragment()
    2. Spring Batch Infrastructure
      MultiResourceItemReader.read
      1. org.springframework.batch.item.xml.StaxEventItemReader.moveCursorToNextFragment(OXMStaxEventItemReader.java:198)
      2. org.springframework.batch.item.xml.StaxEventItemReader.doRead(OXMStaxEventItemReader.java:336)
      3. org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.read(AbstractItemCountingItemStreamItemReader.java:85)
      4. org.springframework.batch.item.file.MultiResourceItemReader.readNextItem(MultiResourceItemReader.java:111)
      5. org.springframework.batch.item.file.MultiResourceItemReader.read(MultiResourceItemReader.java:99)
      5 frames