Closed camdencheek closed 7 years ago
Turns out it was an issue with the version of xerces I was using. An updated jar file fixed the issue.
I have the same issue. I have no clue where to update xerces... I cannot find a file with xerces in the name at all below the JAVA_HOME. (No Java expert here) Do I just download it from apache and put it in the lib of java?
...
Caused by: java.util.ServiceConfigurationError: javax.xml.parsers.DocumentBuilderFactory: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at javax.xml.parsers.FactoryFinder$1.run(FactoryFinder.java:294)
at java.security.AccessController.doPrivileged(Native Method)
at javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:289)
... 16 more
Traceback (most recent call last):
File "/home/user/workspace/ExampleModelling/CollectorModdeling_sec3.py", line 321, in <module>
penaltyDiscount = 2, maxDegree = -1, faithfulnessAssumed = True, verbose = True)
File "/home/user/software/anaconda3/lib/python3.6/site-packages/pycausal/search.py", line 235, in run
self.tetradGraph = algorithm.search(tetradData, params)
File "/home/user/software/anaconda3/lib/python3.6/site-packages/javabridge/wrappers.py", line 62, in <lambda>
fn = lambda naame=name: lambda *args: self.__call(naame, *args)
File "/home/user/software/anaconda3/lib/python3.6/site-packages/javabridge/wrappers.py", line 148, in __call
result = J.call(self.o, method_name, msig, *cargs)
File "/home/user/software/anaconda3/lib/python3.6/site-packages/javabridge/jutil.py", line 887, in call
result = fn(*nice_args)
File "/home/user/software/anaconda3/lib/python3.6/site-packages/javabridge/jutil.py", line 854, in fn
raise JavaException(x)
javabridge.jutil.JavaException: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created
EDIT: To answer my own question... Downloaded some JAR which looks like xerces from here And placed it next to the JARs of py-causal: /home/user/software/anaconda3/lib/python3.6/site-packages/pycausal/lib/ Seems to do the job...
On a fresh install, I get the exception
JavaException: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created
when I runpy-causal-continuous-example.py
Details OS: Arch linux 64 bit
Java: openjdk version "1.8.0_141" OpenJDK Runtime Environment (build 1.8.0_141-b15) OpenJDK 64-Bit Server VM (build 25.141-b15, mixed mode)
Python version: 2.7.13
Stacktrace: