java.lang.NoClassDefFoundError: org/springframework/core/io/support/ResourcePatternResolver

Hi, Please help me to resolve this issue while building BigBlueButton. the stack trace as below. :compileGroovy >>> a serious error occurred: org/springframework/core/io/support/ResourcePatternResolver >>> stacktrace: java.lang.NoClassDefFoundError: org/springframework/core/io/support/ResourcePatternResolver

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)

at java.lang.ClassLoader.defineClass(ClassLoader.java:616)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:296)

at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:674)

at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:541)

at org.codehaus.groovy.control.ResolveVisitor.resolveToClass(ResolveVisitor.java:683)

at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:272)

at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1201)

at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:148)

at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:585)

at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:832)

at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:519)

at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:495)

at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:472)

at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:456)

at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:57)

at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:170)

at org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompile(FileSystemCompiler.java:138)

at org.codehaus.groovy.tools.FileSystemCompiler.main(FileSystemCompiler.java:152) Caused by: java.lang.ClassNotFoundException: org.springframework.core.io.support.ResourcePatternResolver

at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

… 28 more

FAILURE: Build failed with an exception.

  • Where: Build file ‘D:\wm_workspace\sewm.apps\build.gradle’

  • What went wrong: Execution failed for task ‘:compileGroovy’. Cause: Forked groovyc returned error code: 1

  • Try: Run with -s or -d option to get more details. Run with -S option to get the full (very verbose) stacktrace.

BUILD FAILED

Total time: 1 mins 8.382 secs

Thanks, Manoj

seems that your project has a dependency on a spring related library which is not declared in your build script. cheers, rene

Specifically check if your build declares a dependency on Spring core. If that’s already the case please post the contents of your build script.

Hi Rene & Benjamin, Thanks for the response. below is my build script.

SCRIPT:

usePlugin ‘scala’ usePlugin ‘groovy’ usePlugin ‘war’ usePlugin ‘eclipse’

version = ‘0.64’ jar.enabled = true

def appName = ‘bigbluebutton’ def localMavenRepo = “file://D:/Documents and Settings/xxxxx/.gradle/internal-repository”

archivesBaseName = appName

task copyToLib(dependsOn: configurations.default.buildArtifacts, type: Copy) {

into(‘lib’)

from configurations.default

from configurations.default.allArtifacts*.file }

repositories {

add(new org.apache.ivy.plugins.resolver.ChainResolver()) {

name = ‘remote’

returnFirst = true

add(new org.apache.ivy.plugins.resolver.URLResolver()) {

name = “googlecode”

addArtifactPattern “http://red5.googlecode.com/svn/repository/artifact.[ext]”

addArtifactPattern “http://red5.googlecode.com/svn/repository/[organisation]/artifact.[ext]”

}

add(new org.apache.ivy.plugins.resolver.URLResolver()) {

name = “blindside-repos”

addArtifactPattern “http://blindside.googlecode.com/svn/repository/artifact.[ext]”

addArtifactPattern “http://blindside.googlecode.com/svn/repository/[organisation]/artifact.[ext]”

}

add(new org.apache.ivy.plugins.resolver.URLResolver()) {

name = “maven2-central”

m2compatible = true

addArtifactPattern “http://repo1.maven.org/maven2/[organisation]/[module]/[revision]/artifact.[ext]”

addArtifactPattern “http://repo1.maven.org/maven2/[organisation]/[artifact]/[revision]/artifact.[ext]”

}

add(new org.apache.ivy.plugins.resolver.URLResolver()) {

name = “testng_ibiblio_maven2”

m2compatible = true

addArtifactPattern “http://repo1.maven.org/maven2/[organisation]/[module]/[revision]/artifact-jdk15.[ext]”

addArtifactPattern “http://repo1.maven.org/maven2/[organisation]/[artifact]/[revision]/artifact-jdk15.[ext]”

}

}

mavenRepo urls: localMavenRepo

//flatDir name: ‘fileRepo1’, dirs: “D:/Documents and Settings/manojkumar.herkar/.gradle/internal-repository”

// Change this to the location of your SEWM Common Message project /build/libs

flatDir name: ‘fileRepo’, dirs: “D:/wm_workspace/sewm.common_message/build/libs” }

dependencies {

// JMS

compile ‘org.apache.activemq:activemq-core:5.1.0@jar’

compile ‘org/apache/geronimo:geronimo-j2ee-management_1.0_spec:1.0@jar’

compile ‘org/apache/geronimo:geronimo-jms_1.1_spec:1.0@jar’

// Servlet

providedCompile ‘javax.servlet:servlet-api:2.5@jar’

// Mina

providedCompile ‘org.apache.mina:mina-core:2.0.0-RC1@jar’

providedCompile ‘org.apache.mina:mina-integration-spring:1.1.7@jar’

// Asterisk-Java

compile ‘org.asteriskjava:asterisk-java:1.0.0.M3@jar’

// Spring

providedCompile ‘spring:spring-web:3.0.0@jar’, ‘aopalliance:aopalliance:1.0:@jar

providedCompile ‘spring:spring-beans:3.0.0@jar’, ‘spring:spring-aop:3.0.0@jar’

providedCompile ‘spring:spring-context:3.0.0@jar’, ‘spring:spring-core:3.0.0@jar’

compile ‘spring:spring-tx:2.5.6@jar’, ‘spring:spring-jms:3.0.0@jar’

// Spring Integration // compile ‘org.springframework.integration:spring-integration-core:1.0.3.RELEASE@jar’ // compile ‘org.springframework.integration:spring-integration-adapter:1.0.3.RELEASE@jar’ // compile ‘org.springframework.integration:spring-integration-stream:1.0.3.RELEASE@jar’ // compile ‘org.springframework.integration:spring-integration-file:1.0.3.RELEASE@jar’ // compile ‘org.springframework.integration:spring-integration-jms:1.0.3.RELEASE@jar’

compile ‘org/spring/integration:spring-integration-core:2.0.0.M2@jar’

compile ‘org/spring/integration:spring-integration-adapter:2.0.0.M2@jar’

compile ‘org/spring/integration:spring-integration-stream:2.0.0.M2@jar’

compile ‘org/spring/integration:spring-integration-file:2.0.0.M2@jar’

compile ‘org/spring/integration:spring-integration-jms:2.0.0.M2@jar’

// Red5

providedCompile ‘org/red5:red5:0.91@jar’

// Logging

providedCompile ‘:logback-core:0.9.18@jar’, ‘:logback-classic:0.9.18@jar’, ‘:slf4j-api:1.5.10@jar’

providedCompile ‘:jcl-over-slf4j:1.5.10@jar’, ‘:log4j-over-slf4j:1.5.10@jar’

// Java Concurrency In Practice

providedCompile ‘net.jcip:jcip-annotations:1.0@jar’

// YAML

compile ‘org/ho:jyaml:1.3@jar’

// GROOVY

groovy ‘org.codehaus.groovy:groovy-all:1.7.2@jar’

// Testing

testRuntime ‘org/testng:testng:5.8@jar’, ‘org/fitnesse:fitnesse:20090214@jar’, ‘org.easymock:easymock:2.4@jar’

// Libraries needed to run the scala tools

scalaTools ‘org.scala-lang:scala-compiler:2.7.7’

scalaTools ‘org.scala-lang:scala-library:2.7.7’

// Libraries needed for scala api

compile ‘org.scala-lang:scala-library:2.7.7’

compile ‘common:bbb-common-message:0.64@jar’

}

test {

useTestNG() }

war.doLast {

ant.unzip(src: war.archivePath, dest: “$buildDir/$appName”)

ant.copy(file: “$buildDir/$appName/WEB-INF/logback-bigbluebutton.xml”, todir: “$buildDir/$appName/WEB-INF/classes”) }

task deploy() << {

def red5AppsDir = ‘D:/Program Files/Red5/webapps’

def bbbDir = new File("${red5AppsDir}/$appName")

println “Deleting $bbbDir”

ant.delete(dir: bbbDir)

ant.mkdir(dir: bbbDir)

ant.copy(todir: bbbDir) {

fileset(dir: “$buildDir/$appName”)

} }

Thanks, Manoj

Please use HTML code tags for all code snippets. Which Gradle version are you using? ‘usePlugin’ is from ancient times.

Hi Peter,

I am using gradle-0.8.

Thanks, Manoj

i am using eclipse plugin as well.

As Rene and Benjamin said earlier, the most likely cause is a missing dependency declaration. (Note that Groovy sometimes requires ‘runtime’ dependencies on its ‘compile’ class path.) However, we no longer support Gradle versions < 1.0, and I strongly recommend that you upgrade to a recent version.

issue resolved. Thanks all.