Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Service Component Architecture (SCA) Tools » ecore model instance
ecore model instance [message #7585] Mon, 02 March 2009 10:22 Go to next message
Mischa is currently offline Mischa
Messages: 14
Registered: July 2009
Junior Member
Hi all,

is it possible to access a SCA model instance in a "Ecore like" way (SCA
meta model is already defined using EMF)? Currently I have a "xyz.composite"
xml file conforming to the http://www.osoa.org/xmlns/sca/1.0 namespace.
A xyz.ecore / xyz.xmi would be great, in particular to apply the oAW
generator framework.

Thanks in advance,

Mischa
Re: ecore model instance [message #7610 is a reply to message #7585] Mon, 02 March 2009 11:18 Go to previous messageGo to next message
Stephane Drapeau is currently offline Stephane Drapeau
Messages: 198
Registered: July 2009
Senior Member
Mischa a écrit :
> Hi all,
>
> is it possible to access a SCA model instance in a "Ecore like" way (SCA
> meta model is already defined using EMF)? Currently I have a
> "xyz.composite" xml file conforming to the
> http://www.osoa.org/xmlns/sca/1.0 namespace.
> A xyz.ecore / xyz.xmi would be great, in particular to apply the oAW
> generator framework.
>
> Thanks in advance,
>
> Mischa

Hi,

The EMF meta model of SCA (.ecore + .genmodel + java code) is defined
and available in the plugin org.eclipse.stp.sca. So, I think that you
have all you need to parse an SCA model with the oAW generator. Compared
to an XMI model, remember that an XML model has a root element named
"DocumentRoot".

I successfully tried with Acceleo (a great code generator).

Stephane Drapeau
Obeo
Re: ecore model instance [message #7652 is a reply to message #7610] Thu, 05 March 2009 16:15 Go to previous messageGo to next message
Mischa is currently offline Mischa
Messages: 14
Registered: July 2009
Junior Member
Hi,

now I tried loading the XML using the Ecore mechanism. Unfortunately it
failed. When using the ScaResourceImpl I get into trouble since the
implementation can't hanlde the eclipse "platform" scheme
(java.net.MalformedURLException: unknown protocol: platform).

As an alternativ I tried the defualt XMLResourceImpl which inturn can't load
the composite root element (Class 'composite' not found).

What's the right way to load the ".composite" XML file?

Regards,
Mischa



"Stephane Drapeau" <Stephane.Drapeau@obeo.fr> schrieb im Newsbeitrag
news:49AC06BC.809@obeo.fr...
> Mischa a écrit :
>> Hi all,
>>
>> is it possible to access a SCA model instance in a "Ecore like" way (SCA
>> meta model is already defined using EMF)? Currently I have a
>> "xyz.composite" xml file conforming to the
>> http://www.osoa.org/xmlns/sca/1.0 namespace.
>> A xyz.ecore / xyz.xmi would be great, in particular to apply the oAW
>> generator framework.
>>
>> Thanks in advance,
>>
>> Mischa
>
> Hi,
>
> The EMF meta model of SCA (.ecore + .genmodel + java code) is defined and
> available in the plugin org.eclipse.stp.sca. So, I think that you have all
> you need to parse an SCA model with the oAW generator. Compared to an XMI
> model, remember that an XML model has a root element named "DocumentRoot".
>
> I successfully tried with Acceleo (a great code generator).
>
> Stephane Drapeau
> Obeo
Re: ecore model instance [message #7672 is a reply to message #7652] Fri, 06 March 2009 05:30 Go to previous messageGo to next message
Stephane Drapeau is currently offline Stephane Drapeau
Messages: 198
Registered: July 2009
Senior Member
Mischa a écrit :
> Hi,
>
> now I tried loading the XML using the Ecore mechanism. Unfortunately it
> failed. When using the ScaResourceImpl I get into trouble since the
> implementation can't hanlde the eclipse "platform" scheme
> (java.net.MalformedURLException: unknown protocol: platform).

This should work.
Have a look at ScaExample.java (plugin org.eclipse.stp.sca.test) and at
URI.createPlatformResourceURI(String, boolean).
Moreover, to create the Resource, use the SCAResourceFactoryImpl.

Stephane Drapeau
Obeo
Re: ecore model instance [message #7692 is a reply to message #7672] Fri, 06 March 2009 08:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25942
Registered: July 2009
Senior Member
Stephane,

What the failure tells me is that Mischa is most likely not running as
an OSGi application. Eclipse registers the "platform" protocol properly
so a URL using it should work properly...


Stephane Drapeau wrote:
> Mischa a écrit :
>> Hi,
>>
>> now I tried loading the XML using the Ecore mechanism. Unfortunately
>> it failed. When using the ScaResourceImpl I get into trouble since
>> the implementation can't hanlde the eclipse "platform" scheme
>> (java.net.MalformedURLException: unknown protocol: platform).
>
> This should work.
> Have a look at ScaExample.java (plugin org.eclipse.stp.sca.test) and
> at URI.createPlatformResourceURI(String, boolean).
> Moreover, to create the Resource, use the SCAResourceFactoryImpl.
>
> Stephane Drapeau
> Obeo
Re: ecore model instance [message #7712 is a reply to message #7692] Fri, 06 March 2009 13:34 Go to previous messageGo to next message
Mischa is currently offline Mischa
Messages: 14
Registered: July 2009
Junior Member
Hi Stephane, Hi Ed,

thanks for helpful support. Let me add some more details.
Of course I used the "ScaResourceFactoryImpl" like shown in the following
code snippet (The hardcoded extension was only for testing purpose).

resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(
"composite",
new ScaResourceFactoryImpl()
);

I'm not definitely sure whether I'm running on an OSGi environment but I
launched the App inside Eclipse as a oAW workflow which as far as I now is
running on Eclipse plattform. Furthere more the occuring Execption depicts
that the ScaResourceImpl overloads the load() method an calls some nativ
java code to parse the URI:

Caused by: java.net.MalformedURLException: unknown protocol: platform
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at org.eclipse.stp.sca.util.ScaResourceImpl.load(ScaResourceImp l.java:72)

I'll follow your suggestions and try to find the cause of my problem, I'll
post the solution when I fixed it.

Mischa


"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
news:gor6qb$l3o$2@build.eclipse.org...
> Stephane,
>
> What the failure tells me is that Mischa is most likely not running as an
> OSGi application. Eclipse registers the "platform" protocol properly so a
> URL using it should work properly...
>
>
> Stephane Drapeau wrote:
>> Mischa a écrit :
>>> Hi,
>>>
>>> now I tried loading the XML using the Ecore mechanism. Unfortunately it
>>> failed. When using the ScaResourceImpl I get into trouble since the
>>> implementation can't hanlde the eclipse "platform" scheme
>>> (java.net.MalformedURLException: unknown protocol: platform).
>>
>> This should work.
>> Have a look at ScaExample.java (plugin org.eclipse.stp.sca.test) and at
>> URI.createPlatformResourceURI(String, boolean).
>> Moreover, to create the Resource, use the SCAResourceFactoryImpl.
>>
>> Stephane Drapeau
>> Obeo
>
Re: ecore model instance [message #7733 is a reply to message #7712] Fri, 06 March 2009 14:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25942
Registered: July 2009
Senior Member
Mischa,

Comments below.

Mischa wrote:
> Hi Stephane, Hi Ed,
>
> thanks for helpful support. Let me add some more details.
> Of course I used the "ScaResourceFactoryImpl" like shown in the
> following code snippet (The hardcoded extension was only for testing
> purpose).
>
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(
> "composite",
> new ScaResourceFactoryImpl()
> );
>
> I'm not definitely sure whether I'm running on an OSGi environment but
> I launched the App inside Eclipse as a oAW workflow which as far as I
> now is running on Eclipse plattform.
I'm quite sure that a workflow runs as a standard Java application,
i.e., what you get when you do "Run As->Java Application" rather than
what you get when you do "Run As->Eclipse Application". Don't confuse
where you run it from with how its running.
> Furthere more the occuring Execption depicts that the ScaResourceImpl
> overloads the load() method an calls some nativ java code to parse the
> URI:
>
> Caused by: java.net.MalformedURLException: unknown protocol: platform
> at java.net.URL.<init>(Unknown Source)
> at java.net.URL.<init>(Unknown Source)
> at java.net.URL.<init>(Unknown Source)
> at org.eclipse.stp.sca.util.ScaResourceImpl.load(ScaResourceImp l.java:72)
Who is specifying the URL that's being used. You can't use a
platform:/resource or platform:/plugin URL if you are running as a
standard Java Application.
>
> I'll follow your suggestions and try to find the cause of my problem,
> I'll post the solution when I fixed it.
You'll likely need to use file: URI like what you get with
URI.createFileURI. Be sure the file path is absolute, i.e., use
java.io.File.getAbsolutePath...
>
> Mischa
>
>
> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
> news:gor6qb$l3o$2@build.eclipse.org...
>> Stephane,
>>
>> What the failure tells me is that Mischa is most likely not running
>> as an OSGi application. Eclipse registers the "platform" protocol
>> properly so a URL using it should work properly...
>>
>>
>> Stephane Drapeau wrote:
>>> Mischa a écrit :
>>>> Hi,
>>>>
>>>> now I tried loading the XML using the Ecore mechanism.
>>>> Unfortunately it failed. When using the ScaResourceImpl I get into
>>>> trouble since the implementation can't hanlde the eclipse
>>>> "platform" scheme (java.net.MalformedURLException: unknown
>>>> protocol: platform).
>>>
>>> This should work.
>>> Have a look at ScaExample.java (plugin org.eclipse.stp.sca.test) and
>>> at URI.createPlatformResourceURI(String, boolean).
>>> Moreover, to create the Resource, use the SCAResourceFactoryImpl.
>>>
>>> Stephane Drapeau
>>> Obeo
>>
>
Re: ecore model instance [message #7753 is a reply to message #7733] Sat, 07 March 2009 08:20 Go to previous messageGo to next message
Mischa is currently offline Mischa
Messages: 14
Registered: July 2009
Junior Member
Once again, thx for help.

Ed, referencing my model instance (sca.composite) using the file: protocol
works great, like you told me. Unfortunately this works only when using the
default ResourceFactoryImpl which in turn make problems loading the
model-content (The issue i already mentioned, "Class 'composite' not
found").

Using the "ScaResourceFactoryImpl" I still run into the problem "unknown
protocol: platform", no matter whether I'm specifing the URI using the
file:/... notation (URI.createFileURI() woun't help either).

This seams to be the end of my SCA jouney since for me it looks like i can't
use the model out of Eclipse at the time being (using
"ScaResourceFactoryImpl()").
At least I gain insight into the EMF Persistence API and a more detailed
knowlede about what's an URI all about.




"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
news:gort5p$eph$1@build.eclipse.org...
> Mischa,
>
> Comments below.
>
> Mischa wrote:
>> Hi Stephane, Hi Ed,
>>
>> thanks for helpful support. Let me add some more details.
>> Of course I used the "ScaResourceFactoryImpl" like shown in the following
>> code snippet (The hardcoded extension was only for testing purpose).
>>
>> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(
>> "composite",
>> new ScaResourceFactoryImpl()
>> );
>>
>> I'm not definitely sure whether I'm running on an OSGi environment but I
>> launched the App inside Eclipse as a oAW workflow which as far as I now
>> is running on Eclipse plattform.
> I'm quite sure that a workflow runs as a standard Java application, i.e.,
> what you get when you do "Run As->Java Application" rather than what you
> get when you do "Run As->Eclipse Application". Don't confuse where you
> run it from with how its running.
>> Furthere more the occuring Execption depicts that the ScaResourceImpl
>> overloads the load() method an calls some nativ java code to parse the
>> URI:
>>
>> Caused by: java.net.MalformedURLException: unknown protocol: platform
>> at java.net.URL.<init>(Unknown Source)
>> at java.net.URL.<init>(Unknown Source)
>> at java.net.URL.<init>(Unknown Source)
>> at org.eclipse.stp.sca.util.ScaResourceImpl.load(ScaResourceImp l.java:72)
> Who is specifying the URL that's being used. You can't use a
> platform:/resource or platform:/plugin URL if you are running as a
> standard Java Application.
>>
>> I'll follow your suggestions and try to find the cause of my problem,
>> I'll post the solution when I fixed it.
> You'll likely need to use file: URI like what you get with
> URI.createFileURI. Be sure the file path is absolute, i.e., use
> java.io.File.getAbsolutePath...
>>
>> Mischa
>>
>>
>> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
>> news:gor6qb$l3o$2@build.eclipse.org...
>>> Stephane,
>>>
>>> What the failure tells me is that Mischa is most likely not running as
>>> an OSGi application. Eclipse registers the "platform" protocol properly
>>> so a URL using it should work properly...
>>>
>>>
>>> Stephane Drapeau wrote:
>>>> Mischa a écrit :
>>>>> Hi,
>>>>>
>>>>> now I tried loading the XML using the Ecore mechanism. Unfortunately
>>>>> it failed. When using the ScaResourceImpl I get into trouble since
>>>>> the implementation can't hanlde the eclipse "platform" scheme
>>>>> (java.net.MalformedURLException: unknown protocol: platform).
>>>>
>>>> This should work.
>>>> Have a look at ScaExample.java (plugin org.eclipse.stp.sca.test) and at
>>>> URI.createPlatformResourceURI(String, boolean).
>>>> Moreover, to create the Resource, use the SCAResourceFactoryImpl.
>>>>
>>>> Stephane Drapeau
>>>> Obeo
>>>
>>
>
Re: ecore model instance [message #7801 is a reply to message #7753] Thu, 12 March 2009 07:36 Go to previous message
Mischa is currently offline Mischa
Messages: 14
Registered: July 2009
Junior Member
Hi all,

now it works! I just build the org.eclipse.stp.sc.sca PlugIn from the trunk
(Where the whole load methode of the ScaResourceImpl is commented out).
With other words the official SCA version (0.9.0.200806121858) related to
Eclipse Ganymede won't work in standalone applications. Use the current
trunk version instead.

Best regrads,
Mischa

"Mischa" <Mischa.Hoechsmann@itemis.de> schrieb im Newsbeitrag
news:gotsb2$om2$1@build.eclipse.org...
> Once again, thx for help.
>
> Ed, referencing my model instance (sca.composite) using the file: protocol
> works great, like you told me. Unfortunately this works only when using
> the default ResourceFactoryImpl which in turn make problems loading the
> model-content (The issue i already mentioned, "Class 'composite' not
> found").
>
> Using the "ScaResourceFactoryImpl" I still run into the problem "unknown
> protocol: platform", no matter whether I'm specifing the URI using the
> file:/... notation (URI.createFileURI() woun't help either).
>
> This seams to be the end of my SCA jouney since for me it looks like i
> can't use the model out of Eclipse at the time being (using
> "ScaResourceFactoryImpl()").
> At least I gain insight into the EMF Persistence API and a more detailed
> knowlede about what's an URI all about.
>
>
>
>
> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
> news:gort5p$eph$1@build.eclipse.org...
>> Mischa,
>>
>> Comments below.
>>
>> Mischa wrote:
>>> Hi Stephane, Hi Ed,
>>>
>>> thanks for helpful support. Let me add some more details.
>>> Of course I used the "ScaResourceFactoryImpl" like shown in the
>>> following code snippet (The hardcoded extension was only for testing
>>> purpose).
>>>
>>> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(
>>> "composite",
>>> new ScaResourceFactoryImpl()
>>> );
>>>
>>> I'm not definitely sure whether I'm running on an OSGi environment but I
>>> launched the App inside Eclipse as a oAW workflow which as far as I now
>>> is running on Eclipse plattform.
>> I'm quite sure that a workflow runs as a standard Java application, i.e.,
>> what you get when you do "Run As->Java Application" rather than what you
>> get when you do "Run As->Eclipse Application". Don't confuse where you
>> run it from with how its running.
>>> Furthere more the occuring Execption depicts that the ScaResourceImpl
>>> overloads the load() method an calls some nativ java code to parse the
>>> URI:
>>>
>>> Caused by: java.net.MalformedURLException: unknown protocol: platform
>>> at java.net.URL.<init>(Unknown Source)
>>> at java.net.URL.<init>(Unknown Source)
>>> at java.net.URL.<init>(Unknown Source)
>>> at
>>> org.eclipse.stp.sca.util.ScaResourceImpl.load(ScaResourceImp l.java:72)
>> Who is specifying the URL that's being used. You can't use a
>> platform:/resource or platform:/plugin URL if you are running as a
>> standard Java Application.
>>>
>>> I'll follow your suggestions and try to find the cause of my problem,
>>> I'll post the solution when I fixed it.
>> You'll likely need to use file: URI like what you get with
>> URI.createFileURI. Be sure the file path is absolute, i.e., use
>> java.io.File.getAbsolutePath...
>>>
>>> Mischa
>>>
>>>
>>> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
>>> news:gor6qb$l3o$2@build.eclipse.org...
>>>> Stephane,
>>>>
>>>> What the failure tells me is that Mischa is most likely not running as
>>>> an OSGi application. Eclipse registers the "platform" protocol
>>>> properly so a URL using it should work properly...
>>>>
>>>>
>>>> Stephane Drapeau wrote:
>>>>> Mischa a écrit :
>>>>>> Hi,
>>>>>>
>>>>>> now I tried loading the XML using the Ecore mechanism. Unfortunately
>>>>>> it failed. When using the ScaResourceImpl I get into trouble since
>>>>>> the implementation can't hanlde the eclipse "platform" scheme
>>>>>> (java.net.MalformedURLException: unknown protocol: platform).
>>>>>
>>>>> This should work.
>>>>> Have a look at ScaExample.java (plugin org.eclipse.stp.sca.test) and
>>>>> at URI.createPlatformResourceURI(String, boolean).
>>>>> Moreover, to create the Resource, use the SCAResourceFactoryImpl.
>>>>>
>>>>> Stephane Drapeau
>>>>> Obeo
>>>>
>>>
>>
>
Re: ecore model instance [message #574793 is a reply to message #7585] Mon, 02 March 2009 11:18 Go to previous message
Stephane Drapeau is currently offline Stephane Drapeau
Messages: 198
Registered: July 2009
Senior Member
Mischa a écrit :
> Hi all,
>
> is it possible to access a SCA model instance in a "Ecore like" way (SCA
> meta model is already defined using EMF)? Currently I have a
> "xyz.composite" xml file conforming to the
> http://www.osoa.org/xmlns/sca/1.0 namespace.
> A xyz.ecore / xyz.xmi would be great, in particular to apply the oAW
> generator framework.
>
> Thanks in advance,
>
> Mischa

Hi,

The EMF meta model of SCA (.ecore + .genmodel + java code) is defined
and available in the plugin org.eclipse.stp.sca. So, I think that you
have all you need to parse an SCA model with the oAW generator. Compared
to an XMI model, remember that an XML model has a root element named
"DocumentRoot".

I successfully tried with Acceleo (a great code generator).

Stephane Drapeau
Obeo
Re: ecore model instance [message #574825 is a reply to message #7610] Thu, 05 March 2009 16:15 Go to previous message
Mischa is currently offline Mischa
Messages: 14
Registered: July 2009
Junior Member
Hi,

now I tried loading the XML using the Ecore mechanism. Unfortunately it
failed. When using the ScaResourceImpl I get into trouble since the
implementation can't hanlde the eclipse "platform" scheme
(java.net.MalformedURLException: unknown protocol: platform).

As an alternativ I tried the defualt XMLResourceImpl which inturn can't load
the composite root element (Class 'composite' not found).

What's the right way to load the ".composite" XML file?

Regards,
Mischa



"Stephane Drapeau" <Stephane.Drapeau@obeo.fr> schrieb im Newsbeitrag
news:49AC06BC.809@obeo.fr...
> Mischa a écrit :
>> Hi all,
>>
>> is it possible to access a SCA model instance in a "Ecore like" way (SCA
>> meta model is already defined using EMF)? Currently I have a
>> "xyz.composite" xml file conforming to the
>> http://www.osoa.org/xmlns/sca/1.0 namespace.
>> A xyz.ecore / xyz.xmi would be great, in particular to apply the oAW
>> generator framework.
>>
>> Thanks in advance,
>>
>> Mischa
>
> Hi,
>
> The EMF meta model of SCA (.ecore + .genmodel + java code) is defined and
> available in the plugin org.eclipse.stp.sca. So, I think that you have all
> you need to parse an SCA model with the oAW generator. Compared to an XMI
> model, remember that an XML model has a root element named "DocumentRoot".
>
> I successfully tried with Acceleo (a great code generator).
>
> Stephane Drapeau
> Obeo
Re: ecore model instance [message #574842 is a reply to message #7652] Fri, 06 March 2009 05:30 Go to previous message
Stephane Drapeau is currently offline Stephane Drapeau
Messages: 198
Registered: July 2009
Senior Member
Mischa a écrit :
> Hi,
>
> now I tried loading the XML using the Ecore mechanism. Unfortunately it
> failed. When using the ScaResourceImpl I get into trouble since the
> implementation can't hanlde the eclipse "platform" scheme
> (java.net.MalformedURLException: unknown protocol: platform).

This should work.
Have a look at ScaExample.java (plugin org.eclipse.stp.sca.test) and at
URI.createPlatformResourceURI(String, boolean).
Moreover, to create the Resource, use the SCAResourceFactoryImpl.

Stephane Drapeau
Obeo
Re: ecore model instance [message #574855 is a reply to message #7672] Fri, 06 March 2009 08:00 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25942
Registered: July 2009
Senior Member
Stephane,

What the failure tells me is that Mischa is most likely not running as
an OSGi application. Eclipse registers the "platform" protocol properly
so a URL using it should work properly...


Stephane Drapeau wrote:
> Mischa a écrit :
>> Hi,
>>
>> now I tried loading the XML using the Ecore mechanism. Unfortunately
>> it failed. When using the ScaResourceImpl I get into trouble since
>> the implementation can't hanlde the eclipse "platform" scheme
>> (java.net.MalformedURLException: unknown protocol: platform).
>
> This should work.
> Have a look at ScaExample.java (plugin org.eclipse.stp.sca.test) and
> at URI.createPlatformResourceURI(String, boolean).
> Moreover, to create the Resource, use the SCAResourceFactoryImpl.
>
> Stephane Drapeau
> Obeo
Re: ecore model instance [message #574899 is a reply to message #7692] Fri, 06 March 2009 13:34 Go to previous message
Mischa is currently offline Mischa
Messages: 14
Registered: July 2009
Junior Member
Hi Stephane, Hi Ed,

thanks for helpful support. Let me add some more details.
Of course I used the "ScaResourceFactoryImpl" like shown in the following
code snippet (The hardcoded extension was only for testing purpose).

resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(
"composite",
new ScaResourceFactoryImpl()
);

I'm not definitely sure whether I'm running on an OSGi environment but I
launched the App inside Eclipse as a oAW workflow which as far as I now is
running on Eclipse plattform. Furthere more the occuring Execption depicts
that the ScaResourceImpl overloads the load() method an calls some nativ
java code to parse the URI:

Caused by: java.net.MalformedURLException: unknown protocol: platform
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at org.eclipse.stp.sca.util.ScaResourceImpl.load(ScaResourceImp l.java:72)

I'll follow your suggestions and try to find the cause of my problem, I'll
post the solution when I fixed it.

Mischa


"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
news:gor6qb$l3o$2@build.eclipse.org...
> Stephane,
>
> What the failure tells me is that Mischa is most likely not running as an
> OSGi application. Eclipse registers the "platform" protocol properly so a
> URL using it should work properly...
>
>
> Stephane Drapeau wrote:
>> Mischa a écrit :
>>> Hi,
>>>
>>> now I tried loading the XML using the Ecore mechanism. Unfortunately it
>>> failed. When using the ScaResourceImpl I get into trouble since the
>>> implementation can't hanlde the eclipse "platform" scheme
>>> (java.net.MalformedURLException: unknown protocol: platform).
>>
>> This should work.
>> Have a look at ScaExample.java (plugin org.eclipse.stp.sca.test) and at
>> URI.createPlatformResourceURI(String, boolean).
>> Moreover, to create the Resource, use the SCAResourceFactoryImpl.
>>
>> Stephane Drapeau
>> Obeo
>
Re: ecore model instance [message #574915 is a reply to message #7712] Fri, 06 March 2009 14:22 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25942
Registered: July 2009
Senior Member
Mischa,

Comments below.

Mischa wrote:
> Hi Stephane, Hi Ed,
>
> thanks for helpful support. Let me add some more details.
> Of course I used the "ScaResourceFactoryImpl" like shown in the
> following code snippet (The hardcoded extension was only for testing
> purpose).
>
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(
> "composite",
> new ScaResourceFactoryImpl()
> );
>
> I'm not definitely sure whether I'm running on an OSGi environment but
> I launched the App inside Eclipse as a oAW workflow which as far as I
> now is running on Eclipse plattform.
I'm quite sure that a workflow runs as a standard Java application,
i.e., what you get when you do "Run As->Java Application" rather than
what you get when you do "Run As->Eclipse Application". Don't confuse
where you run it from with how its running.
> Furthere more the occuring Execption depicts that the ScaResourceImpl
> overloads the load() method an calls some nativ java code to parse the
> URI:
>
> Caused by: java.net.MalformedURLException: unknown protocol: platform
> at java.net.URL.<init>(Unknown Source)
> at java.net.URL.<init>(Unknown Source)
> at java.net.URL.<init>(Unknown Source)
> at org.eclipse.stp.sca.util.ScaResourceImpl.load(ScaResourceImp l.java:72)
Who is specifying the URL that's being used. You can't use a
platform:/resource or platform:/plugin URL if you are running as a
standard Java Application.
>
> I'll follow your suggestions and try to find the cause of my problem,
> I'll post the solution when I fixed it.
You'll likely need to use file: URI like what you get with
URI.createFileURI. Be sure the file path is absolute, i.e., use
java.io.File.getAbsolutePath...
>
> Mischa
>
>
> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
> news:gor6qb$l3o$2@build.eclipse.org...
>> Stephane,
>>
>> What the failure tells me is that Mischa is most likely not running
>> as an OSGi application. Eclipse registers the "platform" protocol
>> properly so a URL using it should work properly...
>>
>>
>> Stephane Drapeau wrote:
>>> Mischa a écrit :
>>>> Hi,
>>>>
>>>> now I tried loading the XML using the Ecore mechanism.
>>>> Unfortunately it failed. When using the ScaResourceImpl I get into
>>>> trouble since the implementation can't hanlde the eclipse
>>>> "platform" scheme (java.net.MalformedURLException: unknown
>>>> protocol: platform).
>>>
>>> This should work.
>>> Have a look at ScaExample.java (plugin org.eclipse.stp.sca.test) and
>>> at URI.createPlatformResourceURI(String, boolean).
>>> Moreover, to create the Resource, use the SCAResourceFactoryImpl.
>>>
>>> Stephane Drapeau
>>> Obeo
>>
>
Re: ecore model instance [message #574952 is a reply to message #7733] Sat, 07 March 2009 08:20 Go to previous message
Mischa is currently offline Mischa
Messages: 14
Registered: July 2009
Junior Member
Once again, thx for help.

Ed, referencing my model instance (sca.composite) using the file: protocol
works great, like you told me. Unfortunately this works only when using the
default ResourceFactoryImpl which in turn make problems loading the
model-content (The issue i already mentioned, "Class 'composite' not
found").

Using the "ScaResourceFactoryImpl" I still run into the problem "unknown
protocol: platform", no matter whether I'm specifing the URI using the
file:/... notation (URI.createFileURI() woun't help either).

This seams to be the end of my SCA jouney since for me it looks like i can't
use the model out of Eclipse at the time being (using
"ScaResourceFactoryImpl()").
At least I gain insight into the EMF Persistence API and a more detailed
knowlede about what's an URI all about.




"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
news:gort5p$eph$1@build.eclipse.org...
> Mischa,
>
> Comments below.
>
> Mischa wrote:
>> Hi Stephane, Hi Ed,
>>
>> thanks for helpful support. Let me add some more details.
>> Of course I used the "ScaResourceFactoryImpl" like shown in the following
>> code snippet (The hardcoded extension was only for testing purpose).
>>
>> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(
>> "composite",
>> new ScaResourceFactoryImpl()
>> );
>>
>> I'm not definitely sure whether I'm running on an OSGi environment but I
>> launched the App inside Eclipse as a oAW workflow which as far as I now
>> is running on Eclipse plattform.
> I'm quite sure that a workflow runs as a standard Java application, i.e.,
> what you get when you do "Run As->Java Application" rather than what you
> get when you do "Run As->Eclipse Application". Don't confuse where you
> run it from with how its running.
>> Furthere more the occuring Execption depicts that the ScaResourceImpl
>> overloads the load() method an calls some nativ java code to parse the
>> URI:
>>
>> Caused by: java.net.MalformedURLException: unknown protocol: platform
>> at java.net.URL.<init>(Unknown Source)
>> at java.net.URL.<init>(Unknown Source)
>> at java.net.URL.<init>(Unknown Source)
>> at org.eclipse.stp.sca.util.ScaResourceImpl.load(ScaResourceImp l.java:72)
> Who is specifying the URL that's being used. You can't use a
> platform:/resource or platform:/plugin URL if you are running as a
> standard Java Application.
>>
>> I'll follow your suggestions and try to find the cause of my problem,
>> I'll post the solution when I fixed it.
> You'll likely need to use file: URI like what you get with
> URI.createFileURI. Be sure the file path is absolute, i.e., use
> java.io.File.getAbsolutePath...
>>
>> Mischa
>>
>>
>> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
>> news:gor6qb$l3o$2@build.eclipse.org...
>>> Stephane,
>>>
>>> What the failure tells me is that Mischa is most likely not running as
>>> an OSGi application. Eclipse registers the "platform" protocol properly
>>> so a URL using it should work properly...
>>>
>>>
>>> Stephane Drapeau wrote:
>>>> Mischa a écrit :
>>>>> Hi,
>>>>>
>>>>> now I tried loading the XML using the Ecore mechanism. Unfortunately
>>>>> it failed. When using the ScaResourceImpl I get into trouble since
>>>>> the implementation can't hanlde the eclipse "platform" scheme
>>>>> (java.net.MalformedURLException: unknown protocol: platform).
>>>>
>>>> This should work.
>>>> Have a look at ScaExample.java (plugin org.eclipse.stp.sca.test) and at
>>>> URI.createPlatformResourceURI(String, boolean).
>>>> Moreover, to create the Resource, use the SCAResourceFactoryImpl.
>>>>
>>>> Stephane Drapeau
>>>> Obeo
>>>
>>
>
Re: ecore model instance [message #575001 is a reply to message #7753] Thu, 12 March 2009 07:36 Go to previous message
Mischa is currently offline Mischa
Messages: 14
Registered: July 2009
Junior Member
Hi all,

now it works! I just build the org.eclipse.stp.sc.sca PlugIn from the trunk
(Where the whole load methode of the ScaResourceImpl is commented out).
With other words the official SCA version (0.9.0.200806121858) related to
Eclipse Ganymede won't work in standalone applications. Use the current
trunk version instead.

Best regrads,
Mischa

"Mischa" <Mischa.Hoechsmann@itemis.de> schrieb im Newsbeitrag
news:gotsb2$om2$1@build.eclipse.org...
> Once again, thx for help.
>
> Ed, referencing my model instance (sca.composite) using the file: protocol
> works great, like you told me. Unfortunately this works only when using
> the default ResourceFactoryImpl which in turn make problems loading the
> model-content (The issue i already mentioned, "Class 'composite' not
> found").
>
> Using the "ScaResourceFactoryImpl" I still run into the problem "unknown
> protocol: platform", no matter whether I'm specifing the URI using the
> file:/... notation (URI.createFileURI() woun't help either).
>
> This seams to be the end of my SCA jouney since for me it looks like i
> can't use the model out of Eclipse at the time being (using
> "ScaResourceFactoryImpl()").
> At least I gain insight into the EMF Persistence API and a more detailed
> knowlede about what's an URI all about.
>
>
>
>
> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
> news:gort5p$eph$1@build.eclipse.org...
>> Mischa,
>>
>> Comments below.
>>
>> Mischa wrote:
>>> Hi Stephane, Hi Ed,
>>>
>>> thanks for helpful support. Let me add some more details.
>>> Of course I used the "ScaResourceFactoryImpl" like shown in the
>>> following code snippet (The hardcoded extension was only for testing
>>> purpose).
>>>
>>> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(
>>> "composite",
>>> new ScaResourceFactoryImpl()
>>> );
>>>
>>> I'm not definitely sure whether I'm running on an OSGi environment but I
>>> launched the App inside Eclipse as a oAW workflow which as far as I now
>>> is running on Eclipse plattform.
>> I'm quite sure that a workflow runs as a standard Java application, i.e.,
>> what you get when you do "Run As->Java Application" rather than what you
>> get when you do "Run As->Eclipse Application". Don't confuse where you
>> run it from with how its running.
>>> Furthere more the occuring Execption depicts that the ScaResourceImpl
>>> overloads the load() method an calls some nativ java code to parse the
>>> URI:
>>>
>>> Caused by: java.net.MalformedURLException: unknown protocol: platform
>>> at java.net.URL.<init>(Unknown Source)
>>> at java.net.URL.<init>(Unknown Source)
>>> at java.net.URL.<init>(Unknown Source)
>>> at
>>> org.eclipse.stp.sca.util.ScaResourceImpl.load(ScaResourceImp l.java:72)
>> Who is specifying the URL that's being used. You can't use a
>> platform:/resource or platform:/plugin URL if you are running as a
>> standard Java Application.
>>>
>>> I'll follow your suggestions and try to find the cause of my problem,
>>> I'll post the solution when I fixed it.
>> You'll likely need to use file: URI like what you get with
>> URI.createFileURI. Be sure the file path is absolute, i.e., use
>> java.io.File.getAbsolutePath...
>>>
>>> Mischa
>>>
>>>
>>> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
>>> news:gor6qb$l3o$2@build.eclipse.org...
>>>> Stephane,
>>>>
>>>> What the failure tells me is that Mischa is most likely not running as
>>>> an OSGi application. Eclipse registers the "platform" protocol
>>>> properly so a URL using it should work properly...
>>>>
>>>>
>>>> Stephane Drapeau wrote:
>>>>> Mischa a écrit :
>>>>>> Hi,
>>>>>>
>>>>>> now I tried loading the XML using the Ecore mechanism. Unfortunately
>>>>>> it failed. When using the ScaResourceImpl I get into trouble since
>>>>>> the implementation can't hanlde the eclipse "platform" scheme
>>>>>> (java.net.MalformedURLException: unknown protocol: platform).
>>>>>
>>>>> This should work.
>>>>> Have a look at ScaExample.java (plugin org.eclipse.stp.sca.test) and
>>>>> at URI.createPlatformResourceURI(String, boolean).
>>>>> Moreover, to create the Resource, use the SCAResourceFactoryImpl.
>>>>>
>>>>> Stephane Drapeau
>>>>> Obeo
>>>>
>>>
>>
>
Previous Topic:SCA builder & wiki update
Next Topic:[Announce] SCA Tools M6 is available
Goto Forum:
  


Current Time: Wed Jul 30 05:13:35 EDT 2014

Powered by FUDForum. Page generated in 0.04891 seconds