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 193879 - Creating "EJB Module from existing sources" creates broken project.properties
Summary: Creating "EJB Module from existing sources" creates broken project.properties
Status: RESOLVED WONTFIX
Alias: None
Product: xml
Classification: Unclassified
Component: JAXB (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-28 13:20 UTC by kleiner77
Modified: 2015-09-17 13:17 UTC (History)
1 user (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 kleiner77 2010-12-28 13:20:40 UTC
When I create a new Java Project of type Java EE -> EJB Module, the created nbproject/project.properties contains a line like "source.root=src".

When I have appropriate sources for an EJB Module (but no NetBeans project), I use New -> Java EE -> EJB Module with Existing Sources instead. In this case, the structure of the created project.properties is a little bit different, and the most important fact is that "source.root=" is not defined.

This difference does not harm the normal project management features of NetBeans (so most users will never notice the difference).

But I have tried to create a new JAXB Binding (New -> XML -> JAXB Bindung) in this project, which always failed due to problems when loading the given XSD schema file. 

After hours of debugging I found that the JAXBWizardIterator uses org/netbeans/modules/xml/jaxb/util/ProjectHelper.java for relative path calculations, and the ProjectHelper calls 

  getProperty(prj, AntProjectHelper.PROJECT_PROPERTIES_PATH, PROP_SRC_ROOT)

which is in fact 

  getProperty(prj, "nbproject/project.properties", "source.root")

Because the JAXBWizard does not expect this property to be missing, this finally results in a NPE, and the JAXBWizard will not create the binding.


Maybe this can be fixed in the JAXBWizard, but I am not sure whether or not other NetBeans feature also expect an entry "source.root" in the project.properties, so I guess this issue is better fixed when creating a new EJB Module with Existing Sources.
Comment 1 David Konecny 2011-01-05 22:04:05 UTC
Thanks for debugging this! makes my life easier. :-)

The problem is in JAXBWizardIterator - it should not assume that 'source.root' will always exist.

I could fix EJB With Existing Sources wizard to initialize that property to some non empty value but looking at the code it would artificial as that property would not be used. It is used in case EJB project is created from scratch and in such case if points to the root folder which will contains sources folder and configuration folder etc. But even in that case it is more or less redundant property which could be removed completely.
Comment 2 Denis Anisimov 2011-01-11 09:30:33 UTC
Wrong product. This functionality has no relation to Web Services JAXB.
Comment 3 Martin Balin 2015-09-17 13:17:08 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.