-
Notifications
You must be signed in to change notification settings - Fork 9
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
Can't run the tests (Could not create JAXB context) #2
Comments
It looks like a dependency of the project is not installed. Please run the following commands from the relation-extraction project directory before trying to run the test:
Let me know if that helps. |
Thanks, testak but what I am getting is a runtime error when I run the tests, not a compilation issue. I already installed the dependency and the code is compiling fine. Are you able to run the test fine? |
Which branch of the relation-extractor are you working with? It appears I need to update the expected output within the test. However, when I run the tests on both develop and master branches I get an AssertionError because the expected output does not match the actual output of the test. Here is a section of my output that starts with initializing JollyDayHoliday:
I understand you are seeing your error at runtime, but according to your output it's due to a missing class, which is a dependency for Stanford's CoreNLP library used by the entity-extractor:
|
I am working on master. I did make sure the dependency is installed but I am still getting the same error. C:\IEcode\stucco-entity-extractor>mvn clean install |
Fixed the error. It was happening because the jaxb libraries are not included by default in java 9 and 10. So I added them to the pom and it worked fine. Now am I getting the assertion error you mentioned above. Did you get anywhere with it? |
I got an error when trying to run the tests (mvn test -Dmaven.test.skip=false). Could you please help?
Initializing JollyDayHoliday for sutime with classpath:edu/stanford/nlp/models/sutime/jollyday/Holidays_sutime.xml
Sep 12, 2018 11:45:59 AM de.jollyday.util.XMLUtil unmarshallConfiguration
WARNING: Could not create JAXB context using the current threads context classloader. Defaulting to ObjectFactory classloader.
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 9.569 sec <<< FAILURE!
testGetGraph(gov.ornl.stucco.RelationExtractorTest) Time elapsed: 9.531 sec <<< ERROR!
edu.stanford.nlp.util.ReflectionLoading$ReflectionLoadingException: Error creating edu.stanford.nlp.time.TimeExpressionExtractorImpl
at edu.stanford.nlp.util.ReflectionLoading.loadByReflection(ReflectionLoading.java:40)
at edu.stanford.nlp.time.TimeExpressionExtractorFactory.create(TimeExpressionExtractorFactory.java:57)
at edu.stanford.nlp.time.TimeExpressionExtractorFactory.createExtractor(TimeExpressionExtractorFactory.java:38)
at edu.stanford.nlp.ie.regexp.NumberSequenceClassifier.(NumberSequenceClassifier.java:79)
at edu.stanford.nlp.ie.NERClassifierCombiner.(NERClassifierCombiner.java:68)
at edu.stanford.nlp.pipeline.AnnotatorImplementations.ner(AnnotatorImplementations.java:99)
at edu.stanford.nlp.pipeline.StanfordCoreNLP$6.create(StanfordCoreNLP.java:627)
at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:85)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:292)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:129)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:125)
at gov.ornl.stucco.entity.EntityLabeler.(EntityLabeler.java:26)
at gov.ornl.stucco.RelationExtractorTest.testGetGraph(RelationExtractorTest.java:107)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: edu.stanford.nlp.util.MetaClass$ClassCreationException: MetaClass couldn't create public edu.stanford.nlp.time.TimeExpressionExtractorImpl(java.lang.String,java.util.Properties) with args [sutime, {customAnnotatorClass.cyberentity=gov.ornl.stucco.entity.CyberEntityAnnotator, annotators=tokenize, ssplit, pos, cyberheuristics, cyberentity, lemma, ner, parse, customAnnotatorClass.cyberheuristics=gov.ornl.stucco.entity.heuristics.CyberHeuristicAnnotator}]
at edu.stanford.nlp.util.MetaClass$ClassFactory.createInstance(MetaClass.java:233)
at edu.stanford.nlp.util.MetaClass.createInstance(MetaClass.java:378)
at edu.stanford.nlp.util.ReflectionLoading.loadByReflection(ReflectionLoading.java:38)
... 40 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
at edu.stanford.nlp.util.MetaClass$ClassFactory.createInstance(MetaClass.java:229)
... 42 more
Caused by: java.lang.RuntimeException: Error initializing binder 1
at edu.stanford.nlp.time.Options.(Options.java:92)
at edu.stanford.nlp.time.TimeExpressionExtractorImpl.init(TimeExpressionExtractorImpl.java:45)
at edu.stanford.nlp.time.TimeExpressionExtractorImpl.(TimeExpressionExtractorImpl.java:39)
... 47 more
Caused by: java.lang.IllegalStateException: Cannot instantiate configuration.
at de.jollyday.impl.XMLManager.init(XMLManager.java:286)
at de.jollyday.HolidayManager.createManager(HolidayManager.java:278)
at de.jollyday.HolidayManager.getInstance(HolidayManager.java:194)
at edu.stanford.nlp.time.JollyDayHolidays.init(JollyDayHolidays.java:52)
at edu.stanford.nlp.time.Options.(Options.java:90)
... 49 more
Caused by: java.lang.IllegalStateException: Cannot parse holidays XML file.
at de.jollyday.util.XMLUtil.unmarshallConfiguration(XMLUtil.java:80)
at de.jollyday.impl.XMLManager.init(XMLManager.java:284)
... 53 more
Caused by: javax.xml.bind.JAXBException: Provider com.sun.xml.internal.bind.v2.ContextFactory not found
[java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:148)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:361)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:446)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:409)
at de.jollyday.util.XMLUtil$JAXBContextCreator.create(XMLUtil.java:172)
at de.jollyday.util.XMLUtil.unmarshallConfiguration(XMLUtil.java:73)
... 54 more
Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
at javax.xml.bind.ContextFinder.safeLoadClass(ContextFinder.java:573)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:145)
... 59 more
Results :
Tests in error:
testGetGraph(gov.ornl.stucco.RelationExtractorTest): Error creating edu.stanford.nlp.time.TimeExpressionExtractorImpl
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
The text was updated successfully, but these errors were encountered: