title: Problem with NetBeans Web Service Client when xercesImpl.jar is on classpath
body: <p>I am unable to create a Web Service Client in my NetBeans Web Application when xercesImpl.jar is included as a library.</p>
  
  <p>Using NetBeans 6.9 and GlassFish 3.0.1:</p>
  
  <p>1.) Create new Web Application<br>
  2.) Create a new Web Service<br>
  3.) Add a new operation to the created web service (just let it return null - the implementation isn't important)<br>
  4.) Deploy web service to GlassFish (works fine)<br>
  5.) Add <a href="http://xerces.apache.org/mirrors.cgi" rel="noreferrer">xercesImpl.jar</a> (I'm using version 2.9.1) as a library to the web service (I need xerces for a third-party library that I'm using)<br>
  6.) Stop Glassfish.<br>
  7.) Clean and Build the project.<br>
  8.) Run the project. Test that the Web Service still works (it does).<br>
  9.) Create a new Web Service Client. Point it at a WSDL (I'm using <a href="http://www.webservicex.com/CurrencyConvertor.asmx?wsdl" rel="noreferrer">http://www.webservicex.com/CurrencyConvertor.asmx?wsdl</a> just as a test).<br>
  10.) Stop Glassfish.<br>
  11.) Clean and Build the project.</p>
  
  <p>Error message is shown:</p>
  
  <blockquote>
    <p>C:\NetBeansProjects\WSTest\nbproject\jaxws-build.xml:43:
    Error starting wsimport:  BUILD FAILED
    (total time: 1 second)</p>
  </blockquote>
  
  <p>Line 43 is:</p>
  
  <pre><code>&lt;wsimport sourcedestdir="${build.generated.dir}/jax-wsCache/CurrencyConvertor" 
  destdir="${build.generated.dir}/jax-wsCache/CurrencyConvertor" wsdl=
  "${basedir}/${conf-dir}xml-resources/web-service-references/
  CurrencyConvertor/wsdl/www.webservicex.com/CurrencyConvertor.asmx.wsdl"
  catalog="catalog.xml" extension="true" verbose="true"
  wsdlLocation="http://www.webservicex.com/CurrencyConvertor.asmx?wsdl" 
  xnocompile="true" xendorsed="true"&gt;
  </code></pre>
  
  <p>12.) Restart NetBeans.<br>
  13.) Clean and Build the project. (The build now works)<br>
  14.) Run the project. GlassFish starts up fine except for this one-line error message:</p>
  
  <blockquote>
    <p>SEVERE: Error in resolving the catalog</p>
  </blockquote>
  
  <p>15.) Loading the Web Service Tester page produces the following exception in the GlassFish log:</p>
  
  <pre><code>WARNING: Servlet web service endpoint 'NewWebService' failure
  java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration], because it has not yet been started, or was already stopped
  at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2085)
  at org.glassfish.web.loader.WebappClassLoader.findResource(WebappClassLoader.java:1018)
  at org.glassfish.web.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1255)
  at org.apache.xerces.parsers.SecuritySupport$6.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at org.apache.xerces.parsers.SecuritySupport.getResourceAsStream(Unknown Source)
  at org.apache.xerces.parsers.ObjectFactory.findJarServiceProvider(Unknown Source)
  at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
  at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
  at org.apache.xerces.parsers.SAXParser.&lt;init&gt;(Unknown Source)
  at org.apache.xerces.parsers.SAXParser.&lt;init&gt;(Unknown Source)
  at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.&lt;init&gt;(Unknown Source)
  at org.apache.xerces.jaxp.SAXParserImpl.&lt;init&gt;(Unknown Source)
  at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
  at com.sun.org.apache.xml.internal.resolver.readers.SAXCatalogReader.readCatalog(SAXCatalogReader.java:238)
  at com.sun.org.apache.xml.internal.resolver.Catalog.parseCatalog(Catalog.java:680)
  at com.sun.xml.ws.util.xml.XmlUtil.createEntityResolver(XmlUtil.java:270)
  at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:560)
  at org.glassfish.webservices.JAXWSServlet.registerEndpoint(JAXWSServlet.java:405)
  at org.glassfish.webservices.JAXWSServlet.doInit(JAXWSServlet.java:264)
  at org.glassfish.webservices.JAXWSServlet.init(JAXWSServlet.java:99)
  at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1428)
  at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1060)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:187)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
  at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
  at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
  at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
  at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
  at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
  at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
  at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
  at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
  at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
  at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
  at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
  at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
  at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
  at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
  at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
  at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
  at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
  at java.lang.Thread.run(Thread.java:619)
  
  WARNING: StandardWrapperValve[NewWebService]: PWC1382: Allocate exception for servlet NewWebService
  javax.servlet.ServletException
  at org.glassfish.webservices.JAXWSServlet.doInit(JAXWSServlet.java:271)
  at org.glassfish.webservices.JAXWSServlet.init(JAXWSServlet.java:99)
  at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1428)
  at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1060)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:187)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
  at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
  at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
  at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
  at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
  at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
  at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
  at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
  at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
  at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
  at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
  at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
  at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
  at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
  at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
  at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
  at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
  at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
  at java.lang.Thread.run(Thread.java:619)
  Caused by: java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration], because it has not yet been started, or was already stopped
  at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2085)
  at org.glassfish.web.loader.WebappClassLoader.findResource(WebappClassLoader.java:1018)
  at org.glassfish.web.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1255)
  at org.apache.xerces.parsers.SecuritySupport$6.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at org.apache.xerces.parsers.SecuritySupport.getResourceAsStream(Unknown Source)
  at org.apache.xerces.parsers.ObjectFactory.findJarServiceProvider(Unknown Source)
  at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
  at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
  at org.apache.xerces.parsers.SAXParser.&lt;init&gt;(Unknown Source)
  at org.apache.xerces.parsers.SAXParser.&lt;init&gt;(Unknown Source)
  at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.&lt;init&gt;(Unknown Source)
  at org.apache.xerces.jaxp.SAXParserImpl.&lt;init&gt;(Unknown Source)
  at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
  at com.sun.org.apache.xml.internal.resolver.readers.SAXCatalogReader.readCatalog(SAXCatalogReader.java:238)
  at com.sun.org.apache.xml.internal.resolver.Catalog.parseCatalog(Catalog.java:680)
  at com.sun.xml.ws.util.xml.XmlUtil.createEntityResolver(XmlUtil.java:270)
  at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:560)
  at org.glassfish.webservices.JAXWSServlet.registerEndpoint(JAXWSServlet.java:405)
  at org.glassfish.webservices.JAXWSServlet.doInit(JAXWSServlet.java:264)
  ... 26 more
  </code></pre>
  
  <p>Any ideas on what I can do to fix this? Note that it only happens after I create a new Web Service Client/Reference. Even if someone could suggest which project I should be creating a bug against (i.e. is it a NetBeans fault? A Glassfish fault? A JAX-WS fault? etc.), that would be good.</p>