Tomcat服务器调用webservice的奇怪错误

近期项目运行时发现使用tomcat 5.5发布的webservice(xfire的) 出现如下错误

 

javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl could not be instantiated: java.lang.NullPointerException
	javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
	org.codehaus.xfire.wsdl11.builder.SchemaSerializer.writeXml(SchemaSerializer.java:46)
	org.codehaus.xfire.wsdl11.builder.SchemaSerializer.marshall(SchemaSerializer.java:35)
	com.ibm.wsdl.xml.WSDLWriterImpl.printExtensibilityElements(Unknown Source)
	com.ibm.wsdl.xml.WSDLWriterImpl.printTypes(Unknown Source)
	com.ibm.wsdl.xml.WSDLWriterImpl.printDefinition(Unknown Source)
	com.ibm.wsdl.xml.WSDLWriterImpl.writeWSDL(Unknown Source)
	com.ibm.wsdl.xml.WSDLWriterImpl.writeWSDL(Unknown Source)
	org.codehaus.xfire.wsdl11.builder.WSDLBuilder.write(WSDLBuilder.java:182)
	org.codehaus.xfire.wsdl11.builder.WSDLBuilderAdapter.write(WSDLBuilderAdapter.java:40)
	org.codehaus.xfire.DefaultXFire.generateWSDL(DefaultXFire.java:104)
	org.codehaus.xfire.transport.http.XFireServletController.generateWSDL(XFireServletController.java:380)
	org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:125)
	org.codehaus.xfire.transport.http.XFireServlet.doGet(XFireServlet.java:107)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
google 一下发现
 
  

jdktomcat之间的关于TransformerFactoryImpl类的冲突造成。

简单解决办法:

删除Tomcat\common\endorsed下的类包,使程序使用jdk的类包。

你可能感兴趣的:(Webservice)