我们项目现在使用Metro 1.4做为我们的Web Services中间件,因为安全原因,我们需要打开Metro的SchemaValidation自动验证功能,但是当我们打开了SchemaValidation的功能之后,Jboss启动时在验证WSDL文件的时候就会报这个错误。而我可以肯定我们的WSDL文件是正确无误的,本身此WSDL文件也是Metro自动生成出来的。Google上搜到说由于JAXP自身的bug有可能导致这个错误,如果将JRE升到1.6之后就会解决这个问题,但是我现在使用JDK 1.6u17照样还是会有此问题,不知各位有没有碰到过这个问题。我们的环境: Windows XP, Jboss 4.0.5GA, JDK1.6u17, Metro 1.4 (1.5也有同样问题)Exception:
00:11:21,453 ERROR [STDERR] May 3, 2010 12:11:21 AM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized
SEVERE: WSSERVLET11: failed to parse runtime descriptor: javax.xml.ws.WebServiceException: org.xml.sax.SAXParseException: s4s-att-invalid-value: Invalid attribute value for 'type' in element 'element'. Recorded reason: UndeclaredPrefix: Cannot resolve 'fns:SFWebServiceFaultException' as a QName: the prefix 'fns' is not declared.
javax.xml.ws.WebServiceException: org.xml.sax.SAXParseException: s4s-att-invalid-value: Invalid attribute value for 'type' in element 'element'. Recorded reason: UndeclaredPrefix: Cannot resolve 'fns:SFWebServiceFaultException' as a QName: the prefix 'fns' is not declared.

解决方案 »

  1.   

    更详细的exceptionCaused by: org.xml.sax.SAXParseException: s4s-att-invalid-value: Invalid attribute value for 'type' in element 'element'. Recorded reason: UndeclaredPrefix: Cannot resolve 'fns:SFWebServiceFaultException' as a QName: the prefix 'fns' is not declared.
            at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
            at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
            at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
            at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
            at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
            at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source)
            at org.apache.xerces.impl.xs.traversers.XSAttributeChecker.reportSchemaError(Unknown Source)
            at org.apache.xerces.impl.xs.traversers.XSAttributeChecker.checkAttributes(Unknown Source)
            at org.apache.xerces.impl.xs.traversers.XSAttributeChecker.checkAttributes(Unknown Source)
            at org.apache.xerces.impl.xs.traversers.XSDElementTraverser.traverseGlobal(Unknown Source)
            at org.apache.xerces.impl.xs.traversers.XSDHandler.traverseSchemas(Unknown Source)
            at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
            at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source)
            at com.sun.xml.ws.server.ServerSchemaValidationTube.<init>(ServerSchemaValidationTube.java:67)
            ... 147 more