intermine / intermine/intermine-ws-java

flush XMLOutputStream buffers?

Offen
#3 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
good first issue help wanted
Vorherrschende Sprache
Java
Sterne
2
Forks
1
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

We have quite a big classpath with various libraries pulled in. One of them is log4j-core 2.8.2, which also pulls in woodstox, which provides a STAX API. As you probably know, Java will use different XML processing classes depending on which jars are actually on the classpath. With the intermine client, you are shipping stax-api-1.0, but much later versions of that API are pulled in for the reasons above. I was able to fix the issue by setting this property prior to fetching data:

```
System.setProperty("javax.xml.stream.XMLOutputFactory", "com.sun.xml.internal.stream.XMLOutputFactoryImpl")
```

This overrides what's available on the classpath, using a basic XMLOutputFactoryImpl, thus bypassing the issue. According to my notes from last time (I may be getting this wrong), it's possible that "the InterMine Java API does not flush its XMLOutputStream buffers, which affects PathQuery.toXml and by extension any results from the QueryService."

I'm pretty sure you should be able to reproduce the problem by adding this to your dependencies:

```



```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.