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 134885 - The editor shows "package does not exist" for JAXB-generated code from a different project
Summary: The editor shows "package does not exist" for JAXB-generated code from a diff...
Status: RESOLVED DUPLICATE of bug 111218
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-12 21:14 UTC by wbertel
Modified: 2008-05-13 10:28 UTC (History)
0 users

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 wbertel 2008-05-12 21:14:56 UTC
The editor does not recognize java classfiles generated from JAXB bindings in a different project.

1. Create a new Java project (ProjectA)
2. Create a new JAXB Binding in ProjectA from an existing xml schema file.
3. Build ProjectA.  This will generate the JAXB bindings java code
(ProjectA/build/generated/jaxbCache/BindingsName/my/cool/bindings).
4. Create a new Java project (ProjectB)
5. Add ProjectA as a dependency to ProjectB
5. Create a new Java class (MyClass) in ProjectB
6. In MyClass.java, import your bindings classes (import my.cool.bindings.*;) from ProjectA

The editor annotates the import line saying that the package "does not exist".  It also annotates any lines in MyClass
that use the generated JAXB bindings, saying that it "cannot find symbol".

Note: ProjectB still builds just fine (even with the bad reference hints).

This used to work in NetBeans 6.0 (i.e. the editor would find the referenced bindings classes from the other project).
Comment 1 wbertel 2008-05-12 21:26:19 UTC
1. Copy ProjectA's built jar file (ProjectA/dist/ProjectA.jar) and paste it into a different location (other than its
dist directory)
2. Add the copied jar as a jar dependency to ProjectB

Now when you edit the java classes in ProjectB, the editor will locate the generated java bindings file.
Comment 2 wbertel 2008-05-12 21:27:02 UTC
Also: If you create a java class INSIDE ProjectA (ProjectA/src/...) and import/use your generated binding classes there,
the editor WILL find the generated java classes.  It just doesn't located generated java classes from a different project.
Comment 3 Jiri Prox 2008-05-13 10:28:49 UTC
it duplicate of issue 111218. See the last comments for workaround

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