Hi Frank et. al.

I applied the fix and it helped, but I also get an error like the one
mentioned in this thread (NullPointerException), when a referenced
schema cannot be found!

But that is not the worst part. Once I run into that error, all later
attempts to create using a dataFactory from the context also fail, but
this time with the following error:

java.lang.ClassCastException:
org.eclipse.emf.ecore.impl.DynamicEObjectImpl incompatible with
commonj.sdo.DataObject
at
org.apache.tuscany.sdo.helper.DataFactoryImpl.create(DataFactoryImpl.jav
a:61)
at
org.apache.tuscany.sdo.helper.DataFactoryImpl.create(DataFactoryImpl.jav
a:46)

Any ideas?

Could you describe some helpercontext scenarios? I am specifically
wondering how long the helperContext instance should live. Currently I
am trying to use a long living context inside a singleton - imagining it
is the most efficient way. Is that recommendable?

/Chr


-----Original Message-----
From: Frank Budinsky [mailto:[EMAIL PROTECTED] 
Sent: 27. marts 2007 16:27
To: [email protected]
Subject: RE: SDO Java M3 Release Candidate RC1

Hi Christian,

Your schema seems to be using http:// schemaLocations. For performance 
reasons, we recently disabled that, but I guess we really shouldn't do 
that, without it being an option. We will fix it in the next driver.

If you want to try it out yourself, the fix is to comment out line 2473
in 
DataObjectUtil:

    //resourceSet.setURIConverter(new SDOURIConverterImpl());

Frank.

"Christian Landbo Frederiksen" <[EMAIL PROTECTED]>

wrote on 03/27/2007 03:51:43 AM:

> Hi again.
> 
> Though my simple testcase now functions, I have run into a nullpointer
> exception with a schema that functions in M2.
> 
> java.lang.NullPointerException
>    at
>
org.apache.tuscany.sdo.helper.SDOXSDEcoreBuilder.getEClassifier(SDOXSDEc
> oreBuilder.java:123)
> 
> As far as I can tell: In BaseSDOXSDEcoreBuilder:
> 
>    protected EStructuralFeature createFeature
>       (EClass eClass, XSDElementDeclaration xsdElementDeclaration,
> String name, XSDComponent xsdComponent, int    minOccurs, int
> maxOccurs) {
> 
>    XSDTypeDefinition elementTypeDefinition =
> getEffectiveTypeDefinition(xsdComponent, xsdElementDeclaration);
> 
> The call to getEffectiveTypeDefinition returns null, resulting in the
> nullpointer in the next call to 
> 
>    EClassifier eClassifier = getEClassifier(elementTypeDefinition);
> 
> The schema has references to other schemas and it is in the first of
> those (StreetName) it fails.
> 
> This is the schema I try to define: 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema";
>
xmlns:brugerinformation="http://rep.oio.dk/brugerinformation.dk/xml/sche
> mas/2007/01/01/"
> xmlns:XKOM="http://rep.oio.dk/xkom.dk/xml/schemas/2006/01/06/";
> xmlns:DKCC="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2005/03/15/";
> xmlns:DKCC2="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2003/02/13/";
>
targetNamespace="http://rep.oio.dk/brugerinformation.dk/xml/schemas/2007
> /01/01/" elementFormDefault="qualified" xml:lang="en">
>    <import
> namespace="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2005/03/15/";
>
schemaLocation="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2005/03/15/DKCC
> _PostCodeIdentifier.xsd"/>
>    <import
> namespace="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2005/03/15/";
>
schemaLocation="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2005/03/15/DKCC
> _DistrictName.xsd"/>
>    <import
> namespace="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2005/03/15/";
>
schemaLocation="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2005/03/15/DKCC
> _StreetName.xsd"/>
>    <import
> namespace="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2003/02/13/";
>
schemaLocation="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2003/02/13/DKCC
> _StreetBuildingIdentifier.xsd"/>
>    <import
> namespace="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2005/03/15/";
>
schemaLocation="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2005/03/15/DKCC
> _DistrictSubdivisionIdentifier.xsd"/>
>    <import
> namespace="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2003/02/13/";
>
schemaLocation="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2003/02/13/DKCC
> _FloorIdentifier.xsd"/>
>    <import
> namespace="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2003/02/13/";
>
schemaLocation="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2003/02/13/DKCC
> _SuiteIdentifier.xsd"/>
>    <annotation>
>       <documentation/>
>    </annotation>
>    <element name="InstitutionAddress"
> type="brugerinformation:InstitutionAddressType"/>
>    <complexType name="InstitutionAddressType">
>       <sequence>
>          <element name="DaycareServiceName"
> type="string"/>
>          <element ref="DKCC:StreetName"/>
>          <element ref="DKCC2:StreetBuildingIdentifier"/>
>          <element ref="DKCC2:FloorIdentifier"
> minOccurs="0"/>
>          <element ref="DKCC2:SuiteIdentifier"
> minOccurs="0"/>
>          <element ref="DKCC:PostCodeIdentifier"/>
>          <element ref="DKCC:DistrictName"/>
>          <element
> ref="DKCC:DistrictSubdivisionIdentifier"/>
>          <element name="InstitutionPhonenrText"
> type="string"/>
>          <element name="EmailaddText" type="string"/>
>          <element name="WeblinkText" type="string"/>
>       </sequence>
>    </complexType>
> </schema> 
> 
> Any ideas?
> 
> 
> -----Original Message-----
> From: Frank Budinsky [mailto:[EMAIL PROTECTED] 
> Sent: 26. marts 2007 19:12
> To: [email protected]
> Subject: RE: SDO Java M3 Release Candidate RC1
> 
> You need to get your DataFactory from the HelperContext:
> 
> DataObject documentDataObject = hc.getDataFactory().create(namespace,
>                "DocumentRoot");
> 
> You should generally stop using INSTANCE fields in all cases, because
> they 
> are probably going to be deprecated in the next version of SDO. 
> HelperContext is the replacement. It defines a metadata scope, so you 
> should always use it to get the helpers for your scope.
> 
> Frank.
> 
> "Christian Landbo Frederiksen"
<[EMAIL PROTECTED]>
> 
> wrote on 03/26/2007 01:01:00 PM:
> 
> > 
> > In M2 & M3 this works for a specific schema:
> > 
> > XSDHelper.INSTANCE.define(new String(xsdFile.getBytes("UTF-8")));
> > DataObject documentDataObject =
DataFactory.INSTANCE.create(namespace,
> >                "DocumentRoot"); 
> > 
> > But this doesn't
> > 
> > HelperContext hc = SDOUtil.createHelperContext(true);
> > hc.getXSDHelper().define(new String(xsdFile.getBytes("UTF-8")));
> > 
> > DataObject documentDataObject =
DataFactory.INSTANCE.create(namespace,
> >                "DocumentRoot");
> > 
> > 
> > java.lang.IllegalArgumentException
> >    at
> >
>
org.apache.tuscany.sdo.helper.DataFactoryImpl.create(DataFactoryImpl.jav
> > a:63)
> >    at
> >
>
org.apache.tuscany.sdo.helper.DataFactoryImpl.create(DataFactoryImpl.jav
> > a:46)
> >    at
> >
>
sandbox.TestTypeChangesAndExtensibleNamespaces.generate(TestTypeChangesA
> > ndExtensibleNamespaces.java:153)
> >    at
> >
>
sandbox.TestTypeChangesAndExtensibleNamespaces.main(TestTypeChangesAndEx
> > tensibleNamespaces.java:77)
> > 
> > 
> > Any ideas?
> > 
> > -----Original Message-----
> > From: Frank Budinsky [mailto:[EMAIL PROTECTED] 
> > Sent: 22. marts 2007 13:38
> > To: [email protected]
> > Subject: RE: SDO Java M3 Release Candidate RC1
> > 
> > Sorry, there's not much documentation, just the JavaDoc. You need to
> get
> > a 
> > HelperContext by calling SDOUtil.createHelperContext() and then get
> your
> > 
> > XSDHelper from it.
> > 
> > If you want the new extensible namespaces behavior you need to pass
> > "true" 
> > to createHelperContext:
> > 
> > HelperContext hc = SDOUtil.createHelperContext(true);
> > 
> > Frank.
> > 
> > 
> > 
> > 
> > "Christian Landbo Frederiksen"
> <[EMAIL PROTECTED]>
> > 
> > 03/22/2007 06:30 AM
> > Please respond to
> > [email protected]
> > 
> > 
> > To
> > <[email protected]>
> > cc
> > 
> > Subject
> > RE: SDO Java M3 Release Candidate RC1
> > 
> > 
> > 
> > 
> > 
> > 
> > The testcase I used the last time does not function using SDO M3,
but
> I 
> > guess It is because I can't just use XSDHelper.INSTANCE. I remember
> > Frank 
> > mentioning something about helpercontexts. Have you got any
> > documentation 
> > as to hov this is done.
> > 
> > /Chr
> > 
> > ps. the test case is the one from: 
> >
>
https://issues.apache.org/jira/browse/TUSCANY-1113?page=com.atlassian.ji
> > ra.plugin.system.issuetabpanels:comment-tabpanel#action_12473251 
> > <
> >
>
https://webmail.topnordic.com/exchweb/bin/redir.asp?URL=https://issues.a
> >
>
pache.org/jira/browse/TUSCANY-1113?page=com.atlassian.jira.plugin.system
> > .issuetabpanels:comment-tabpanel%23action_12473251
> > > 
> > 
> > 
> > 
> > ________________________________
> > 
> > From: kelvin goodson [mailto:[EMAIL PROTECTED]
> > Sent: Fri 3/16/2007 9:14 AM
> > To: [email protected]
> > Subject: Re: SDO Java M3 Release Candidate RC1
> > 
> > 
> > 
> > Christian,
> >   The required jars for EMF 2.2.2 and the SDO 2.1 API are packaged
in
> > the
> > binary release.
> > Regards, Kelvin.
> > 
> > On 15/03/07, Christian Landbo Frederiksen <
> > [EMAIL PROTECTED]> wrote:
> > >
> > >
> > > What version of EMF and SDO api is needed for this release?
> > >
> > > -----Original Message-----
> > > From: kelvin goodson [mailto:[EMAIL PROTECTED]
> > > Sent: 15. marts 2007 16:42
> > > To: tuscany-dev; Tuscany Users
> > > Subject: SDO Java M3 Release Candidate RC1
> > >
> > > I have posted an SDO Java M3 release candidate here:
> > >
> >
>
http://people.apache.org/~kelvingoodson/sdo_java/M3/RC1/<http://people.a
> > > pache.org/%7Erobbinspg/M3-RC1/>
> > >
> > > Please take a look at this and try it out, so that I can pick up
any
> > > errors
> > > quickly and move towards a vote on a proper release in the short
> term.
> > >
> > > Thanks, Kelvin.
> > >
> > >
> ---------------------------------------------------------------------
> > > 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]
> > 
> > 
> > 
> >
---------------------------------------------------------------------
> > 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]
> 
> 
> 
> ---------------------------------------------------------------------
> 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]



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

Reply via email to