| Re:[ATL]Launching ATL programmatically [message #1621] | 
Tue, 19 December 2006 03:12   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: dorazio.nicola.yahoo.it 
 
Hi Freddy, 
I look your example, but I don't know why my error came from. 
 
Why java cannot resolve path if I see by debug that the value of  
function input = amh.loadModel("IN", emfmm1, inputm_url.openStream());  
are all ok? Why when the program goes into this function when it call  
the class URI.class return a null value? 
 
This is my console output 
java.lang.NullPointerException 
	at  
 org.eclipse.emf.ecore.plugin.EcorePlugin.resolvePlatformReso urcePath(EcorePlugin.java:132) 
	at  
 org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createP latformResourceInputStream(URIConverterImpl.java:538) 
	at  
 org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createI nputStream(URIConverterImpl.java:442) 
	at  
 org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:1674) 
	at  
 org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:1568) 
	at  
 org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:717) 
	at  
 org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:779) 
	at  
 org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:462) 
	at  
 org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:65) 
	at  
 org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:449) 
	at  
 org.eclipse.emf.ecore.xmi.impl.SAXWrapper.startElement(SAXWr apper.java:73) 
	at  
 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown  
Source) 
	at  
 com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator. startElement(Unknown  
Source) 
	at  
 com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown  
Source) 
	at  
 com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl$ContentDispatcher.scanRootElementHook(Unknown  
Source) 
	at  
 com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDispatcher.dispatch(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 javax.xml.parsers.SAXParser.parse(Unknown Source) 
	at  org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:140) 
	at  
 org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:169) 
	at  
 org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:977) 
	at  
 org.atl.engine.repositories.emf4atl.ASMEMFModel.loadASMEMFMo del(ASMEMFModel.java:167) 
	at  
 org.atl.eclipse.engine.AtlEMFModelHandler.loadModel(AtlEMFMo delHandler.java:77) 
	at ATLExample.launchTransformation(ATLExample.java:64) 
	at ATLExample.run(ATLExample.java:97) 
	at Main.main(Main.java:21) 
 
My transformation runs great by graphic interface... I don't know why  
there is so much problem from java. 
 
please help me.. 
 
Best regard 
 
Nicola D'Orazio
 |  
 |  
  | 
| Re: [ATL]Launching ATL programmatically [message #1635 is a reply to message #1621] | 
Tue, 19 December 2006 05:34    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hello, 
 
Your problem seems to be that you run EMF outside of Eclipse but try to  
have it resolve an Eclipse platform path nonetheless. 
What is the path of the model you are trying to open? 
 
Another solution would be to try one of the other  
AtlEMFModelHandler.loadModel methods. 
For instance, using an InputStream: 
loadModel(name, metamodel, new FileInputStream("<file path>")) 
 
Note that you may still want to use an EMF URI so that inter-model  
references (e.g., for UML models using UML profiles) are resolved  
correctly. However, you have to make sure not to use an Eclipse platform  
path. 
 
 
Frédéric Jouault 
 
 
Nicola D'Orazio wrote: 
> Hi Freddy, 
> I look your example, but I don't know why my error came from. 
>  
> Why java cannot resolve path if I see by debug that the value of  
> function input = amh.loadModel("IN", emfmm1, inputm_url.openStream());  
> are all ok? Why when the program goes into this function when it call  
> the class URI.class return a null value? 
>  
> This is my console output 
> java.lang.NullPointerException 
>     at  
>  org.eclipse.emf.ecore.plugin.EcorePlugin.resolvePlatformReso urcePath(EcorePlugin.java:132)  
>  
>     at  
>  org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createP latformResourceInputStream(URIConverterImpl.java:538)  
>  
>     at  
>  org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createI nputStream(URIConverterImpl.java:442)  
>  
>     at  
>  org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:1674)  
>  
>     at  
>  org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:1568)  
>  
>     at  
>  org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:717)  
>  
>     at  
>  org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:779)  
>  
>     at  
>  org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:462)  
>  
>     at  
>  org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:65)  
>  
>     at  
>  org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:449) 
>     at  
>  org.eclipse.emf.ecore.xmi.impl.SAXWrapper.startElement(SAXWr apper.java:73) 
>     at  
>  com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown  
> Source) 
>     at  
>  com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator. startElement(Unknown  
> Source) 
>     at  
>  com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown  
> Source) 
>     at  
>  com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl$ContentDispatcher.scanRootElementHook(Unknown  
> Source) 
>     at  
>  com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDispatcher.dispatch(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 javax.xml.parsers.SAXParser.parse(Unknown Source) 
>     at  
>  org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:140) 
>     at  
>  org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:169)  
>  
>     at  
>  org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:977)  
>  
>     at  
>  org.atl.engine.repositories.emf4atl.ASMEMFModel.loadASMEMFMo del(ASMEMFModel.java:167)  
>  
>     at  
>  org.atl.eclipse.engine.AtlEMFModelHandler.loadModel(AtlEMFMo delHandler.java:77)  
>  
>     at ATLExample.launchTransformation(ATLExample.java:64) 
>     at ATLExample.run(ATLExample.java:97) 
>     at Main.main(Main.java:21) 
>  
> My transformation runs great by graphic interface... I don't know why  
> there is so much problem from java. 
>  
> please help me.. 
>  
> Best regard 
>  
> Nicola D'Orazio
 |  
 |  
  | 
 | 
 | 
| Re: [ATL]Launching ATL programmatically [message #2782 is a reply to message #1648] | 
Tue, 26 December 2006 07:11   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hello, 
 
I extended the related Howto with links to discussions threads related  
to this issue: 
 http://wiki.eclipse.org/index.php/ATL_Howtos#How_do_I_launch _transformations_programmatically.3F 
 
You may want to compare your approach to those discussed in these threads. 
 
Additionally, there is now a link to Dennis'ATL command line tools,  
which may better illustrate the situation than KM3Projector, which  
actually runs in Eclipse. 
 
 
Regards, 
 
Frédéric Jouault 
 
 
Nicola D'Orazio wrote: 
> Frédéric Jouault wrote: 
>> Hello, 
>> 
>> Your problem seems to be that you run EMF outside of Eclipse but try  
>> to have it resolve an Eclipse platform path nonetheless. 
>> What is the path of the model you are trying to open? 
>  
> is a path located under the eclipse workspace 
>  
>> 
>> Another solution would be to try one of the other  
>> AtlEMFModelHandler.loadModel methods. 
>> For instance, using an InputStream: 
>> loadModel(name, metamodel, new FileInputStream("<file path>")) 
>  
> I try it but the error is the same... 
>  
>> 
>> Note that you may still want to use an EMF URI so that inter-model  
>> references (e.g., for UML models using UML profiles) are resolved  
>> correctly. However, you have to make sure not to use an Eclipse  
>> platform path. 
>> 
>  
> Sorry but I don't understand this part of the message 
>  
>> 
>> Frédéric Jouault 
>  
> Thank you for your reply 
>  
> Best regard 
> Nicola D'Orazio
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.66530 seconds