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 121610 - jars from dependencies aren't added to the classpath
Summary: jars from dependencies aren't added to the classpath
Status: RESOLVED DUPLICATE of bug 47507
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-09 18:37 UTC by jschek
Modified: 2007-11-14 14:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Netbeans Projects (44.38 KB, application/x-compressed)
2007-11-09 18:38 UTC, jschek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jschek 2007-11-09 18:37:41 UTC
I have attached a sample set of projects to demonstrate this bug/issue. This may be the "correct" behavior of the IDE, 
but it's a little unexpected. Nested dependencies (either through jar manifests or project dependencies)  are not 
getting added/propogated up.

1. The main project "MyApp". MyApp has includes "OuterLibrary" and "OuterApp" as its dependencies (Added through 
Project Properties -> Libraries -> Add Project...).
2. OuterLibrary project depends on another project, called InnerLibrary (added in the same manner as above). This was 
created as a "Java Class Library". Also depends on Bean Binding.
3. OuterApp project depends on another project, called InnerLibrary (added in the same manner as above). This was 
created as "Java Application". Also depends on Bean Binding.
4. InnerLibrary has no other dependencies.

MyApp is unable to see the classes in "InnerLibrary". This is demonstrated by the class "TestOfInnerClassReference" in 
MyApp.

This also causes problems/unexpected behavior with the gui builder. Open myapp.MainFrame and then add 
the "outer.OuterPanel" as a component. This will fail with a component is not a JavaBean.

This problem will cause usability issues for novice NB-IDE users because the error message is misleading (it clearly 
*IS* a JavaBean--so that's not the problem!). The underlying error reported in the logs is a ClassNotFoundException, 
but this information is not propogated to the UI (not that it's particuarly revealing).

I will report a separate bug/enhancement to get more meaningful error messages from the gui builder.

I would expect the following to happen auto-magically for me:
1. Jars for OuterApp and OuterLibrary to be added to MyApp cp and its dist directory. (this works)
2. Dependencies for OuterApp and OuterLibrary to be added to classpath (not happening).
3. Dependencies for OuterApp and OuterLibrary to be added to dist directory (not happening).
4. InnerLibrary being included through the mechanisms decribed in 2 and 3.

If 2 and 3 cannot/should not/will not happen by design, then I would expect the IDE to automatically add explicit 
entries in the Project Properties -> Libraries list for OuterApp, OuterLibrary, Beans Binding, and InnerLibrary (or at 
least WARN me that I need to do this myself!). This is the least desirable result.

The workaround is to manually add all dependencies from OuterLibrary to MyApp (i.e. add InnerLibrary).
Comment 1 jschek 2007-11-09 18:38:57 UTC
Created attachment 52811 [details]
Netbeans Projects
Comment 2 jschek 2007-11-12 16:08:57 UTC
This was reported using:

Product Version: NetBeans IDE 6.0 RC1 (Build 200711080000)
Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b06
System: Windows 2003 version 5.2 running on x86; Cp1252; en_US (nb)
Comment 3 Tomas Zezula 2007-11-14 14:55:45 UTC

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