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
Provider com.bea.xml.stream.EventFactory not found #8
Comments
Not sure where the com.bea... part comes from, looks like some other XML parser is found via some service-files in other packaged jars, presumably from some other library that you package into your Android app. What other dependencies do you have? |
I am running into exactly the same problem. Here are my dependencies: dependencies { My libs folder only contains the poishadow-all.jar from the release page. |
I am having a hard time reproducing this with your dependencies as some of them are not publicly available and some clash with the version of Android libs that are used in this sample-project. Can you extract a self-sufficient small sample-app that shows the problem? |
#5 (comment) might fix your issue. |
I have release version 0.3 which incorporates most of the changes from #7, hopefully this also fixes this issue, please comment and reopen if not. |
Please see #10 (comment) in issue #10 where a workaround is described that I also document in the README now until someone comes up with a better way of doing this. |
I went into this problem too, the workaround there not fixed the problem. package javax.xml.stream;
The problem comes from there. SOLVED WITH:
and adding stax to gradle:
|
Add the following to your gradle file: |
if I add it I get the errors:
ecc |
In Which file we should add those "Three Line"?????? |
Still experiencing this issue even using the advice in the README. I have these lines in my app's onCreate:
and have added this to my app's build.gradle:
adding fasterxml to build.gradle creates a large list of duplicate class errors at build time, requiring me to delete entire sections from the poishadow jar (org/codehaus and com/fasterxml). After doing this, the project will build, but I am left with the exact same error! I can only assume I am missing something important, I know this was closed a while ago but can anyone give me advice on how to get this runtime error to go away? |
The addition of com.fasterxml should not be necessary and is the cause for the duplicates. I would check if the setProperty calls are really executed before you reach any Apache POI code and if the error is really exactly the one that was discussed in this issue. |
Thanks for the tips! Actually I did end up figuring out what the problem was. You are right everything I needed was already in the jar (I just tried including fasterxml because I saw others doing it). The fix for me actually involved adding the following System.setProperty lines in addition to those mentioned in the README:
Not sure if I messed up the jar import some how that it necessitated this or if the README should be updated to include these? Either way, these statements (put in onCreate of the application / service) and the jar were the only things I needed to get it working. Hopefully this helps some others having similar obstacles! |
Hm, these are exactly the lines mentioned in the README already, so I don't see what can be updated there? |
Woops, my apologies, I copied the wrong lines from my code. I have updated my post to be the correct lines. All together, this is the full set I needed to get it working:
|
Strange that you needed them for the "javax.xml.stream" package as well as we shade all code underneath org.apache.poi here and javax.xml.stream should not exist at all. Do you have a stacktrace where exactly in the code this was causing an Exception? |
Sure thing:
The reference to javax seems to be in XMLEventFactory (here's the decompiled line) :
Perhaps I have not incorporated the jar correctly? I am just using this line in my build.gradle:
|
Strange that you need the javax... properties here, I would not expect this to be required, the exception shows that it is actually looking at org.apache.poi... code here, so it should also only require this property here. To be honest I am a bit reluctant to add this to the README for now without knowing why it is needed. If you want to investigate more, please open a new issue with enough details to reproduce this behavior, i.e. a sample application that triggers this. |
Add them in onCreate function of Main Activity |
Although this works I recommend to put it into the onCreate method of the Application subclass. |
I try to read an xlsx file from an InputStream
which yields
The text was updated successfully, but these errors were encountered: