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 139138 - JAXB artifacts of projA are not shown in code completion of projB
Summary: JAXB artifacts of projA are not shown in code completion of projB
Status: RESOLVED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: JAXB (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: _ gmpatil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-07 14:01 UTC by Petr Blaha
Modified: 2008-09-23 10:21 UTC (History)
6 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 Petr Blaha 2008-07-07 14:01:17 UTC
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.
Comment 1 Petr Blaha 2008-07-07 14:02:18 UTC
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?
Comment 2 David Konecny 2008-07-07 22:15:45 UTC
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.
Comment 3 _ gmpatil 2008-07-09 07:01:26 UTC
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.
Comment 4 _ gmpatil 2008-07-24 00:41:31 UTC

*** This issue has been marked as a duplicate of 114164 ***
Comment 5 _ gmpatil 2008-07-24 03:03:52 UTC
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.

Comment 6 David Konecny 2008-07-24 03:53:45 UTC
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*? 
Comment 7 Tomas Zezula 2008-07-24 07:40:17 UTC
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.


Comment 8 David Konecny 2008-07-25 01:36:28 UTC
gmpatil, see issue 141291 which may resolve this problem as well.
Comment 9 _ gmpatil 2008-07-25 18:29:02 UTC
Thanks Tomas, David. 
Comment 11 Quality Engineering 2008-08-05 16:29:40 UTC
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.