Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flush XMLOutputStream buffers? #3

Open
julie-sullivan opened this issue Jul 3, 2019 · 1 comment
Open

flush XMLOutputStream buffers? #3

julie-sullivan opened this issue Jul 3, 2019 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@julie-sullivan
Copy link
Member

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:


 <dependency org="org.apache.logging.log4j" name="log4j-api" rev="2.8.2" />
 <dependency org="org.apache.logging.log4j" name="log4j-core" rev="2.8.2" />
 <dependency org="org.apache.logging.log4j" name="log4j-1.2-api" rev="2.8.2" /> 

@julie-sullivan julie-sullivan added help wanted Extra attention is needed good first issue Good for newcomers labels Jul 3, 2019
@jtnystrom
Copy link

jtnystrom commented Dec 22, 2021

Hi, I believe I'm the one who reported this issue originally, but it seems to have gone away in the latest version. If nobody else has experienced this problem, feel free to close the issue. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants