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.
This is related to memory leak problem in IZ 81985. To fix the memory leak in CompApp Project Ant tasks, we need to declare in-VM tasks to reuse classes loaded by NetBeans. The problem is that when running inside NetBeans, the Ant task picks up the XDM module jar and its declared services. The XDMAccessProvider will cause NPE with readonly models: at org.netbeans.modules.xml.xdm.nodes.XMLSyntaxParser.parse(XMLSyntaxParser.java:46) at org.netbeans.modules.xml.xdm.XDMModel.prepareSync(XDMModel.java:153) at org.netbeans.modules.xml.xdm.XDMModel.sync(XDMModel.java:144) at org.netbeans.modules.xml.xdm.xam.XDMAccess.sync(XDMAccess.java:109) at org.netbeans.modules.xml.xam.AbstractModel.sync(AbstractModel.java:230) at org.netbeans.modules.xml.xam.AbstractModelFactory.getModel(AbstractModelFactory.java:83) at org.netbeans.modules.xml.wsdl.model.WSDLModelFactory.getModel(WSDLModelFactory.java:56) at org.netbeans.modules.compapp.projects.jbi.anttasks.wsdlRepository.getAllWsdlDocumentFormSEJars(wsdlRepository.java:231) at org.netbeans.modules.compapp.projects.jbi.anttasks.wsdlRepository.<init>(wsdlRepository.java:97) at org.netbeans.modules.compapp.projects.jbi.anttasks.BuildServiceAssembly.execute(BuildServiceAssembly.java:227) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) at org.apache.tools.ant.Project.executeTarget(Project.java:1185) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40) at org.apache.tools.ant.Project.executeTargets(Project.java:1068) at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:240) at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:293) at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:131) It works when the XDM is removed from the Ant task's classpath because NetBeans lookup returns: org.netbeans.modules.xml.xam.dom.ReadOnlyAccess instead of: org.netbeans.modules.xml.xdm.xam.XDMAccess Not sure how to work around this now.
Created attachment 34998 [details] patch for hybrid mode
This problem was caused by a design change to the classpath for the ANT task. Previously, the classpath was isolated from the IDE's classpath and the XDM service was not available so the models performed as they would outside the IDE. There was a recent change to resolve a memory leak, where the IDE classpath is not available and thus the XDMModelAccessProvider is on the classpath. The suggested fix is to allow a client to override the default DocumentAccessProvider via the ModelSource lookup. A client which requires read-only access could add the following to the lookup to override the default Model Access Support: org.netbeans.modules.xml.xam.dom.ReadOnlyAccess.Provider.getInstance() The fix to XAM is to look at the current ModelSource's lookup before using the default implementation.
Created attachment 35004 [details] Patch to allow overriding of default access provider
fixed in release55_dev
Good change for added flexibility for model source to tell which model access provider to use. Code looks goods, change would have no effects on existing client code and existing behaviour.
fixed in release55.
jqian: This issue submitted by you is marked as resolved. Since it relates to some source code specifics, QA is unable to verify it. Could you please verify this issue and mark it as verified or reopen it?
Verified.