Note that there are some explanatory texts on larger screens.

plurals
  1. POFind exception thrown by 3rd party library
    primarykey
    data
    text
    <p>I hope I can explain this correctly. I am using the Javolution library to do reading and writing of an XML config file. I'm using XMLStreamReader/Writer. During reading, I'm looking to read a tag and store its attributes in a LinkedHashMap. However, I'm having an exception being thrown, that to me looks to make no sense due to when it's thrown and what's currently going on in the code.</p> <p>Using the Eclipse debugger, the exception is being thrown when an attribute's key and value is being added to my map.</p> <pre><code>public class Element { private HashMap&lt;String, String&gt; attributes = new LinkedHashMap&lt;String, String&gt;(); ... public void setAttribute(String key, String value) { ... attributes.put(key, value); } } </code></pre> <p>Straight after the key and value are added, <code>this</code> catches an exception from Javolution:</p> <pre><code>javolution.xml.stream.XMLStreamException: Local name cannot be null </code></pre> <p>Neither <code>key</code> or <code>value</code> are null. When they are being added to the map, I cannot step into the code further to see where the exception is being thrown, there is no stack trace, no file/line number shown anywhere to explain where or even how the exception is thrown.</p> <p>From a quick google search of older implementation of Javolution, I can see that this particular exception is only thrown using a few methods of the XMLStreamWriterImpl type. I've set breakpoints at each use I have of these methods, but the debugger doesn't catch them being used until much later in the code (and my localName variable is initialised at declaration).</p> <p>Would anyone have any advice for how I could determine why this exception is being thrown?</p> <p>Stack Trace:</p> <pre><code>Java HotSpot(TM) 64-Bit Server VM[localhost:3999] Thread [main] (Suspended) XMLImplMain$Element.setAttribute(String, String) line: 827 XMLImplMain.translate(Element) line: 133 XMLImplMain.translate(Element) line: 140 XMLImplMain.translate(Element) line: 140 XMLImplMain.loadXML(String) line: 118 Bootstrap.main(String[]) line: 32 Thread [EventWriter] (Running) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload