IBM Support

Generate Java gives "Failed to read external schema..." error

Troubleshooting


Problem

In IBM® Rational® Software Architect Designer for WebSphere (RSAD4WS), when you try to generate Java from an XML Schema Definition (XSD), the generation of the Java code terminates with the following error message: Failed to read external schema document "jar:file:/path_to_websphere_90/xjc.xsd", because "jar" access is not allowed.

(Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates.)

Symptom

The following steps reproduce the error:
  1. Launch RSAD4WS
  2. Load your workspace that contains the project with the XSD file
  3. Locate the XSD file in the Project Explorer
  4. Select Generate > Java from the popup menu
  5. RESULT: The Generation Result for Xjc: The Xjc tool has completed Web service artifact generation. Review the tool output for details, including errors and warnings error appears as in the following screen capture:
image 11875

The following is the error output contained in the screen capture:

parsing a schema...  
java.lang.reflect.InvocationTargetException
  	at sun.reflect.NativeMethodAccessorImpl.invoke0
(Native Method)
  	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:90)
  	at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:55)
  	at java.lang.reflect.Method.invoke(Method.java:508)
  	at com.ibm.ws.bootstrap.WSLauncher.main
(WSLauncher.java:281)
  Caused by: java.lang.AssertionError: org.xml.sax.
AXParseException: Failed to read external schema document
 "jar:file:/C:/IBM/WebSphere90/AppServer/plugins/
com.ibm.jaxb.tools.jar!/com/ibm/jtc/jax/tools/xjc/reader/
xmlschema/bindinfo/xjc.xsd", 
because "jar" access is not allowed.
  	at com.ibm.jtc.jax.tools.xjc.SchemaCache.newValidator
(SchemaCache.java:82)
  	at com.ibm.jtc.jax.tools.xjc.reader.xmlschema.bindinfo.
AnnotationParserFactoryImpl$1$1.startElement
(AnnotationParserFactoryImpl.
java:118)
  	at com.ibm.jtc.jax.xml.xsom.impl.parser.state.
NGCCRuntime.startElement(NGCCRuntime.java:253)
  	at org.xml.sax.helpers.XMLFilterImpl.
startElement(Unknown Source)
  	at com.ibm.jtc.jax.tools.xjc.util.
SubtreeCutter.startElement(SubtreeCutter.java:108)
  	at com.ibm.jtc.jax.tools.xjc.reader.
ExtensionBindingChecker.startElement
(ExtensionBindingChecker.java:150)
  	at org.xml.sax.helpers.XMLFilterImpl.
startElement(Unknown Source)
  	at com.ibm.jtc.jax.tools.xjc.reader.xmlschema.
parser.IncorrectNamespaceURIChecker.startElement
(IncorrectNamespaceURIChecker.
java:128)
  	at org.xml.sax.helpers.XMLFilterImpl.
startElement(Unknown Source)
  	at com.ibm.jtc.jax.tools.xjc.reader.xmlschema.parser.
CustomizationContextChecker.startElement
(CustomizationContextChecker.
java:193)
  	at org.xml.sax.helpers.XMLFilterImpl.startElement
(Unknown Source)
  	at com.ibm.jtc.jax.tools.xjc.reader.internalizer.
DOMForestScanner$LocationResolver.startElement
(DOMForestScanner.java:147)
  	at com.ibm.jtc.jax.xml.bind.unmarshaller.
DOMScanner.visit(DOMScanner.java:244)
  	at com.ibm.jtc.jax.xml.bind.unmarshaller.
DOMScanner.visit(DOMScanner.java:281)
  	at com.ibm.jtc.jax.xml.bind.unmarshaller.
DOMScanner.visit(DOMScanner.java:250)
  	at com.ibm.jtc.jax.xml.bind.unmarshaller.
DOMScanner.visit(DOMScanner.java:281)
  	at com.ibm.jtc.jax.xml.bind.unmarshaller.
DOMScanner.visit(DOMScanner.java:250)
  	at com.ibm.jtc.jax.xml.bind.unmarshaller.
DOMScanner.visit(DOMScanner.java:281)
  	at com.ibm.jtc.jax.xml.bind.unmarshaller.
DOMScanner.visit(DOMScanner.java:250)
  	at com.ibm.jtc.jax.xml.bind.unmarshaller.
DOMScanner.scan(DOMScanner.java:127)
  	at com.ibm.jtc.jax.tools.xjc.reader.internalizer.
DOMForestScanner.scan(DOMForestScanner.java:92)
  	at com.ibm.jtc.jax.tools.xjc.reader.internalizer.
DOMForestScanner.scan(DOMForestScanner.java:100)
  	at com.ibm.jtc.jax.tools.xjc.reader.internalizer.
DOMForestParser.parse(DOMForestParser.java:104)
  	at com.ibm.jtc.jax.tools.xjc.ModelLoader
$XMLSchemaParser.parse(ModelLoader.java:269)
  	at com.ibm.jtc.jax.xml.xsom.impl.parser.
NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:347)
  	at com.ibm.jtc.jax.xml.xsom.impl.parser.
NGCCRuntimeEx.importSchema(NGCCRuntimeEx.java:258)
  	at com.ibm.jtc.jax.xml.xsom.impl.parser.
state.importDecl.action0(importDecl.java:85)
  	at com.ibm.jtc.jax.xml.xsom.impl.parser.
state.importDecl.leaveElement(importDecl.java:201)
  	at com.ibm.jtc.jax.xml.xsom.impl.parser.
state.NGCCRuntime.endElement(NGCCRuntime.java:314)
  	at org.xml.sax.helpers.XMLFilterImpl.
endElement(Unknown Source)
  	at com.ibm.jtc.jax.tools.xjc.util.SubtreeCutter.
endElement(SubtreeCutter.java:112)
  	at org.xml.sax.helpers.XMLFilterImpl.
endElement(Unknown Source)
  	at org.xml.sax.helpers.XMLFilterImpl.
endElement(Unknown Source)
  	at com.ibm.jtc.jax.tools.xjc.reader.xmlschema.
parser.CustomizationContextChecker.endElement
(CustomizationContextChecker.java:199)
  	at org.xml.sax.helpers.XMLFilterImpl.
endElement(Unknown Source)
  	at com.ibm.jtc.jax.tools.xjc.reader.internalizer.
DOMForestScanner$LocationResolver.endElement
(DOMForestScanner.java:140)
  	at com.ibm.jtc.jax.xml.bind.unmarshaller.
DOMScanner.visit(DOMScanner.java:255)
  	at com.ibm.jtc.jax.xml.bind.unmarshaller.
DOMScanner.visit(DOMScanner.java:281)
  	at com.ibm.jtc.jax.xml.bind.unmarshaller.
DOMScanner.visit(DOMScanner.java:250)
  	at com.ibm.jtc.jax.xml.bind.unmarshaller.
DOMScanner.scan(DOMScanner.java:127)
  	at com.ibm.jtc.jax.tools.xjc.reader.
internalizer.DOMForestScanner.scan(DOMForestScanner.java:92)
  	at com.ibm.jtc.jax.tools.xjc.reader.
internalizer.DOMForestScanner.scan(DOMForestScanner.java:100)
  	at com.ibm.jtc.jax.tools.xjc.reader.
internalizer.DOMForestParser.parse(DOMForestParser.java:104)
  	at com.ibm.jtc.jax.tools.xjc.ModelLoader
$XMLSchemaParser.parse(ModelLoader.java:269)
  	at com.ibm.jtc.jax.xml.xsom.impl.parser.
NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:347)
  	at com.ibm.jtc.jax.xml.xsom.impl.parser.
ParserContext.parse(ParserContext.java:128)
  	at com.ibm.jtc.jax.xml.xsom.parser.
XSOMParser.parse(XSOMParser.java:171)
  	at com.ibm.jtc.jax.xml.xsom.parser.
XSOMParser.parse(XSOMParser.java:160)
  	at com.ibm.jtc.jax.tools.xjc.ModelLoader.
createXSOM(ModelLoader.java:534)
  	at com.ibm.jtc.jax.tools.xjc.ModelLoader.
loadXMLSchema(ModelLoader.java:378)
  	at com.ibm.jtc.jax.tools.xjc.ModelLoader.
load(ModelLoader.java:174)
  	at com.ibm.jtc.jax.tools.xjc.ModelLoader.
load(ModelLoader.java:119)
  	at com.ibm.jtc.jax.tools.xjc.Driver.run(Driver.java:333)
  	at com.ibm.jtc.jax.tools.xjc.Driver.run(Driver.java:200)
  	at com.ibm.jtc.jax.tools.xjc.Driver._main(Driver.java:123)
  	at com.ibm.jtc.jax.tools.xjc.Driver.access$000(Driver.java:80)
  	at com.ibm.jtc.jax.tools.xjc.Driver$1.run(Driver.java:103)
  Caused by: org.xml.sax.SAXParseException: 	

Document Location

Worldwide


[{"Type":"MASTER","Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSYK2S","label":"Rational Software Architect Designer"},"ARM Category":[{"code":"a8m3p000000Go90AAC","label":"Rational Software Architect-\u003ETransformation-\u003EJava-to-UML"}],"ARM Case Number":"TS006766324","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

More support for:
Rational Software Architect Designer

Component:
Rational Software Architect->Transformation->Java-to-UML

Software version:
All Versions

Document number:
6507709

Modified date:
11 November 2021

UID

ibm16507709

Manage My Notification Subscriptions