You pointed me in the right direction. I found it in the emf faq:
 
EMF recognizes a couple of well known archive schemes, such as "zip" and "jar", 
so everything will work fine if the URI of an archived resource starts, for 
example, with "zip:". Although most applications probably use one of these 
recognized schemes, you may find that certain runtimes use a different one. For 
example, when running in the IBM WebSphere Application Server, 
Class.getResource(String) may return a URL with a "wsjar" scheme, like 
"wsjar:file:/C:/dev/ws/default/sample_app/xsd.resources.jar!/org/eclipse/xsd/plugin.properties".
 
By default, EMF will not recognize this as an archive URI and will fail to 
handle it correctly, probably resulting in multiple unregistered resources 
errors and/or null pointer exceptions. If you are facing this problem, you will 
need to change EMF's set of recognized archive schemes. This is done by 
defining a property named "org.eclipse.emf.common.util.URI.archiveSchemes", 
whose value is the desired space-separated list of archive schemes. Here's an 
example of how you could define it when invoking your Java application:

java MyApp -Dorg.eclipse.emf.common.util.URI.archiveSchemes="wsjar wszip jar 
zip" 

________________________________

From: Yang ZHONG [mailto:[EMAIL PROTECTED]
Sent: Fri 1/26/2007 7:42 PM
To: [email protected]
Subject: Re: java.lang.IllegalArgumentException: resolve against 
non-hierarchical or relative base



Just in case you have deployed EMF/XSD jars within your (web) app, removing
them may be worth trying since WebSphere should have had them already.

On 1/26/07, Yang ZHONG <[EMAIL PROTECTED]> wrote:
>
> XSDSchemaImpl.getSchemaInstance tries to load the model for your XSD
> version (http://www.w3.org/2001/XMLSchema).
> The model is normally within the xsd.jar(cache/www.w3.org/2001/XMLSchema.xsd).
>
> Before loading that, EMFPlugin.getBaseURL tries to compute where the
> xsd.jar is so that an absolute URL can be generated
> (jar:file:/.../xsd.jar!/cache/www.w3.org/2001/XMLSchema.xsd).
> The computing is by searching for plugin.properties. Somehow that EMF
> logic doesn't seem working for your environment.
> EMF newsgroup is a good place to discuss that.
>
>
>  On 1/26/07, Christian Landbo Frederiksen <
> [EMAIL PROTECTED]> wrote:
> >
> >
> > Definitely something about that because when I went from:
> >
> >        HelperProvider.getXSDHelper();
> > To
> >        HelperProviderImpl.getXSDHelper();
> >
> > I managed to run it from the prompt using:
> >
> > java -cp "sdo-api-r2.0.1-1.0-incubator-M2.jar;
> > tuscany-sdo-impl-1.0-incubator-M2.jar;common-2.2.1.jar;ecore- 2.2.1.jar
> > ;e
> > core-change-2.2.1.jar;ecore-xmi-2.2.1.jar;xsd-2.2.1.jar;tuscany-sdo-tool
> > s-1.0-incubator-M2.jar;." sandbox.Deconstructor
> >
> > I still have the non-hierarchical or relative base issue when run in web
> >
> > app!!!!!
> >
> > Can anybody tell from the trace below if the classes are the correct
> > Tuscany classes it is using?
> >
> > java.lang.IllegalArgumentException: resolve against non-hierarchical or
> > relative base
> > at org.eclipse.emf.common.util.URI.resolve(URI.java:1853)
> > at org.eclipse.emf.common.util.URI.resolve(URI.java:1826)
> > at org.eclipse.emf.common.EMFPlugin.getBaseURL(EMFPlugin.java:212)
> > at
> > org.eclipse.xsd.impl.XSDSchemaImpl.getSchemaInstance (XSDSchemaImpl.java
> > :
> > 680)
> > at
> > org.eclipse.xsd.impl.XSDSchemaImpl.resolveSchema(XSDSchemaImpl.java:2120
> > )
> > at org.eclipse.xsd.impl.XSDSchemaImpl.patch(XSDSchemaImpl.java:1484)
> > at
> > org.eclipse.xsd.impl.XSDSchemaImpl.changeAttribute (XSDSchemaImpl.java
> > :23
> > 35)
> > at
> > org.eclipse.xsd.impl.XSDConcreteComponentImpl.eNotify(XSDConcreteCompone
> > ntImpl.java:1240)
> > at
> > org.eclipse.xsd.impl.XSDSchemaImpl.setSchemaLocation(XSDSchemaImpl.java:
> > 829)
> > at org.eclipse.xsd.util.XSDResourceImpl.doLoad(XSDResourceImpl.java:756)
> > at org.eclipse.xsd.util.XSDResourceImpl.load(XSDResourceImpl.java:617)
> > at
> > org.apache.tuscany.sdo.helper.XSDHelperImpl.define(XSDHelperImpl.java:18
> > 1)
> > at
> > org.apache.tuscany.sdo.helper.XSDHelperImpl.define(XSDHelperImpl.java:17
> > 2)
> >
> > -----Original Message-----
> > From: Christian Landbo Frederiksen
> > [mailto: [EMAIL PROTECTED]
> > Sent: 26. januar 2007 15:46
> > To: [email protected]
> > Subject: RE: java.lang.IllegalArgumentException: resolve against
> > non-hierarchical or relative base
> >
> >
> > HI
> >
> > Is there some class-path order that is important or some files that you
> > have to set up, because when I try outside of my development environment
> > I get a NullPointerException from the HelperProvider.
> >
> > commonj.sdo.impl.HelperProvider.getXSDHelper(HelperProvider.java:346)
> >
> > java -cp "sdo-api-r2.0.1-1.0-incubator-M2.jar;
> > tuscany-sdo-impl-1.0-incubator-M2.jar;common-2.2.1.jar;ecore-2.2.1.jar;e
> > core-change-2.2.1.jar ;ecore-xmi-2.2.1.jar;xsd-2.2.1.jar;."
> > sandbox.Deconstructor
> >
> > /Chr
> >
> > -----Original Message-----
> > From: kelvin goodson [mailto:[EMAIL PROTECTED]
> > Sent: 26. januar 2007 13:04
> > To: [email protected]
> > Subject: Re: java.lang.IllegalArgumentException: resolve against
> > non-hierarchical or relative base
> >
> > Christian,
> > I don't know enough about the deployed environment,  but I suspect it
> > is
> > to do with the imports that your schema makes.  The second argument to
> > XSDHelper.define is there to assist in resolving imports that are made
> > by
> > relative URI from the base schema location.  Are the imported schemata
> > available in the deployed environment at the correct relative location.
> > Regards, Kelvin.
> >
> >
> > On 25/01/07, Christian Landbo Frederiksen <
> > [EMAIL PROTECTED] > wrote:
> > >
> > > I have some code that functions fine when run as simple java app with
> > a
> > > main method:
> > >
> > >    URL url =
> > > XsdDeconstructor.class.getClassLoader().getResource(xsdFile);
> > >    XSDHelper.INSTANCE.define(url.openStream(), url.toString());
> > >
> > > But when I try to run it within a web app (on Websphere Test
> > Environment
> > > i Rational 7) I get the following:
> > >
> > > java.lang.IllegalArgumentException: resolve against non-hierarchical
> > or
> > > relative base
> > > at org.eclipse.emf.common.util.URI.resolve(URI.java:1853)
> > >
> > > Any ideas?
> > >
> > >
> > > /Christian
> > >
> > >
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
>
> Yang ZHONG




--

Yang ZHONG



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to