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 117698 - JAXB Generated code is not properly recognized between projects
Summary: JAXB Generated code is not properly recognized between projects
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: _ gmpatil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-03 21:04 UTC by lh32469
Modified: 2007-10-14 18:34 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lh32469 2007-10-03 21:04:20 UTC
Reproduction steps:

1. Create a Java Class Library Application Project "Foo"
2. Create a new JAXB Binding bound to XML Schema and generate package "jaxb.demo" classes
3. Build Java Class Library Application "Foo"

4. Create a new Java Application Project "Bar"
5. Select Libraries -> Add Project and add project "Foo" from step 1
6. Create a new Java Class in Project "Bar"
7. In newly created Java Class, import "jaxb.demo.*"
8. Notice that red underline and dot appear next to entry.
9. Compile newly created Java Class and notice that it compiles successfully even with red annotations.

The editor in the case of project "Bar" is unable to recognize that the jar file 
from project "Foo" contains the "jaxb.demo" package and classes.  Even after
successful compilation, the red underline and dot remains.
Comment 1 Vitezslav Stejskal 2007-10-05 11:03:03 UTC
What version/build number of Netbeans are you using?
Comment 2 Jan Lahoda 2007-10-08 09:35:42 UTC
Seems that the "generated/addons/jaxb" source root does not have a bootclasspath (in Files tab, when I select a Java
file from the source root and open Properties of it, it does not have any bootclasspath). Java infrastructure ignores
source roots without classpath, as it cannot process them correctly (would not find j.l.Object in this case).
Comment 3 _ gmpatil 2007-10-09 00:16:39 UTC
Looks like duplicate of http://www.netbeans.org/issues/show_bug.cgi?id=114164 .
Above one was fixed on Sept 26th build. Please verify using the latest build.
Comment 4 lh32469 2007-10-10 04:48:51 UTC
I got the same results as below with nightly build 

Product Version: NetBeans IDE Dev (Build 200710090000)
Java: 1.5.0_10; Java HotSpot(TM) Client VM 1.5.0_10-b03
System: Linux version 2.6.15-28-386 running on i386; UTF-8; en_US (nb)
Userdir: /Users/lh32469/.netbeans/dev
Comment 5 _ gmpatil 2007-10-10 20:37:01 UTC
I am able to simulate using the latest builds.
Looks like something got changed in Java infrastructure, fix #114164 no longer effective.

Need Java infrastructure expert help.

jlahoda, 
Using build NetBeans IDE Dev (Build 200710101602), I am able to see 'bootclasspath' property populated.




Comment 6 Jan Lahoda 2007-10-10 20:46:51 UTC
Yes, well, sorry, I looked at incorrect line. The source classpath is null, not boot classpath (unfortunately, source
classpath is not in the Properties dialog in the production build). Anyway, Milan so doing some ClasspathProvider that
provides source classpath for a different generated source root, so he should be able to help.
Comment 7 Tomas Zezula 2007-10-12 11:05:08 UTC
What you need is to implement ClassPathProvider providing classpath (BOOT, COMPILE, SOURCE) for your source root and
register it in desired lookup merger.
Comment 8 Milan Kuchtiak 2007-10-12 12:28:29 UTC
I am not sure the implementation of ClassPathProvider for generated files will help, in case of CC.
I think, you should also add the url of your jaxb folder to
org.netbeans.modules.java.j2seproject.classpath.SourcePathImplementation:getResources()
Comment 9 Tomas Zezula 2007-10-12 12:38:50 UTC
I believe that it is already there SourcePathImlementation ver 1.14 integrated by gmpatil.
The only missing step is  to provide classpath for the root which can be done as I've described above.
Milan can point you to his implementation of ClassPathProvider + registraton which should be very similar to what you
need, only the path differs.
Comment 10 Milan Kuchtiak 2007-10-12 12:54:27 UTC
The implementation is in websvc/core :
org.netbeans.modules.websvc.core.jaxws.projects.JaxWsArtifactsClassPathProvider
Comment 11 _ gmpatil 2007-10-12 16:14:46 UTC
Sure, I will try the suggestions.
Comment 12 _ gmpatil 2007-10-14 18:34:26 UTC
I have checked-in the fix to the trunk, missed release60_beta2 branch.
Implemented Classpath provider and registered using lookup merger, similar to Web Services. 

Changed files.
http://xml.netbeans.org/source/browse/xml/jaxb/src/org/netbeans/modules/xml/jaxb/model/JAXBWizLookupProvider.java?r1=1.2&r2=1.3
http://xml.netbeans.org/source/browse/xml/jaxb/src/org/netbeans/modules/xml/jaxb/model/JAXBGenSourceClassPathProvider.java?rev=1.1&content-type=text/vnd.viewcvs-markup