This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 186208 - Compilation problems when testing w/ many interdependent J2SE projects
Summary: Compilation problems when testing w/ many interdependent J2SE projects
Status: RESOLVED DUPLICATE of bug 47507
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Zezula
Depends on:
Reported: 2010-05-15 16:20 UTC by _ tboudreau
Modified: 2010-05-27 13:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2010-05-15 16:20:27 UTC
I am working on a project which contains many different interdependent projects (basically, a project structure like the NetBeans codebase, but using J2SEProject - it's just java libraries).  This team decided to use Ant + Ivy (we are not really using Ivy yet) instead of Maven.  However, this problem is confusing enough developers that it is really problematic.

Basically, *sometimes* you run tests in a project which depends on others which depend on others, and you get NoClassDefFoundErrors.  Other times it works correctly.

It appears that the errors happen if you have made changes in a dependent project (may require changing something > 1 level of indirection away).  Say you have a dependency graph like this (I am leaving a lot out, and the transient closure of each project *is* in its dependencies - I am just listing classes actually used):

I can clean and build and run tests and it works fine.

However, if I make a change in, say, util, then I get a NoClassDefFoundError from, say, localization at runtime.

I *think* the problem is we are being too intelligent about the test classpath, and sometimes using build/classes (due to compile-on-save) as the classpath.  

What happens is:  If I am running against a built JAR, then the classpath includes the dependencies from the JAR's manifest.  If, at runtime, the classpath is build/classes for localization, then localization's dependency on util is missing.  So clean and build w/ dependencies fixes the problem, but it is very non-obvious what is wrong.

Maybe we should be using maven, but it would not be a good use of anyone's time to mavenize 24 interdependent projects.  The team I am helping has a bunch of users who are new to NetBeans, and some Eclipse and Intellij users.

I'll try to create a small test case to demonstrate the problem.
Comment 1 Tomas Zezula 2010-05-17 17:40:02 UTC
The j2seproject does not support the Class-Path attribute yet  issue #105927 and it will not help you as the jar may not exist. The NetBeans ant based projects have no transitive dependencies. When cloud depends on agent which depends on util, the cloud itself has to depend on util. Seems as a duplicate of #47507, but maybe I am wrong as I don't know all the project deps.
Comment 2 Tomas Zezula 2010-05-27 13:53:10 UTC
MArking as duplicate of #47507.

*** This bug has been marked as a duplicate of bug 47507 ***