Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » pb when selecting the root packages for the EMF project creation
pb when selecting the root packages for the EMF project creation [message #65727] Wed, 27 December 2006 14:14 Go to next message
Eclipse UserFriend
Originally posted by: TRostren.mia-software.com

Hi,

I try to create an EMF project with this Ecore metamodel.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
<ecore:EPackage name="PrimitiveTypes">
<eClassifiers xsi:type="ecore:EDataType" name="Integer"
instanceClassName="int"/>
<eClassifiers xsi:type="ecore:EDataType" name="String"
instanceClassName="java.lang.String"/>
<eClassifiers xsi:type="ecore:EDataType" name="Boolean"
instanceClassName="boolean"/>
<eClassifiers xsi:type="ecore:EDataType" name="Double"
instanceClassName="double"/>
</ecore:EPackage>
<ecore:EPackage name="RelationalDBSchema" nsURI="RelationalDBSchema"
nsPrefix="">
<eClassifiers xsi:type="ecore:EClass" name="NamedElement"
abstract="true">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
ordered="false"
unique="false" lowerBound="1" eType="#/0/String"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="DataBase"
eSuperTypes="#/1/NamedElement">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="SGBDname"
ordered="false"
unique="false" lowerBound="1" eType="#/0/String"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="tables"
ordered="false"
upperBound="-1" eType="#/1/Table" containment="true"
eOpposite="#/1/Table/database"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Table"
eSuperTypes="#/1/NamedElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="database"
ordered="false"
lowerBound="1" eType="#/1/DataBase"
eOpposite="#/1/DataBase/tables"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="columns"
upperBound="-1"
eType="#/1/Column" containment="true"
eOpposite="#/1/Column/owner"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="key"
ordered="false"
upperBound="-1" eType="#/1/Column" eOpposite="#/1/Column/keyOf"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Column"
eSuperTypes="#/1/NamedElement">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="dataType"
ordered="false"
unique="false" lowerBound="1" eType="#/0/String"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="null"
ordered="false"
unique="false" lowerBound="1" eType="#/0/Boolean"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="defaultValue"
ordered="false"
unique="false" lowerBound="1" eType="#/0/String"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="owner"
ordered="false"
lowerBound="1" eType="#/1/Table" eOpposite="#/1/Table/columns"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="keyOf"
ordered="false"
eType="#/1/Table" eOpposite="#/1/Table/key"/>
</eClassifiers>
</ecore:EPackage>
</xmi:XMI>


the problem comes when i need to choose the root package. I can only
select the first one. If i select the second one, an error occurs. The
logs are below :

!ENTRY org.eclipse.jface 4 2 2006-12-27 10:37:02.266
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.jface".
!STACK 0
java.lang.NullPointerException
at
org.eclipse.emf.converter.util.ConverterUtil.computeRequired Packages(ConverterUtil.java:392)
at
org.eclipse.emf.converter.ui.contribution.base.ModelConverte rPackagePage.validate(ModelConverterPackagePage.java:829)
at
org.eclipse.emf.importer.ui.contribution.base.ModelImporterP ackagePage.validate(ModelImporterPackagePage.java:95)
at
org.eclipse.emf.converter.ui.contribution.base.ModelConverte rPackagePage.ePackageCheckStateChanged(ModelConverterPackage Page.java:452)
at
org.eclipse.emf.converter.ui.contribution.base.ModelConverte rPackagePage$4.checkStateChanged(ModelConverterPackagePage.j ava:274)
at
org.eclipse.jface.viewers.CheckboxTableViewer$1.run(Checkbox TableViewer.java:177)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
...

If I only select the first package, the project is generated but in the
genmodel file, there is only the first package.

I have tested with Eclipse 3.2.1 and EMF 2.2.1.

Regards,

Tony ROSTREN
Re: pb when selecting the root packages for the EMF project creation [message #65843 is a reply to message #65727] Wed, 27 December 2006 16:32 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Tony,

Using the constraint checking I committed for
https://bugs.eclipse.org/bugs/show_bug.cgi?id=75933 the other day, it
tells me that your first package has a null nsURI where a unique
non-null one is required. (And the second package has an nsPrefix
that's an empty string, which will get you into other problems later.)


Tony ROSTREN wrote:
> Hi,
>
> I try to create an EMF project with this Ecore metamodel.
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xmi:XMI xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
> <ecore:EPackage name="PrimitiveTypes">
> <eClassifiers xsi:type="ecore:EDataType" name="Integer"
> instanceClassName="int"/>
> <eClassifiers xsi:type="ecore:EDataType" name="String"
> instanceClassName="java.lang.String"/>
> <eClassifiers xsi:type="ecore:EDataType" name="Boolean"
> instanceClassName="boolean"/>
> <eClassifiers xsi:type="ecore:EDataType" name="Double"
> instanceClassName="double"/>
> </ecore:EPackage>
> <ecore:EPackage name="RelationalDBSchema" nsURI="RelationalDBSchema"
> nsPrefix="">
> <eClassifiers xsi:type="ecore:EClass" name="NamedElement"
> abstract="true">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
> ordered="false"
> unique="false" lowerBound="1" eType="#/0/String"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="DataBase"
> eSuperTypes="#/1/NamedElement">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="SGBDname"
> ordered="false"
> unique="false" lowerBound="1" eType="#/0/String"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="tables"
> ordered="false"
> upperBound="-1" eType="#/1/Table" containment="true"
> eOpposite="#/1/Table/database"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Table"
> eSuperTypes="#/1/NamedElement">
> <eStructuralFeatures xsi:type="ecore:EReference" name="database"
> ordered="false"
> lowerBound="1" eType="#/1/DataBase"
> eOpposite="#/1/DataBase/tables"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="columns"
> upperBound="-1"
> eType="#/1/Column" containment="true"
> eOpposite="#/1/Column/owner"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="key"
> ordered="false"
> upperBound="-1" eType="#/1/Column"
> eOpposite="#/1/Column/keyOf"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Column"
> eSuperTypes="#/1/NamedElement">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="dataType"
> ordered="false"
> unique="false" lowerBound="1" eType="#/0/String"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="null"
> ordered="false"
> unique="false" lowerBound="1" eType="#/0/Boolean"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute"
> name="defaultValue" ordered="false"
> unique="false" lowerBound="1" eType="#/0/String"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="owner"
> ordered="false"
> lowerBound="1" eType="#/1/Table" eOpposite="#/1/Table/columns"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="keyOf"
> ordered="false"
> eType="#/1/Table" eOpposite="#/1/Table/key"/>
> </eClassifiers>
> </ecore:EPackage>
> </xmi:XMI>
>
>
> the problem comes when i need to choose the root package. I can only
> select the first one. If i select the second one, an error occurs. The
> logs are below :
>
> !ENTRY org.eclipse.jface 4 2 2006-12-27 10:37:02.266 !MESSAGE Problems
> occurred when invoking code from plug-in: "org.eclipse.jface". !STACK
> 0 java.lang.NullPointerException at
> org.eclipse.emf.converter.util.ConverterUtil.computeRequired Packages(ConverterUtil.java:392)
> at
> org.eclipse.emf.converter.ui.contribution.base.ModelConverte rPackagePage.validate(ModelConverterPackagePage.java:829)
> at
> org.eclipse.emf.importer.ui.contribution.base.ModelImporterP ackagePage.validate(ModelImporterPackagePage.java:95)
> at
> org.eclipse.emf.converter.ui.contribution.base.ModelConverte rPackagePage.ePackageCheckStateChanged(ModelConverterPackage Page.java:452)
> at
> org.eclipse.emf.converter.ui.contribution.base.ModelConverte rPackagePage$4.checkStateChanged(ModelConverterPackagePage.j ava:274)
> at
> org.eclipse.jface.viewers.CheckboxTableViewer$1.run(Checkbox TableViewer.java:177)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> at org.eclipse.core.runtime.Platform.run(Platform.java:843)
> ...
> If I only select the first package, the project is generated but in
> the genmodel file, there is only the first package.
>
> I have tested with Eclipse 3.2.1 and EMF 2.2.1.
>
> Regards,
>
> Tony ROSTREN
>
>
>
>
>
>
>
>
Re: pb when selecting the root packages for the EMF project creation [message #600355 is a reply to message #65727] Wed, 27 December 2006 16:32 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31770
Registered: July 2009
Senior Member
Tony,

Using the constraint checking I committed for
https://bugs.eclipse.org/bugs/show_bug.cgi?id=75933 the other day, it
tells me that your first package has a null nsURI where a unique
non-null one is required. (And the second package has an nsPrefix
that's an empty string, which will get you into other problems later.)


Tony ROSTREN wrote:
> Hi,
>
> I try to create an EMF project with this Ecore metamodel.
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xmi:XMI xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
> <ecore:EPackage name="PrimitiveTypes">
> <eClassifiers xsi:type="ecore:EDataType" name="Integer"
> instanceClassName="int"/>
> <eClassifiers xsi:type="ecore:EDataType" name="String"
> instanceClassName="java.lang.String"/>
> <eClassifiers xsi:type="ecore:EDataType" name="Boolean"
> instanceClassName="boolean"/>
> <eClassifiers xsi:type="ecore:EDataType" name="Double"
> instanceClassName="double"/>
> </ecore:EPackage>
> <ecore:EPackage name="RelationalDBSchema" nsURI="RelationalDBSchema"
> nsPrefix="">
> <eClassifiers xsi:type="ecore:EClass" name="NamedElement"
> abstract="true">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
> ordered="false"
> unique="false" lowerBound="1" eType="#/0/String"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="DataBase"
> eSuperTypes="#/1/NamedElement">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="SGBDname"
> ordered="false"
> unique="false" lowerBound="1" eType="#/0/String"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="tables"
> ordered="false"
> upperBound="-1" eType="#/1/Table" containment="true"
> eOpposite="#/1/Table/database"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Table"
> eSuperTypes="#/1/NamedElement">
> <eStructuralFeatures xsi:type="ecore:EReference" name="database"
> ordered="false"
> lowerBound="1" eType="#/1/DataBase"
> eOpposite="#/1/DataBase/tables"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="columns"
> upperBound="-1"
> eType="#/1/Column" containment="true"
> eOpposite="#/1/Column/owner"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="key"
> ordered="false"
> upperBound="-1" eType="#/1/Column"
> eOpposite="#/1/Column/keyOf"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Column"
> eSuperTypes="#/1/NamedElement">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="dataType"
> ordered="false"
> unique="false" lowerBound="1" eType="#/0/String"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="null"
> ordered="false"
> unique="false" lowerBound="1" eType="#/0/Boolean"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute"
> name="defaultValue" ordered="false"
> unique="false" lowerBound="1" eType="#/0/String"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="owner"
> ordered="false"
> lowerBound="1" eType="#/1/Table" eOpposite="#/1/Table/columns"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="keyOf"
> ordered="false"
> eType="#/1/Table" eOpposite="#/1/Table/key"/>
> </eClassifiers>
> </ecore:EPackage>
> </xmi:XMI>
>
>
> the problem comes when i need to choose the root package. I can only
> select the first one. If i select the second one, an error occurs. The
> logs are below :
>
> !ENTRY org.eclipse.jface 4 2 2006-12-27 10:37:02.266 !MESSAGE Problems
> occurred when invoking code from plug-in: "org.eclipse.jface". !STACK
> 0 java.lang.NullPointerException at
> org.eclipse.emf.converter.util.ConverterUtil.computeRequired Packages(ConverterUtil.java:392)
> at
> org.eclipse.emf.converter.ui.contribution.base.ModelConverte rPackagePage.validate(ModelConverterPackagePage.java:829)
> at
> org.eclipse.emf.importer.ui.contribution.base.ModelImporterP ackagePage.validate(ModelImporterPackagePage.java:95)
> at
> org.eclipse.emf.converter.ui.contribution.base.ModelConverte rPackagePage.ePackageCheckStateChanged(ModelConverterPackage Page.java:452)
> at
> org.eclipse.emf.converter.ui.contribution.base.ModelConverte rPackagePage$4.checkStateChanged(ModelConverterPackagePage.j ava:274)
> at
> org.eclipse.jface.viewers.CheckboxTableViewer$1.run(Checkbox TableViewer.java:177)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> at org.eclipse.core.runtime.Platform.run(Platform.java:843)
> ...
> If I only select the first package, the project is generated but in
> the genmodel file, there is only the first package.
>
> I have tested with Eclipse 3.2.1 and EMF 2.2.1.
>
> Regards,
>
> Tony ROSTREN
>
>
>
>
>
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:pb when selecting the root packages for the EMF project creation
Next Topic:Question about CDO - is it possible to disconnect from server?
Goto Forum:
  


Current Time: Sat Feb 27 22:36:17 GMT 2021

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

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

Back to the top