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.
Product Version: NetBeans IDE Dev (Build 080704) Java: 1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105 System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb) Userdir: /usr/src/nb_all/nbbuild/testuserdir Steps to reproduce: 1) create EJB project 2) add XSD file: New File -> XML -> Purchase Order Sample Schema 3) generate JAXB binding here: new File -> XML -> JAXB binding 4) clean and build EJB project 5) create web project 6) add EJB module to web project classpath: choose library node in project tab and invoke add project item 7) add servlet in web and invoke CC and try to find out some class from JAXB binding e.g. Items, USAAdress ERROR: JAXB classes are not suggested in CC even the classes are in generated jar.
The bug was originally reported on nbusers mailing list: Michal Hlavac wrote: > > > Hello, > > > > > > I created enterprise project. EJB project has JAXB Bindings that > > > generates POJO from xsd. Services are SLSBs. Web module wraps slsb as web > > > services. But here is problem. Web module has dependency on ejb module > > > and it doesn't "see" jaxb generated classes. This is feature or bug?
Has this ever worked? Authors of JAXB support should evaluate. This problem happens for any combination of project types your try. I think the problem is in the way how generated sources are handled - they are in resulting EJB's project jar file but code completion uses (AFAIK) SourceForBinaryQuery which in this case most probably does not return generated sources and that's why there are not shown in CC. Btw. JAXB artifacts are on classpath because compilation of project passes. It is CC which is broken. Milan might know offhand what needs to be fixed as he was implementing generating of source for web services.
Issue is re-appearing in the latest NB builds. See http://www.netbeans.org/issues/show_bug.cgi?id=114164 It used to work. SourceForBinaryQuery has not changed, looks like code completion does not work in second dependent project for any generated classes including JAX-WS/Webservices classes.
*** This issue has been marked as a duplicate of 114164 ***
Re opening, as this issue seems to be not related to Java Library/Java SE Project issue#114164. In Java SE project CompiledSourceForBinaryQuery was modified to support code completion of classes in another project. http://www.netbeans.org/nonav/issues/showattachment.cgi/49391/CompiledSourceForBinaryQuery.diff I am not sure this query is still being used for code completion, as class CompiledSourceForBinaryQuery no longer in the Java SE project module. dkonecny, EJB and Web project owner should answer what changes are needed to support code completion of generated classes which are in another project. Probably Web services client generated classes also have the same issue. Using latest build, created Web services client in EJB project, added EJB project to Web projects library, code completion in Web project could not recognize generated classes.
The question is really on Tomas or somebody from Java infrastructure - which queries need to be implemented so that code completion is happy and shows *generated sources*?
SourceForBinaryQuery, ClassPathProvider, for sources SourceLevelQuery. Also the cp owning the root has to be registered in GlobalPathRegistry. Finally ClassPath.getClassPath(root,ClassPath.SOURCE) has to contain the root.
gmpatil, see issue 141291 which may resolve this problem as well.
Thanks Tomas, David.
Fixes in trunk. Related Change set: http://hg.netbeans.org/main/rev/e2e4200ae253 Related changes: http://hg.netbeans.org/main/diff/e2e4200ae253/xml.jaxb/src/org/netbeans/modules/xml/jaxb/model/JAXBWizLookupProvider.java http://hg.netbeans.org/main/diff/e2e4200ae253/xml.jaxb/src/org/netbeans/modules/xml/jaxb/model/JAXBWizSourceForBinaryQueryImpl.java
Integrated into 'main-golden', available in build *200808051401* on http://bits.netbeans.org/dev/nightly/ Changeset: http://hg.netbeans.org/main/rev/e2e4200ae253 User: Girish Patil<gmpatil@netbeans.org> Log: #131878, #139138. JAXB is compiled using project JDK. Code completion of JAXB generated classes in EJB referencing another EJB project. Migrate NB6.1 JAXB project.