헤르메스 LIFE

[Exception] java.lang.AssertionError: org.xml.sax.SAXParseException; systemId: jar:file:/C:/apache/cxf-2.7.18/lib/jaxb-xjc-2.2.6.jar!/com/sun/tools/xjc/reader/xmlschema/bindinfo/binding.xsd; 본문

Exception

[Exception] java.lang.AssertionError: org.xml.sax.SAXParseException; systemId: jar:file:/C:/apache/cxf-2.7.18/lib/jaxb-xjc-2.2.6.jar!/com/sun/tools/xjc/reader/xmlschema/bindinfo/binding.xsd;

헤르메스의날개 2016. 8. 26. 10:27
728x90


개발환경

cxf 2.7.18


시나리오.

cxf 2.7.18을 이용해서 SOAP 을 이용한 Web Service 환경을 구축하는게 목표입니다.

Server는 정상적으로 동작합니다.

Server에서 생성된 wsdl 파일에 의해 Client Source를 생성하기 위해 wsdl2java를 사용하기로 했습니다.


소스 생성 중 아래와 같은 오류가 발생했습니다.


Exception in thread "main" java.lang.AssertionError: org.xml.sax.SAXParseException; systemId: jar:file:/C:/apache/cxf-2.7.18/lib/jaxb-xjc-2.2.6.jar!/com/sun/tools/xjc/reader/xmlschema/bindinfo/binding.xsd; lineNumber: 52; columnNumber: 88; schema_reference: accessExternalSchema �Ӽ����� ������ �������� ���� 'file' �׼����� ������ �����Ƿ� ��Ű�� ���� 'xjc.xsd' �б⸦ �����߽��ϴ�. 



출처 : http://webkebi.zany.kr:9003/board/bView.asp?bCode=52299899&aCode=13368


관련링크01
http://stackoverflow.com/questions/23011547/webservice-client-generation-error-with-jdk8 

관련링크02

http://cxf.apache.org/docs/wsdl-to-java.html 
------------------------------------------------------------------------------
Webservice client generation error...
http://stackoverflow.com/questions/23011547/webservice-client-generation-error-with-jdk8
------------------------------------------------------------------------------


$ wsdl2java \
-verbose -client -defaultValues \
-impl -validate \
-encoding UTF-8 \
-fe jaxws21 \
-p stub \
-wsdlLocation http://localhost:8080/services/contentStoreCxf?wsdl \
contentStore.wsdl


- 한글...
Exception in thread "main" java.lang.AssertionError: org.xml.sax.SAXParseException;
systemId: jar:file:/Zany/DevTools/apache-cxf-2.7.18/lib/jaxb-xjc-2.2.6.jar!/com/sun/tools/xjc/reader/xmlschema/bindinfo/binding.xsd;
lineNumber: 52; columnNumber: 88; schema_reference:
accessExternalSchema 속성으로 설정된 제한으로 인해 'file' 액세스가 허용되지 않으므로 스키마 문서 'xjc.xsd' 읽기를
실패했습니다.

Caused by: org.xml.sax.SAXParseException;
systemId: jar:file:/Zany/DevTools/apache-cxf-2.7.18/lib/jaxb-xjc-2.2.6.jar!/com/sun/tools/xjc/reader/xmlschema/bindinfo/binding.xsd;
lineNumber: 52; columnNumber: 88; schema_reference:
accessExternalSchema 속성으로 설정된 제한으로 인해 'file' 액세스가 허용되지 않으므로 스키마 문서 'xjc.xsd' 읽기를
실패했습니다.



- 영문...
java.lang.AssertionError: org.xml.sax.SAXParseException;
systemId: jar:file:/path/to/glassfish/modules/jaxb-osgi.jar!/com/sun/tools/xjc/reader/xmlschema/bindinfo/binding.xsd;
lineNumber: 52; columnNumber: 88; schema_reference:
Failed to read schema document 'xjc.xsd', because 'file' access is not allowed due to restriction
set by the accessExternalSchema property.


- JDK 8
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)



외부 스키마 엑세스 권한이 없어서 발생하는 문제로, 링크된 stackoverflow 와 Oracle JDK javax.xml.XMLConstants 공식
문서에 따르면, $JAVA_HOME/lib/jaxp.properties 파일에(없으면 만들어서) javax.xml.accessExternalSchema = all
과 같이 명시해주면 된다고 함.

실제로 해당 properties 파일을 만들어서 생성해보니 문제없이 생성됨.
$JAVA_HOME/lib/jaxp.properties 에 넣어서 안되면,
$JAVA_HOME/jre/lib/jaxp.properties 로 만들면 됨...



사실 Eclipse를 이용해서 작업을 하다 발생한 오류인지라..

아직 해결이 안되네요..


command 창에서 실행 했을 때는 되느군요...








728x90