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.
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.
What version/build number of Netbeans are you using?
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).
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.
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
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.
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.
What you need is to implement ClassPathProvider providing classpath (BOOT, COMPILE, SOURCE) for your source root and register it in desired lookup merger.
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()
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.
The implementation is in websvc/core : org.netbeans.modules.websvc.core.jaxws.projects.JaxWsArtifactsClassPathProvider
Sure, I will try the suggestions.
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