# NoClassDefFoundError on file in project code base

**URL:** <https://discuss.gradle.org/t/noclassdeffounderror-on-file-in-project-code-base/4999>\
**Category:** Old Forum Archive\
**Created:** [April 8, 2014, 8:15pm UTC](https://discuss.gradle.org/t/noclassdeffounderror-on-file-in-project-code-base/4999 "2014-04-08T20:15:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gary\_Shurgin](https://avatars.discourse-cdn.com/v4/letter/g/4da419/32.png) [@Gary\_Shurgin](https://discuss.gradle.org/u/Gary_Shurgin)\
**Post date:** [April 8, 2014, 8:15pm UTC](https://discuss.gradle.org/t/noclassdeffounderror-on-file-in-project-code-base/4999/1 "2014-04-08T20:15:00Z")

</div>

I have a maven project that I am attempting to convert to Gradle.

The project has a mixture of Groovy and Java files, and is composed of 55 sub-projects.

About two thirds of the way through the sub-projects, the Groovy Compiler fails with the following stacktrace.

I have seen this error in other posts on the net, but they always refer to classes that are in jar files that should be included as dependencies. The class that this error is referring to is an interface in my code base.

What am I missing? The code compiles clean under Maven.

Caused by: java.lang.NoClassDefFoundError: Lorg/oclc/cataloging/service/record/RecordLockChecker;

at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:119)

at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:40)

at org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonServer.execute(CompilerDaemonServer.java:53)

at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)

at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)

at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355)

at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64) Caused by: java.lang.ClassNotFoundException: org.oclc.cataloging.service.record.RecordLockChecker

at org.gradle.internal.classloader.TransformingClassLoader.findClass(TransformingClassLoader.java:41)

… 7 more

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [April 8, 2014, 9:15pm UTC](https://discuss.gradle.org/t/noclassdeffounderror-on-file-in-project-code-base/4999/2 "2014-04-08T21:15:00Z")

</div>

You may be missing a compile dependency. Or perhaps you have bidirectional dependencies between Groovy and Java code in the same project, but aren’t using joint compilation.

---

<div class="post-metadata">

**Author:** ![Gary\_Shurgin](https://avatars.discourse-cdn.com/v4/letter/g/4da419/32.png) [@Gary\_Shurgin](https://discuss.gradle.org/u/Gary_Shurgin)\
**Post date:** [April 9, 2014, 8:44pm UTC](https://discuss.gradle.org/t/noclassdeffounderror-on-file-in-project-code-base/4999/3 "2014-04-09T20:44:00Z")

</div>

I have altered the paths to use joint compilation.

```gradle
sourceSets.main.java.srcDirs = []
    sourceSets.main.groovy.srcDirs = ["src/main/java", "src/main/groovy"]
      sourceSets.test.java.srcDirs = []
    sourceSets.test.groovy.srcDirs = ["src/test/java", "src/test/groovy"]

```

Would the dependency problem be in the file mentioned, or in a file that references this file. The class in question is an interface, with 1 include. The jar file that contains the included path is in the dependency list.
