diff --git a/dkpro-jwpl-wikimachine/pom.xml b/dkpro-jwpl-wikimachine/pom.xml index 7fb3ecc9..ef431043 100644 --- a/dkpro-jwpl-wikimachine/pom.xml +++ b/dkpro-jwpl-wikimachine/pom.xml @@ -34,6 +34,10 @@ org.springframework spring-beans + + org.springframework + spring-context + org.dkpro.jwpl dkpro-jwpl-mwdumper diff --git a/dkpro-jwpl-wikimachine/src/main/java/org/dkpro/jwpl/wikimachine/factory/SpringFactory.java b/dkpro-jwpl-wikimachine/src/main/java/org/dkpro/jwpl/wikimachine/factory/SpringFactory.java index c3670b4e..0e5aa083 100644 --- a/dkpro-jwpl-wikimachine/src/main/java/org/dkpro/jwpl/wikimachine/factory/SpringFactory.java +++ b/dkpro-jwpl-wikimachine/src/main/java/org/dkpro/jwpl/wikimachine/factory/SpringFactory.java @@ -20,10 +20,9 @@ import java.io.File; import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.xml.XmlBeanFactory; -import org.springframework.core.io.ClassPathResource; -import org.springframework.core.io.FileSystemResource; -import org.springframework.core.io.Resource; +import org.springframework.context.support.AbstractXmlApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; +import org.springframework.context.support.FileSystemXmlApplicationContext; import org.dkpro.jwpl.wikimachine.debug.ILogger; import org.dkpro.jwpl.wikimachine.decompression.IDecompressor; @@ -67,19 +66,26 @@ private static BeanFactory getBeanFactory() { File outerContextFile = new File(OUTER_APPLICATION_CONTEXT); boolean outerContextFileProper = outerContextFile.exists() && outerContextFile.isFile() && outerContextFile.canRead(); - Resource res = (outerContextFileProper) ? new FileSystemResource(outerContextFile) : - new ClassPathResource(INNER_APPLICATION_CONTEXT); - return new XmlBeanFactory(res); + + AbstractXmlApplicationContext ctx; + if (outerContextFileProper) { + ctx = new FileSystemXmlApplicationContext(OUTER_APPLICATION_CONTEXT); + } else { + ctx = new ClassPathXmlApplicationContext(INNER_APPLICATION_CONTEXT); + } + return ctx; } public static SpringFactory getInstance() { return instance; } + @Override public ILogger getLogger() { return (ILogger) factory.getBean(LOG_BEAN); } + @Override public IDecompressor getDecompressor() { return (IDecompressor) factory.getBean(DECOMPRESSOR_BEAN); } diff --git a/pom.xml b/pom.xml index 6f8aa912..6edb0097 100644 --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,7 @@ 3.0.8 3.1.9 - 5.3.30 + 6.0.13 6.1.7.Final @@ -156,6 +156,11 @@ spring-beans ${spring.version} + + org.springframework + spring-context + ${spring.version} + org.wikimedia mwdumper