简体   繁体   中英

Grails dependency issues

I'm in the process of moving a Java/Spring MVC app to Grails. I was able to get a couple of pages along with Spring Security working. However, when I added cxf-bundle-minimal as a dependency I started to get the errors below.

    ::::::::::::::::::::::::::::::::::::::::::::::

    ::          UNRESOLVED DEPENDENCIES         ::

    ::::::::::::::::::::::::::::::::::::::::::::::

    :: javax.ejb#ejb;3.0: not found             ::

    ::::::::::::::::::::::::::::::::::::::::::::::

Exception starting filter springSecurityFilterChain org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined

Now, even if I remove the dependency the error continues. Anyone know what the cause of the problem is and how to resolve it? My dependency list follows.

    dependencies {

    runtime 'mysql:mysql-connector-java:5.1.12'

    compile('log4j:log4j:1.2.16',
            'org.apache.cxf:cxf-bundle-minimal:2.2.9',
            'org.springframework:spring-beans:3.0.2.RELEASE',
            'org.springframework:spring-context:3.0.2.RELEASE',
            'org.springframework:spring-core:3.0.2.RELEASE',
            'org.springframework:spring-jdbc:3.0.2.RELEASE',
            'org.springframework.security:spring-security-core:3.0.2.RELEASE',
            'org.springframework.security:spring-security-config:3.0.2.RELEASE',
            'org.springframework.security:spring-security-web:3.0.2.RELEASE')
}

This isn't what you want to hear, I'm sure, but nearly every time I've strayed from the default Grails configuration (using Maven or the native build), I've found myself beating my head against these types of configuration problems. I don't have a magical solution for you, but I'd first run a dependency report to see what the graph looks like ( http://grails.org/doc/1.3.x/ ). After that it becomes detective work and more than a little trial-and-error. Anyway, start with the dependency report and see what it shows. Good luck.

Chances are you need to add a new maven repo dependency into your BuildConfig.groovy file. Find (or create) a repo that has the jar files that are missing, and add it in. By default the jboss maven repo is commented out, but it might have what you're looking for as a starting place.

I had a similar issue today. After some research online I decided that this problem may be caused by one of my plugin's dependencies, but I didn't know which one. How I solved (sidestepped) it was to go to "application.properties" and commented out the plugins that were non-essential.

Obviously this does not solve the underlying dependency problem, unless you can live without those plugins.

I understand your frustrations, believe me. If you find a better solution please post it!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM