Unable to add selected document to the project. null in Studio when uploading XML schemas included in a WSDL

Technote (troubleshooting)


Problem(Abstract)

When importing a WSDL document into WebSphere Cast Iron Studio, the 'Uploading Included XML Schemas' dialog will appear if the WSDL includes one or more XML schema documents. After browsing to all the included schemas on the file system you click OK to start the full import and validation of the WSDL. However, in certain situations, you may then see multiple error dialogs, including one which will say: "Unable to add selected document to the project. null"

In Studio's error.log you may also see errors like the ones below:

java.lang.NullPointerException
at org.apache.xerces.dom.ParentNode.nodeListItem(Unknown Source)
at org.apache.xerces.dom.ParentNode.item(Unknown Source)
at com.approuter.studio.util.DOMTreeWalker.traverse(DOMTreeWalker.java:51)
at com.approuter.studio.util.DOMTreeWalker.traverse(DOMTreeWalker.java:57)
at com.approuter.studio.util.DOMTreeWalker.traverse(DOMTreeWalker.java:57)
at com.approuter.studio.util.DOMTreeWalker.traverse(DOMTreeWalker.java:40)
at com.approuter.studio.document.LocalDocumentIncludeEntryManagerWriter.write(LocalDocumentIncludeEntryManagerWriter.java:92)
at com.approuter.studio.document.LocalDocumentIncludeEntryManagerWriter.writeTo(LocalDocumentIncludeEntryManagerWriter.java:111)
at com.approuter.studio.document.AbstractLoadableXMLSchemaDocument.getContent(AbstractLoadableXMLSchemaDocument.java:190)

and:

SEVERE: maestro.err.uncaughtException
java.lang.StackOverflowError
at org.apache.xerces.dom.ParentNode.internalInsertBefore(Unknown Source)
at org.apache.xerces.dom.ParentNode.insertBefore(Unknown Source)
at org.apache.xerces.dom.NodeImpl.appendChild(Unknown Source)
at com.approuter.studio.util.CopyElementNodeVisitor.visit(CopyElementNodeVisitor.java:56)
at com.approuter.studio.util.DOMTreeWalker.traverse(DOMTreeWalker.java:44)
at com.approuter.studio.util.DOMTreeWalker.traverse(DOMTreeWalker.java:57)

Resolving the problem

To help Studio locate the imported schemas choose one of the following three workarounds. All options involve editing the WSDL file. Option 3 also involves moving the imported schemas to a different directory.

Option 1: Specify absolute paths for the imported schemas

  1. Open the WSDL document in a file editor and locate all the xsd:import elements which specify the locations of schemas to be imported.

  2. Ensure that an absolute path is used for the value of the schemaLocation attribute. Make sure you use forward slashes to separate the folder names; for example: "C:/MyProject/MyWSDLs/MySchema.xsd". Repeat this step for all such schemaLocation attributes and then save your changes.

  3. Now try importing the modified WSDL into Studio again. This time it should locate all the imported schemas correctly and the WSDL should import successfully.

Option 2: Specify correct relative paths for the imported schemas
  1. Open the WSDL document in a file editor and locate all the xsd:import elements which specify the locations of schemas to be imported.

  2. Where a relative path is used for the value of the schemaLocation attribute, ensure that the path is relative to the WSDL document which is importing the schema. For example, if your WSDL is in C:\MyProject\MyWSDLs and your imported schema, MySchema2.xsd, resides in C:\MyProject\MyWSDLs\MySchemas, then you would set schemaLocation="MySchemas/MySchema2.xsd". Repeat this step for all such schemaLocation attributes and then save your changes.

  3. Now try importing the modified WSDL into Studio again. Studio will prompt you with the 'Uploading Included XML Schemas' dialog and highlight schemas it wasn't able to locate with a warning triangle containing an exclamation mark. Select one of these schemas and click on Locate... to browse to that schema on the filesystem. Repeat this step until all the listed schemas have green ticks next to them and the OK button in the 'Uploading Included XML Schemas' dialog is enabled. Click OK and the WSDL should import successfully.

Option 3: Put the imported schemas in the same directory as the WSDL which imports them
  1. Put all the schemas which the WSDL imports into the same directory as the WSDL itself.

  2. Open the WSDL document in a file editor and locate all the xsd:import elements which specify the locations of schemas to be imported.

  3. Where a relative path is used for the value of the schemaLocation attribute simply delete the relative path so that only the file name of the schema remains. For example, if your WSDL is in C:\MyProject\MyWSDLs and your imported schema, MySchema2.xsd, now resides in the same directory, then you would set schemaLocation="MySchema2.xsd". Repeat this step for all such schemaLocation attributes and then save your changes.

  4. Now try importing the modified WSDL into Studio again. This time it should locate all the imported schemas correctly and the WSDL should import successfully.

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

WebSphere Cast Iron Cloud integration
Studio

Software version:

5.0.1.1, 5.0.1.2, 5.0.1.3, 5.0.1.4, 5.0.1.5, 5.0.1.6, 5.0.1.7, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4, 6.1, 6.1.0.1, 6.1.0.2

Operating system(s):

Windows

Software edition:

Cloud, Physical, Virtual

Reference #:

1571807

Modified date:

2013-02-05

Translate my page

Machine Translation

Content navigation