2017-01-12 5 views
0

Я пытался реализовать ликгиграф в своем проекте. Я использую этот пример https://github.com/fbiville/liquigraph-spring-boot-example. Пример работает отлично, пока я пытался добавить две зависимости от Стэнфордского NLP:Как исправить ошибку, вызванную использованием stanford nlp и жидкостью вместе?

<dependency> 
     <groupId>edu.stanford.nlp</groupId> 
     <artifactId>stanford-corenlp</artifactId> 
     <version>3.6.0</version> 
    </dependency> 
    <dependency> 
     <groupId>edu.stanford.nlp</groupId> 
     <artifactId>stanford-corenlp</artifactId> 
     <version>3.6.0</version> 
     <classifier>models</classifier> 
    </dependency> 

После того как я добавил эти две зависимости, я получил эту ошибку:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquigraph' defined in class path resource [org/liquigraph/spring/starter/LiquigraphAutoConfiguration$LiquigraphConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: 
cvc-elt.1: Cannot find the declaration of element 'changelog'. 
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:754) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] 
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] 
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] 
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] 
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] 
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] 
at org.liquigraph.examples.spring.SampleController.main(SampleController.java:48) [classes/:na] 

Caused by: java.lang.IllegalArgumentException: 
    cvc-elt.1: Cannot find the declaration of element 'changelog'. 
    at org.liquigraph.core.io.xml.ChangelogParser.parseChangelog(ChangelogParser.java:67) ~[liquigraph-core-3.0.2-SNAPSHOT.jar:na] 
    at org.liquigraph.core.io.xml.ChangelogParser.parse(ChangelogParser.java:59) ~[liquigraph-core-3.0.2-SNAPSHOT.jar:na] 
    at org.liquigraph.core.api.MigrationRunner.parseChangesets(MigrationRunner.java:87) ~[liquigraph-core-3.0.2-SNAPSHOT.jar:na] 
    at org.liquigraph.core.api.MigrationRunner.runMigrations(MigrationRunner.java:68) ~[liquigraph-core-3.0.2-SNAPSHOT.jar:na] 
    at org.liquigraph.core.api.Liquigraph.runMigrations(Liquigraph.java:63) ~[liquigraph-core-3.0.2-SNAPSHOT.jar:na] 
    at org.liquigraph.spring.SpringLiquigraph.afterPropertiesSet(SpringLiquigraph.java:52) ~[liquigraph-spring-boot-starter-3.0.2-SNAPSHOT.jar:na] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    ... 16 common frames omitted 

Как исправить эту ошибку?

+0

У вас есть журнал изменений файла в вашем проекте? Вы уже правильно определили путь? –

+0

@DavidVincent Конечно, у меня оно есть. Changelog.xml включен в файл образца из github –

+0

Я только что ответил ссылкой на вопрос Github. Не стесняйтесь принимать ответ :) – Rolf

ответ

0

Это было filed и фиксируется за счет исключения Xerces-осущ, что является транзитивно неправдоподобным из Стэнфордского NLP зависимость:

<dependency> 
    <groupId>edu.stanford.nlp</groupId> 
    <artifactId>stanford-corenlp</artifactId> 
    <version>3.6.0</version> 
    <exclusions> 
     <exclusion> 
      <groupId>xerces</groupId> 
      <artifactId>xercesImpl</artifactId> 
     </exclusion> 
    </exclusions> 
</dependency>