|
Re: Add classes to my UML2 model via java code [message #477697 is a reply to message #477696] |
Tue, 02 September 2008 15:48 |
Tim Myer Messages: 81 Registered: July 2009 |
Member |
|
|
Hi Pierre,
Have you tried code similar to this example?
package org.search.jiem.uml.util;
import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Model;
import org.eclipse.uml2.uml.UMLFactory;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.resource.UMLResource;
public class ClassAdder {
public static void addClassesToModel(final EditingDomain editingDomain) {
final URI uri = URI.createURI("path/to/uml/resource");
final UMLResource resource = (UMLResource)
editingDomain.getResourceSet().getResource(uri, true);
final Model model = (Model) resource.getContents().get(0);
final Class class1 = UMLFactory.eINSTANCE.createClass();
final Class class2 = UMLFactory.eINSTANCE.createClass();
final CompoundCommand command = new CompoundCommand();
command.append(AddCommand.create(editingDomain, model,
UMLPackage.PACKAGE__PACKAGED_ELEMENT, class1));
command.append(AddCommand.create(editingDomain, model,
UMLPackage.PACKAGE__PACKAGED_ELEMENT, class2));
editingDomain.getCommandStack().execute(command);
}
}
Hope that helps,
-----Tim------
Pierre wrote:
> Hello,
>
> I'm currently searching an EMF project which could enable me to add
> "easily" classes to my UML2 project. A sort of algorithm like this :
>
> Load UML Resource
> Add Class 1
> Add Class 2
> Save UML Resource
>
> Could you please tell me what is the best one for modifying my model
> please ?
>
> Thanks for your support.
>
> Regards,
>
> P.
>
|
|
|
Re: Add classes to my UML2 model via java code [message #477698 is a reply to message #477697] |
Tue, 02 September 2008 15:50 |
Tim Myer Messages: 81 Registered: July 2009 |
Member |
|
|
I left off these last lines for saving the resource after the commands
have been executed:
try {
resource.save(resource.getDefaultSaveOptions());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Tim Myer wrote:
> Hi Pierre,
> Have you tried code similar to this example?
>
> package org.search.jiem.uml.util;
>
> import org.eclipse.emf.common.command.CompoundCommand;
> import org.eclipse.emf.common.util.URI;
> import org.eclipse.emf.edit.command.AddCommand;
> import org.eclipse.emf.edit.domain.EditingDomain;
> import org.eclipse.uml2.uml.Class;
> import org.eclipse.uml2.uml.Model;
> import org.eclipse.uml2.uml.UMLFactory;
> import org.eclipse.uml2.uml.UMLPackage;
> import org.eclipse.uml2.uml.resource.UMLResource;
>
> public class ClassAdder {
>
> public static void addClassesToModel(final EditingDomain
> editingDomain) {
> final URI uri = URI.createURI("path/to/uml/resource");
> final UMLResource resource = (UMLResource)
> editingDomain.getResourceSet().getResource(uri, true);
> final Model model = (Model) resource.getContents().get(0);
> final Class class1 = UMLFactory.eINSTANCE.createClass();
> final Class class2 = UMLFactory.eINSTANCE.createClass();
> final CompoundCommand command = new CompoundCommand();
> command.append(AddCommand.create(editingDomain, model,
> UMLPackage.PACKAGE__PACKAGED_ELEMENT, class1));
> command.append(AddCommand.create(editingDomain, model,
> UMLPackage.PACKAGE__PACKAGED_ELEMENT, class2));
> editingDomain.getCommandStack().execute(command);
> }
> }
>
> Hope that helps,
> -----Tim------
>
>
> Pierre wrote:
>> Hello,
>>
>> I'm currently searching an EMF project which could enable me to add
>> "easily" classes to my UML2 project. A sort of algorithm like this :
>>
>> Load UML Resource
>> Add Class 1
>> Add Class 2
>> Save UML Resource
>>
>> Could you please tell me what is the best one for modifying my model
>> please ?
>>
>> Thanks for your support.
>>
>> Regards,
>>
>> P.
>>
|
|
|
|
|
|
|
Re: Add classes to my UML2 model via java code [message #477998 is a reply to message #477708] |
Fri, 21 November 2008 15:25 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Pierre,
Did you manage to figure out the NullPointerException?
Some set-up code is needed for stand-alone projects, you may be missing some
mappings.
Cheers,
- James.
"Pierre " <p.tamisier@netfective.com> wrote in message
news:41c78135e2e7bb053d01cbfa42f406f8$1@www.eclipse.org...
> Thanks Rafael. I used the example provided at the end of
> http://www.eclipse.org/newsportal/thread.php?group=eclipse.m odeling.mdt.uml2
>
> I want to do exactly the same thing but instead of creating a new model, I
> want to load an existing one. So I created this method :
>
> protected static org.eclipse.uml2.uml.Model loadModel(URI uri) {
> org.eclipse.uml2.uml.Model model_ = null;
>
> try {
> Resource resource = RESOURCE_SET.getResource(uri, true);
>
> model_ = (org.eclipse.uml2.uml.Model) EcoreUtil
> .getObjectByType(resource.getContents(),
> UMLPackage.Literals.MODEL);
> } catch (WrappedException we) {
> err(we.getMessage());
> System.exit(1);
> }
>
> return model_;
> }
>
> And in my Main method, I do :
>
> Model model =
> loadModel(URI.createFileURI("D:/workspace/EMFP/model/modeltest.uml "));
>
> But I get this exception :
>
> Exception in thread "main" java.lang.NullPointerException
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFe atureType(XMLHandler.java:2132)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHa ndler.java:2010)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHa ndler.java:131)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH andler.java:1789)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1013)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:991)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:711)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2516)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2397)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1275)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1444)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1009)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:991)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:711)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2516)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2397)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1275)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1444)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1009)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:991)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:711)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2516)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2397)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1275)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1444)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1009)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:991)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:711)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1210)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
> at UML2Article.loadModel(UML2Article.java:114)
> at GettingStartedWithUML2.main(GettingStartedWithUML2.java:223)
>
>
> Notice that the line "Resource resource = RESOURCE_SET.getResource(uri,
> true);" is very long to execute in debug mode. And the exception is got at
> this line.
>
> Any hint would be very appreciated.
> Thanks !
>
> Regards,
>
> P.
>
|
|
|
Re: Add classes to my UML2 model via java code [message #626891 is a reply to message #477696] |
Tue, 02 September 2008 15:48 |
Tim Myer Messages: 81 Registered: July 2009 |
Member |
|
|
Hi Pierre,
Have you tried code similar to this example?
package org.search.jiem.uml.util;
import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Model;
import org.eclipse.uml2.uml.UMLFactory;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.resource.UMLResource;
public class ClassAdder {
public static void addClassesToModel(final EditingDomain editingDomain) {
final URI uri = URI.createURI("path/to/uml/resource");
final UMLResource resource = (UMLResource)
editingDomain.getResourceSet().getResource(uri, true);
final Model model = (Model) resource.getContents().get(0);
final Class class1 = UMLFactory.eINSTANCE.createClass();
final Class class2 = UMLFactory.eINSTANCE.createClass();
final CompoundCommand command = new CompoundCommand();
command.append(AddCommand.create(editingDomain, model,
UMLPackage.PACKAGE__PACKAGED_ELEMENT, class1));
command.append(AddCommand.create(editingDomain, model,
UMLPackage.PACKAGE__PACKAGED_ELEMENT, class2));
editingDomain.getCommandStack().execute(command);
}
}
Hope that helps,
-----Tim------
Pierre wrote:
> Hello,
>
> I'm currently searching an EMF project which could enable me to add
> "easily" classes to my UML2 project. A sort of algorithm like this :
>
> Load UML Resource
> Add Class 1
> Add Class 2
> Save UML Resource
>
> Could you please tell me what is the best one for modifying my model
> please ?
>
> Thanks for your support.
>
> Regards,
>
> P.
>
|
|
|
Re: Add classes to my UML2 model via java code [message #626892 is a reply to message #477697] |
Tue, 02 September 2008 15:50 |
Tim Myer Messages: 81 Registered: July 2009 |
Member |
|
|
I left off these last lines for saving the resource after the commands
have been executed:
try {
resource.save(resource.getDefaultSaveOptions());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Tim Myer wrote:
> Hi Pierre,
> Have you tried code similar to this example?
>
> package org.search.jiem.uml.util;
>
> import org.eclipse.emf.common.command.CompoundCommand;
> import org.eclipse.emf.common.util.URI;
> import org.eclipse.emf.edit.command.AddCommand;
> import org.eclipse.emf.edit.domain.EditingDomain;
> import org.eclipse.uml2.uml.Class;
> import org.eclipse.uml2.uml.Model;
> import org.eclipse.uml2.uml.UMLFactory;
> import org.eclipse.uml2.uml.UMLPackage;
> import org.eclipse.uml2.uml.resource.UMLResource;
>
> public class ClassAdder {
>
> public static void addClassesToModel(final EditingDomain
> editingDomain) {
> final URI uri = URI.createURI("path/to/uml/resource");
> final UMLResource resource = (UMLResource)
> editingDomain.getResourceSet().getResource(uri, true);
> final Model model = (Model) resource.getContents().get(0);
> final Class class1 = UMLFactory.eINSTANCE.createClass();
> final Class class2 = UMLFactory.eINSTANCE.createClass();
> final CompoundCommand command = new CompoundCommand();
> command.append(AddCommand.create(editingDomain, model,
> UMLPackage.PACKAGE__PACKAGED_ELEMENT, class1));
> command.append(AddCommand.create(editingDomain, model,
> UMLPackage.PACKAGE__PACKAGED_ELEMENT, class2));
> editingDomain.getCommandStack().execute(command);
> }
> }
>
> Hope that helps,
> -----Tim------
>
>
> Pierre wrote:
>> Hello,
>>
>> I'm currently searching an EMF project which could enable me to add
>> "easily" classes to my UML2 project. A sort of algorithm like this :
>>
>> Load UML Resource
>> Add Class 1
>> Add Class 2
>> Save UML Resource
>>
>> Could you please tell me what is the best one for modifying my model
>> please ?
>>
>> Thanks for your support.
>>
>> Regards,
>>
>> P.
>>
|
|
|
|
|
|
|
Re: Add classes to my UML2 model via java code [message #627215 is a reply to message #477708] |
Fri, 21 November 2008 15:25 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Pierre,
Did you manage to figure out the NullPointerException?
Some set-up code is needed for stand-alone projects, you may be missing some
mappings.
Cheers,
- James.
"Pierre " <p.tamisier@netfective.com> wrote in message
news:41c78135e2e7bb053d01cbfa42f406f8$1@www.eclipse.org...
> Thanks Rafael. I used the example provided at the end of
> http://www.eclipse.org/newsportal/thread.php?group=eclipse.m odeling.mdt.uml2
>
> I want to do exactly the same thing but instead of creating a new model, I
> want to load an existing one. So I created this method :
>
> protected static org.eclipse.uml2.uml.Model loadModel(URI uri) {
> org.eclipse.uml2.uml.Model model_ = null;
>
> try {
> Resource resource = RESOURCE_SET.getResource(uri, true);
>
> model_ = (org.eclipse.uml2.uml.Model) EcoreUtil
> .getObjectByType(resource.getContents(),
> UMLPackage.Literals.MODEL);
> } catch (WrappedException we) {
> err(we.getMessage());
> System.exit(1);
> }
>
> return model_;
> }
>
> And in my Main method, I do :
>
> Model model =
> loadModel(URI.createFileURI("D:/workspace/EMFP/model/modeltest.uml "));
>
> But I get this exception :
>
> Exception in thread "main" java.lang.NullPointerException
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFe atureType(XMLHandler.java:2132)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHa ndler.java:2010)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHa ndler.java:131)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH andler.java:1789)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1013)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:991)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:711)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2516)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2397)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1275)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1444)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1009)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:991)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:711)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2516)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2397)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1275)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1444)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1009)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:991)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:711)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2516)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2397)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1275)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1444)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1009)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:991)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:711)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1210)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
> at UML2Article.loadModel(UML2Article.java:114)
> at GettingStartedWithUML2.main(GettingStartedWithUML2.java:223)
>
>
> Notice that the line "Resource resource = RESOURCE_SET.getResource(uri,
> true);" is very long to execute in debug mode. And the exception is got at
> this line.
>
> Any hint would be very appreciated.
> Thanks !
>
> Regards,
>
> P.
>
|
|
|
Powered by
FUDForum. Page generated in 0.04368 seconds