Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Can't load Schema
Can't load Schema [message #1153] Fri, 27 September 2002 19:20 Go to next message
Eclipse UserFriend
Originally posted by: troynet+web.ugcs.net

I'm trying the example from Shane Curcuru's article:

ResourceSet resourceSet = new ResourceSetImpl();
XSDResourceImpl xsdSchemaResource = /* line 40 */
(XSDResourceImpl) resourceSet.getResource(
URI.createDeviceURI( schemaURL, true));

and my schemaURL looks like this:
file:/home/troy/xxml/schema/xxml.xsd

But I get this error when I run:

Exception in thread "main" java.lang.RuntimeException: Cannot create a
resource for ' + uri + '
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:271)
at org.xxml.schema.Schema.<init>(Schema.java:40)
at org.xxml.schema.SchemaUI.main(SchemaUI.java:112)


Why would I get this error?
Re: Can't load Schema [message #1209 is a reply to message #1153] Fri, 27 September 2002 23:01 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

--------------E5DBCA926C9F9D2CE489D2E8
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Troy,

When running within Eclipse, the plugin environment does initialization that must be done
manually if you are running stand-alone.

http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/xsd- home/docs/javadoc/org/eclipse/xsd/util/XSDPrototypicalSchema .html#printSchema(java.lang.String)

In particular, you need to register a resouce factory to handle .xsd files. It can be done
in the global registry in this way:

Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "xsd", new
XSDResourceFactoryImpl());

Within Eclipse, this is done by the plugin.xml registration.


Troy Bridoux wrote:

> I'm trying the example from Shane Curcuru's article:
>
> ResourceSet resourceSet = new ResourceSetImpl();
> XSDResourceImpl xsdSchemaResource = /* line 40 */
> (XSDResourceImpl) resourceSet.getResource(
> URI.createDeviceURI( schemaURL, true));
>
> and my schemaURL looks like this:
> file:/home/troy/xxml/schema/xxml.xsd
>
> But I get this error when I run:
>
> Exception in thread "main" java.lang.RuntimeException: Cannot create a
> resource for ' + uri + '
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:271)
> at org.xxml.schema.Schema.<init>(Schema.java:40)
> at org.xxml.schema.SchemaUI.main(SchemaUI.java:112)
>
> Why would I get this error?

--
Ed Merks


--------------E5DBCA926C9F9D2CE489D2E8
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Troy,
<p>When running within Eclipse, the plugin environment does initialization
that must be done manually if you are running stand-alone.
<p>&nbsp;<a href=" http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/xsd- home/docs/javadoc/org/eclipse/xsd/util/XSDPrototypicalSchema .html#printSchema(java.lang.String)"> http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/xsd- home/docs/javadoc/org/eclipse/xsd/util/XSDPrototypicalSchema .html#printSchema(java.lang.String)</a>
<p>In particular, you need to register a resouce factory to handle .xsd
files.&nbsp; It can be done in the global registry in this way:
<blockquote> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "xsd",
new XSDResourceFactoryImpl());</blockquote>
Within Eclipse, this is done by the plugin.xml registration.
<br>&nbsp;
<p>Troy Bridoux wrote:
<blockquote TYPE=CITE>I'm trying the example from Shane Curcuru's article:
<p>ResourceSet resourceSet = new ResourceSetImpl();
<br>XSDResourceImpl xsdSchemaResource =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;
/* line 40 */
<br>&nbsp; (XSDResourceImpl) resourceSet.getResource(
<br>&nbsp;&nbsp;&nbsp;&nbsp; URI.createDeviceURI( schemaURL, true));
<p>and my schemaURL looks like this:
<br><a href="file:/home/troy/xxml/schema/xxml.xsd">file:/home/troy/xxml/schema/xxml.xsd </a>
<p>But I get this error when I run:
<p>Exception in thread "main" java.lang.RuntimeException: Cannot create
a
<br>resource for ' + uri + '
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; at
<br> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:271)
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; at org.xxml.schema.Schema.&lt;init>(Schema.java:40)
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; at org.xxml.schema.SchemaUI.main(SchemaUI.java:112)
<p>Why would I get this error?</blockquote>

<p>--
<br>Ed Merks
<br>&nbsp;</html>

--------------E5DBCA926C9F9D2CE489D2E8--
Re: Can't load Schema [message #562662 is a reply to message #1153] Fri, 27 September 2002 23:01 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33205
Registered: July 2009
Senior Member
--------------E5DBCA926C9F9D2CE489D2E8
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Troy,

When running within Eclipse, the plugin environment does initialization that must be done
manually if you are running stand-alone.

http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/xsd- home/docs/javadoc/org/eclipse/xsd/util/XSDPrototypicalSchema .html#printSchema(java.lang.String)

In particular, you need to register a resouce factory to handle .xsd files. It can be done
in the global registry in this way:

Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "xsd", new
XSDResourceFactoryImpl());

Within Eclipse, this is done by the plugin.xml registration.


Troy Bridoux wrote:

> I'm trying the example from Shane Curcuru's article:
>
> ResourceSet resourceSet = new ResourceSetImpl();
> XSDResourceImpl xsdSchemaResource = /* line 40 */
> (XSDResourceImpl) resourceSet.getResource(
> URI.createDeviceURI( schemaURL, true));
>
> and my schemaURL looks like this:
> file:/home/troy/xxml/schema/xxml.xsd
>
> But I get this error when I run:
>
> Exception in thread "main" java.lang.RuntimeException: Cannot create a
> resource for ' + uri + '
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:271)
> at org.xxml.schema.Schema.<init>(Schema.java:40)
> at org.xxml.schema.SchemaUI.main(SchemaUI.java:112)
>
> Why would I get this error?

--
Ed Merks


--------------E5DBCA926C9F9D2CE489D2E8
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Troy,
<p>When running within Eclipse, the plugin environment does initialization
that must be done manually if you are running stand-alone.
<p>&nbsp;<a href=" http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/xsd- home/docs/javadoc/org/eclipse/xsd/util/XSDPrototypicalSchema .html#printSchema(java.lang.String)"> http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/xsd- home/docs/javadoc/org/eclipse/xsd/util/XSDPrototypicalSchema .html#printSchema(java.lang.String)</a>
<p>In particular, you need to register a resouce factory to handle .xsd
files.&nbsp; It can be done in the global registry in this way:
<blockquote> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "xsd",
new XSDResourceFactoryImpl());</blockquote>
Within Eclipse, this is done by the plugin.xml registration.
<br>&nbsp;
<p>Troy Bridoux wrote:
<blockquote TYPE=CITE>I'm trying the example from Shane Curcuru's article:
<p>ResourceSet resourceSet = new ResourceSetImpl();
<br>XSDResourceImpl xsdSchemaResource =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;
/* line 40 */
<br>&nbsp; (XSDResourceImpl) resourceSet.getResource(
<br>&nbsp;&nbsp;&nbsp;&nbsp; URI.createDeviceURI( schemaURL, true));
<p>and my schemaURL looks like this:
<br><a href="file:/home/troy/xxml/schema/xxml.xsd">file:/home/troy/xxml/schema/xxml.xsd </a>
<p>But I get this error when I run:
<p>Exception in thread "main" java.lang.RuntimeException: Cannot create
a
<br>resource for ' + uri + '
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; at
<br> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:271)
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; at org.xxml.schema.Schema.&lt;init>(Schema.java:40)
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; at org.xxml.schema.SchemaUI.main(SchemaUI.java:112)
<p>Why would I get this error?</blockquote>

<p>--
<br>Ed Merks
<br>&nbsp;</html>

--------------E5DBCA926C9F9D2CE489D2E8--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:XSD Schema schema discovery problem
Next Topic:set annotation to schema object
Goto Forum:
  


Current Time: Sun Sep 01 07:19:15 GMT 2024

Powered by FUDForum. Page generated in 0.02696 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top