Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Anytype emf 2.3 versus emf 2.4M6
Anytype emf 2.3 versus emf 2.4M6 [message #418227] Mon, 07 April 2008 12:24 Go to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ed,
I get an exception when running one of my testcases against emf 2.4M6, this worked fine for the
emf2.4M5 release and also works for emf2.3. It is related to anytype and checking which efeatures
are allowed for an anytype. Here is a snippet of the xsd:

<!-- base type -->
<xs:complexType name="testAny">
<xs:sequence>
<xs:any maxOccurs="unbounded" namespace="##other"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="B">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
</xs:sequence>
</xs:complexType>

When I then do this:
testAny.getAny().add(AnytypePackage.eINSTANCE.getB_Name(), "my b");

Then I get the exception below. I debugged and its seems to check if the namespace of the B.name
feature corresponds to the namespace of the any feature, however the namespace of the B.name feature
is null.

java.lang.RuntimeException: Invalid entry feature 'B.name'
at org.eclipse.emf.ecore.util.BasicFeatureMap.validate(BasicFea tureMap.java:93)
at org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFe atureMap.java:1523)
at org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFe atureMap.java:1)
at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:6 26)
at org.eclipse.emf.ecore.util.BasicFeatureMap.doAdd(BasicFeatur eMap.java:522)
at org.eclipse.emf.ecore.util.BasicFeatureMap.add(BasicFeatureM ap.java:1264)
at org.eclipse.emf.teneo.test.emf.schemaconstructs.AnyTypeActio n.doAction(AnyTypeAction.java:91)
at org.eclipse.emf.teneo.test.AbstractActionTest.testAction(Abs tractActionTest.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:164)
at org.eclipse.emf.teneo.test.AbstractTest.runTest(AbstractTest .java:88)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at org.eclipse.emf.teneo.test.conf.ConfigurableTestSuite.runTes t(ConfigurableTestSuite.java:64)
at junit.framework.TestSuite.run(TestSuite.java:225)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)

--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Anytype emf 2.3 versus emf 2.4M6 [message #418229 is a reply to message #418227] Mon, 07 April 2008 12:43 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Martin,

This is because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=224877
which is related to
https://bugs.eclipse.org/bugs/show_bug.cgi?id=224874. It was brought to
my attention that ##other doesn't allow the null namespace...


Martin Taal wrote:
> Hi Ed,
> I get an exception when running one of my testcases against emf 2.4M6,
> this worked fine for the emf2.4M5 release and also works for emf2.3.
> It is related to anytype and checking which efeatures are allowed for
> an anytype. Here is a snippet of the xsd:
>
> <!-- base type -->
> <xs:complexType name="testAny">
> <xs:sequence>
> <xs:any maxOccurs="unbounded" namespace="##other"/>
> </xs:sequence>
> </xs:complexType>
>
> <xs:complexType name="B">
> <xs:sequence>
> <xs:element name="name" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
>
> When I then do this:
> testAny.getAny().add(AnytypePackage.eINSTANCE.getB_Name(),
> "my b");
>
> Then I get the exception below. I debugged and its seems to check if
> the namespace of the B.name feature corresponds to the namespace of
> the any feature, however the namespace of the B.name feature is null.
>
> java.lang.RuntimeException: Invalid entry feature 'B.name'
> at
> org.eclipse.emf.ecore.util.BasicFeatureMap.validate(BasicFea tureMap.java:93)
>
> at
> org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFe atureMap.java:1523)
>
> at
> org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFe atureMap.java:1)
>
> at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:6 26)
> at
> org.eclipse.emf.ecore.util.BasicFeatureMap.doAdd(BasicFeatur eMap.java:522)
>
> at
> org.eclipse.emf.ecore.util.BasicFeatureMap.add(BasicFeatureM ap.java:1264)
> at
> org.eclipse.emf.teneo.test.emf.schemaconstructs.AnyTypeActio n.doAction(AnyTypeAction.java:91)
>
> at
> org.eclipse.emf.teneo.test.AbstractActionTest.testAction(Abs tractActionTest.java:71)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:585)
> at junit.framework.TestCase.runTest(TestCase.java:164)
> at
> org.eclipse.emf.teneo.test.AbstractTest.runTest(AbstractTest .java:88)
> at junit.framework.TestCase.runBare(TestCase.java:130)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:120)
> at junit.framework.TestSuite.runTest(TestSuite.java:230)
> at junit.framework.TestSuite.run(TestSuite.java:225)
> at junit.framework.TestSuite.runTest(TestSuite.java:230)
> at
> org.eclipse.emf.teneo.test.conf.ConfigurableTestSuite.runTes t(ConfigurableTestSuite.java:64)
>
> at junit.framework.TestSuite.run(TestSuite.java:225)
> at junit.framework.TestSuite.runTest(TestSuite.java:230)
> at junit.framework.TestSuite.run(TestSuite.java:225)
> at
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:130)
>
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Anytype emf 2.3 versus emf 2.4M6 [message #418231 is a reply to message #418229] Mon, 07 April 2008 13:01 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ed,
For my curiosity, why does the B.name feature not get the default namespace (why is it null)?
The top of the xsd is this:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace=" http://www.eclipse.org/emf/teneo/samples/emf/schemaconstruct s/anytype"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns=" http://www.eclipse.org/emf/teneo/samples/emf/schemaconstruct s/anytype">

gr. Martin

Ed Merks wrote:
> Martin,
>
> This is because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=224877
> which is related to
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=224874. It was brought to
> my attention that ##other doesn't allow the null namespace...
>
>
> Martin Taal wrote:
>> Hi Ed,
>> I get an exception when running one of my testcases against emf 2.4M6,
>> this worked fine for the emf2.4M5 release and also works for emf2.3.
>> It is related to anytype and checking which efeatures are allowed for
>> an anytype. Here is a snippet of the xsd:
>>
>> <!-- base type -->
>> <xs:complexType name="testAny">
>> <xs:sequence>
>> <xs:any maxOccurs="unbounded" namespace="##other"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>> <xs:complexType name="B">
>> <xs:sequence>
>> <xs:element name="name" type="xs:string"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>> When I then do this:
>> testAny.getAny().add(AnytypePackage.eINSTANCE.getB_Name(),
>> "my b");
>>
>> Then I get the exception below. I debugged and its seems to check if
>> the namespace of the B.name feature corresponds to the namespace of
>> the any feature, however the namespace of the B.name feature is null.
>>
>> java.lang.RuntimeException: Invalid entry feature 'B.name'
>> at
>> org.eclipse.emf.ecore.util.BasicFeatureMap.validate(BasicFea tureMap.java:93)
>>
>> at
>> org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFe atureMap.java:1523)
>>
>> at
>> org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFe atureMap.java:1)
>>
>> at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:6 26)
>> at
>> org.eclipse.emf.ecore.util.BasicFeatureMap.doAdd(BasicFeatur eMap.java:522)
>>
>> at
>> org.eclipse.emf.ecore.util.BasicFeatureMap.add(BasicFeatureM ap.java:1264)
>> at
>> org.eclipse.emf.teneo.test.emf.schemaconstructs.AnyTypeActio n.doAction(AnyTypeAction.java:91)
>>
>> at
>> org.eclipse.emf.teneo.test.AbstractActionTest.testAction(Abs tractActionTest.java:71)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:585)
>> at junit.framework.TestCase.runTest(TestCase.java:164)
>> at
>> org.eclipse.emf.teneo.test.AbstractTest.runTest(AbstractTest .java:88)
>> at junit.framework.TestCase.runBare(TestCase.java:130)
>> at junit.framework.TestResult$1.protect(TestResult.java:106)
>> at junit.framework.TestResult.runProtected(TestResult.java:124)
>> at junit.framework.TestResult.run(TestResult.java:109)
>> at junit.framework.TestCase.run(TestCase.java:120)
>> at junit.framework.TestSuite.runTest(TestSuite.java:230)
>> at junit.framework.TestSuite.run(TestSuite.java:225)
>> at junit.framework.TestSuite.runTest(TestSuite.java:230)
>> at
>> org.eclipse.emf.teneo.test.conf.ConfigurableTestSuite.runTes t(ConfigurableTestSuite.java:64)
>>
>> at junit.framework.TestSuite.run(TestSuite.java:225)
>> at junit.framework.TestSuite.runTest(TestSuite.java:230)
>> at junit.framework.TestSuite.run(TestSuite.java:225)
>> at
>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:130)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Anytype emf 2.3 versus emf 2.4M6 [message #418232 is a reply to message #418231] Mon, 07 April 2008 14:18 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Martin,

You really ought to only be using global element declarations in
wildcards; those would be features of the document root and would
definitely have the namespace of the containing schema. By default,
elementFormDefault/form are "unqualified" so local element declarations
have null namespace.


Martin Taal wrote:
> Hi Ed,
> For my curiosity, why does the B.name feature not get the default
> namespace (why is it null)?
> The top of the xsd is this:
>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
> targetNamespace=" http://www.eclipse.org/emf/teneo/samples/emf/schemaconstruct s/anytype"
>
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>
> xmlns=" http://www.eclipse.org/emf/teneo/samples/emf/schemaconstruct s/anytype">
>
>
> gr. Martin
>
> Ed Merks wrote:
>> Martin,
>>
>> This is because of
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=224877 which is related
>> to https://bugs.eclipse.org/bugs/show_bug.cgi?id=224874. It was
>> brought to my attention that ##other doesn't allow the null namespace...
>>
>>
>> Martin Taal wrote:
>>> Hi Ed,
>>> I get an exception when running one of my testcases against emf
>>> 2.4M6, this worked fine for the emf2.4M5 release and also works for
>>> emf2.3. It is related to anytype and checking which efeatures are
>>> allowed for an anytype. Here is a snippet of the xsd:
>>>
>>> <!-- base type -->
>>> <xs:complexType name="testAny">
>>> <xs:sequence>
>>> <xs:any maxOccurs="unbounded" namespace="##other"/>
>>> </xs:sequence>
>>> </xs:complexType>
>>>
>>> <xs:complexType name="B">
>>> <xs:sequence>
>>> <xs:element name="name" type="xs:string"/>
>>> </xs:sequence>
>>> </xs:complexType>
>>>
>>> When I then do this:
>>>
>>> testAny.getAny().add(AnytypePackage.eINSTANCE.getB_Name(), "my b");
>>>
>>> Then I get the exception below. I debugged and its seems to check if
>>> the namespace of the B.name feature corresponds to the namespace of
>>> the any feature, however the namespace of the B.name feature is null.
>>>
>>> java.lang.RuntimeException: Invalid entry feature 'B.name'
>>> at
>>> org.eclipse.emf.ecore.util.BasicFeatureMap.validate(BasicFea tureMap.java:93)
>>>
>>> at
>>> org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFe atureMap.java:1523)
>>>
>>> at
>>> org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFe atureMap.java:1)
>>>
>>> at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:6 26)
>>> at
>>> org.eclipse.emf.ecore.util.BasicFeatureMap.doAdd(BasicFeatur eMap.java:522)
>>>
>>> at
>>> org.eclipse.emf.ecore.util.BasicFeatureMap.add(BasicFeatureM ap.java:1264)
>>>
>>> at
>>> org.eclipse.emf.teneo.test.emf.schemaconstructs.AnyTypeActio n.doAction(AnyTypeAction.java:91)
>>>
>>> at
>>> org.eclipse.emf.teneo.test.AbstractActionTest.testAction(Abs tractActionTest.java:71)
>>>
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>
>>> at java.lang.reflect.Method.invoke(Method.java:585)
>>> at junit.framework.TestCase.runTest(TestCase.java:164)
>>> at
>>> org.eclipse.emf.teneo.test.AbstractTest.runTest(AbstractTest .java:88)
>>> at junit.framework.TestCase.runBare(TestCase.java:130)
>>> at junit.framework.TestResult$1.protect(TestResult.java:106)
>>> at junit.framework.TestResult.runProtected(TestResult.java:124)
>>> at junit.framework.TestResult.run(TestResult.java:109)
>>> at junit.framework.TestCase.run(TestCase.java:120)
>>> at junit.framework.TestSuite.runTest(TestSuite.java:230)
>>> at junit.framework.TestSuite.run(TestSuite.java:225)
>>> at junit.framework.TestSuite.runTest(TestSuite.java:230)
>>> at
>>> org.eclipse.emf.teneo.test.conf.ConfigurableTestSuite.runTes t(ConfigurableTestSuite.java:64)
>>>
>>> at junit.framework.TestSuite.run(TestSuite.java:225)
>>> at junit.framework.TestSuite.runTest(TestSuite.java:230)
>>> at junit.framework.TestSuite.run(TestSuite.java:225)
>>> at
>>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:130)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>>>
>>>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Adding an Editor Action that auto-loads a specific resource
Next Topic:EMF Sources not found
Goto Forum:
  


Current Time: Thu Apr 25 05:33:44 GMT 2024

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

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

Back to the top