Я запускаю скрипт grails для загрузки bean-компонента из приложения grails, однако, похоже, у меня проблема с зависимостями.Вот мой код:
import grails.spring.BeanBuilder
import org.springframework.context.ApplicationContext
target(main: "Script to load location information into Solr") {
println "Hello script"
def bb = new BeanBuilder()
ApplicationContext appContext = bb.createApplicationContext()
def service = appContext.getBean("solrjService")
}
setDefaultTarget(main)
Когда я выполняю скрипт, я получаю следующую трассировку стека:
main:
Hello script
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:108)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory
at org.slf4j.LoggerFactory.staticInitialize(LoggerFactory.java:83)
at org.slf4j.LoggerFactory.<clinit>(LoggerFactory.java:73)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:272)
at grails.spring.BeanBuilder.<clinit>(BeanBuilder.java:84)
Любые идеи ??
Спасибо за ваше время