about 3 years ago

如果你跟我一樣手賤更新了JDK8,那你要CXF產生webservice程式碼的時候就會跟我一樣GG

Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
wsdl2java -d D:\workspace_test\cxfserver\secomms.cxftmp/src -classdir D:\workspace_test\cxfserver\secomms\build\classes -p http://webservice.mobile.secom.com/service=com.secom.mobile.webservice.service -impl -validate -exsh false -dns true -dex true -wsdlLocation file:/D:/workspace_test/cxfserver/secomms/WebContent/WEB-INF/wsdl/SECOM101Service.wsdl -verbose -defaultValues -fe jaxws -db jaxb -wv 1.1 file:/D:/workspace_test/cxfserver/secomms/WebContent/WEB-INF/wsdl/SECOM101Service.wsdl
wsdl2java - Apache CXF 2.7.11

Exception in thread "main" java.lang.AssertionError: org.xml.sax.SAXParseException; systemId: jar:file:/D:/IDE/cxf/apache-cxf-2.7.11/lib/jaxb-xjc-2.2.6.jar!/com/sun/tools/xjc/reader/xmlschema/bindinfo/binding.xsd; lineNumber: 52; columnNumber: 88; schema_reference: �L�kŪ�����n��� 'xjc.xsd'�A�]�� accessExternalSchema �ݩʳ]�w������A�ҥH�����\ 'file' �s���C
at com.sun.tools.xjc.SchemaCache.newValidator(SchemaCache.java:80)
at com.sun.tools.xjc.reader.xmlschema.bindinfo.AnnotationParserFactoryImpl$1$1.startElement(AnnotationParserFactoryImpl.java:118)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.startElement(NGCCRuntime.java:253)
at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:551)
at com.sun.tools.xjc.util.SubtreeCutter.startElement(SubtreeCutter.java:108)
...
解決方法就是在你JDK8目錄下jdk1.8.0_05\jre\lib\ 這個位置新增一個檔案jaxp.properties
內容如下
javax.xml.accessExternalSchema = all
當然eclipse也要設定指定是JDK路徑


再去執行就正常了

← Spring 注入 List Map 方法 Spring啟動後執行指定功能 →
 
comments powered by Disqus