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.
All project related action are failing test description: -open existing Java SE application -set ant verbosity level to "Debug" -build project -wait 5 seconds -check text in output window - it should contain "BUILD SUCCESSFUL" => expected: test passes actual: test fails in build action with: ... [junit] javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found [junit] at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:113) [junit] at org.apache.tools.ant.util.JAXPUtils.newParserFactory(JAXPUtils.java:120) [junit] at org.apache.tools.ant.util.JAXPUtils.getNSParserFactory(JAXPUtils.java:104) [junit] at org.apache.tools.ant.util.JAXPUtils.getNamespaceXMLReader(JAXPUtils.java:172) [junit] at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:185) [junit] at org.apache.tools.ant.helper.ProjectHelper2.parseUnknownElement(ProjectHelper2.java:86) [junit] at org.apache.tools.ant.module.bridge.impl.NbAntlib.process(NbAntlib.java:73) [junit] at org.apache.tools.ant.module.bridge.impl.BridgeImpl.addCustomDefs(BridgeImpl.java:390) [junit] at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:195) [junit] at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:481) [junit] at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151) ... to reproduce: lukas@ubuntu-m9:/space/hg/main$ cd websvc.kit/ lukas@ubuntu-m9:/space/hg/main/websvc.kit$ ant clean test-qa-functional -Dtest.config=parsers workaround: either run tests with -Djava.endorsed,dirs=/path/to/xerces-2.8.0.jar or put xerces.jar to $JAVA_HOME/jre/endorsed directory
Created attachment 63951 [details] output from the test run
The problem is that javax.xml.parsers.SecuritySupport.getResourceAsStream(null, "META-INF/services/javax.xml.parsers.SAXParserFactory") calls ClassLoader.getSystemResourceAsStream(...) which returns non-null (from the app class loader, which sees ide9/modules/ext/xerces.jar) even though the resulting class (in org.apache.xerces) is invisible to the bootstrap class loader - so newInstance(null, ..., false) is called, and Class.forName(...) correctly throws CNFE.
I am trying to work around in core-main #93f3c3fb63d8. The fix is pretty hacky and I am not comfortable with it but I don't see any better solution.
I had similar problem in NbModuleSuite. Whenever somebody included xerces on classpath, NetBeans refused to start. I did some different tricks in NetBeans DOM and SAX factories. Probably I played with context classloader until I was able to start: http://hg.netbeans.org/core-main/rev/badd42b05bc7
The problem in this case is different, I think. System properties request the factories in core.startup, but these are not visible to the Ant class loader, and they are ignored by JAXP, which falls back to the usual META-INF/services search. The problem here is that the CCL does not delegate to the "system" class loader, i.e. -classpath. (Intentionally - we try to run Ant in a controlled environment.) JAXP is unprepared for this situation.
Thanks, original issue is fixed - I can build, run, deploy etc. all project types now except those which calls ie. wsimport task - ant's output is attached. Should I file a new issue for that or it's enough to just reopen this one (steps to reproduce remain the same - I've updated a test project in #6414769ab162)?
Created attachment 64083 [details] test project's build output
It looks like the same issue, just in a different JAXP package.
Should be generalized in core-main #5a19718c2ad5 to work on all JAXP-related services.
Integrated into 'main-golden', available in NB_Trunk_Production #308 build Changeset: http://hg.netbeans.org/main/rev/93f3c3fb63d8 User: Jesse Glick <jglick@netbeans.org> Log: #139048: work around complex class loading problem in JAXP.
Integrated into 'main-golden', available in NB_Trunk_Production #310 build Changeset: http://hg.netbeans.org/main/rev/5a19718c2ad5 User: Jesse Glick <jglick@netbeans.org> Log: #139048 generalized to all of JAXP, not just the parsers package.
well, tests are fixed but the problem is that ws support in the IDE becomes broken :-( what I mean is that in tests everything works fine but when you run only standalone IDE and create new ws client in java se project then wsimport fails with: ... wsimport-client-MyWebService: C:\NetBeansProjects\JavaApplication2\build\generated\wsimport\client\mywebservice\wsdl is not found and thus excluded from the dependency check parsing WSDL... javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParserFactory not found at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72) at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:176) at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92) at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136) at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.<clinit>(XMLStreamReaderFactory.java:87) at com.sun.xml.ws.api.addressing.WSEndpointReference.<init>(WSEndpointReference.java:166) at com.sun.xml.ws.api.addressing.AddressingVersion.<init>(AddressingVersion.java:436) ... note that MXParserFactory is on the classpath... I'll check whether using some JAXP properties for running tests will help (as discussed with Jarda last week) and will update this issue
To reproduce the issue - please, create rather the WS Client in Web Application. E.g. use this wsdl url : http://www.webservicex.net/CurrencyConvertor.asmx?wsdl Then, the wsimport ant task fails as described by Lukas. (In J2SE problem there is another problem now with missing libraries in wsimport ant task) Note: the problem seems to be reprodicible in jdk1.5 only.
strange things happens... I've reverted #93f3c3fb63d8 in my local workspace and IDE as well as tests seems to be happy, at least on my 1.5.0_16-rev-b03
If I comment out the workaround then I go back to the old behavior - a failure to find Xerces. javax.xml.stream.XMLInputFactory is another case. Here, both the API and the impl are part of jaxws, not the JRE. (Specifically, jsr173_api.jar and sjsxp.jar.) The BEA-designed API uses as a fallback class name a class which is not part of the RI (!), or indeed the NetBeans IDE, so you _have_ to use the version specified in META-INF/services. The FactoryFinder clone also differs from that used in JAXP - it has different logic for finding M-I/s resources. The result is that the workaround for JAXP services does not work for StAX and in fact makes things worse. One fix that appears to work is: if (name.equals("META-INF/services/javax.xml.stream.XMLInputFactory")) { return super.getResourceAsStream(name); } else if (name.startsWith("META-INF/services/javax.xml.")) { // as before... but I am looking for a cleaner fix.
Can't find any better fix so going with the removal of the workaround just for StAX (core-main #8e2336205ff3). Seems to work both in interactive IDE and from your test in both JDK 5 and 6. Note that your test fails even though the build does succeed in the tested IDE; something wrong with your OW capture operator, perhaps.
Integrated into 'main-golden', available in NB_Trunk_Production #324 build Changeset: http://hg.netbeans.org/main/rev/8e2336205ff3 User: Jesse Glick <jglick@netbeans.org> Log: Disabling #139048 fix for StAX.
We've got a different error when running wsimport (JAX_WS 2.1) in J2SEProject. See the attachment. This is related somehow to this fix in org.apache.tools.ant.module.bridge.AntBridge.
Created attachment 65152 [details] Error from wsimport
One important note: This only happens with jdk1.6 (update 10), not jdk1.5.
I am sorry. The issue 140966 was likely caused by incorrect JAXB separation from JAX-WS.
*** Issue 141158 has been marked as a duplicate of this issue. ***
*** Issue 140876 has been marked as a duplicate of this issue. ***