Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Standalone problem
[Acceleo] Standalone problem [message #903396] Thu, 23 August 2012 13:28 Go to next message
pere b is currently offline pere bFriend
Messages: 7
Registered: November 2011
Junior Member
Hi,

I've created a M2T transformation and I need to call it from another application (outside Eclipse). I'm following the steps listed here (http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.acceleo.doc%2Fpages%2Freference%2Fstandalone.html) but i get this exception:

Quote:
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.core.runtime.Platform
at org.eclipse.ocl.common.OCLCommon.getPreference(OCLCommon.java:74)
at org.eclipse.ocl.lpg.AbstractBasicEnvironment.getValue(AbstractBasicEnvironment.java:440)
at org.eclipse.ocl.options.ParsingOptions.getValue(ParsingOptions.java:330)
at org.eclipse.ocl.AbstractEnvironment.createTypeChecker(AbstractEnvironment.java:1214)
at org.eclipse.ocl.AbstractEnvironment.getTypeChecker(AbstractEnvironment.java:1196)
at org.eclipse.ocl.AbstractEnvironment.getAdapter(AbstractEnvironment.java:1236)
at org.eclipse.ocl.util.OCLUtil.getAdapter(OCLUtil.java:102)
at org.eclipse.ocl.util.TypeUtil.getTypeCheckerAdapter(TypeUtil.java:800)
at org.eclipse.ocl.util.TypeUtil.findAttribute(TypeUtil.java:171)
at org.eclipse.ocl.AbstractEnvironment.doLookupProperty(AbstractEnvironment.java:657)
at org.eclipse.ocl.AbstractEnvironment.lookupProperty(AbstractEnvironment.java:638)
at org.eclipse.ocl.AbstractTypeResolver.findTupleType(AbstractTypeResolver.java:430)
at org.eclipse.ocl.AbstractTypeResolver.resolveTupleType(AbstractTypeResolver.java:382)
at org.eclipse.ocl.AbstractTypeResolver$ResolveSwitch.caseTupleType(AbstractTypeResolver.java:1008)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitch(TypesSwitch.java:267)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitchSuperTypes(TypesSwitch.java:117)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitchSuperTypes(TypesSwitch.java:122)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitch(TypesSwitch.java:105)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69)
at org.eclipse.ocl.AbstractTypeResolver.resolve(AbstractTypeResolver.java:127)
at org.eclipse.ocl.AbstractTypeResolver$ResolveSwitch.caseCollectionType(AbstractTypeResolver.java:1003)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitch(TypesSwitch.java:168)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitchSuperTypes(TypesSwitch.java:117)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitchSuperTypes(TypesSwitch.java:122)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitchSuperTypes(TypesSwitch.java:122)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitch(TypesSwitch.java:105)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69)
at org.eclipse.ocl.AbstractTypeResolver.resolve(AbstractTypeResolver.java:127)
at org.eclipse.ocl.util.TypeUtil.resolveType(TypeUtil.java:617)
at org.eclipse.ocl.util.OCLStandardLibraryUtil.getSetType(OCLStandardLibraryUtil.java:2216)
at org.eclipse.ocl.util.OCLStandardLibraryUtil.createCollectionOperations(OCLStandardLibraryUtil.java:1754)
at org.eclipse.ocl.ecore.internal.OCLStandardLibraryImpl.build(OCLStandardLibraryImpl.java:375)
at org.eclipse.ocl.ecore.internal.OCLStandardLibraryImpl.init(OCLStandardLibraryImpl.java:205)
at org.eclipse.ocl.ecore.internal.OCLStandardLibraryImpl.<clinit>(OCLStandardLibraryImpl.java:97)
at org.eclipse.ocl.ecore.EcoreEnvironment.getOCLStandardLibrary(EcoreEnvironment.java:271)
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.getOCLStdLibPackage(AbstractAcceleoGenerator.java:728)
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.registerPackages(AbstractAcceleoGenerator.java:503)
at org.eclipse.acceleo.module.m2t_jmt.main.Generate.registerPackages(Generate.java:346)
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:422)
at org.eclipse.acceleo.module.m2t_jmt.main.Generate.<init>(Generate.java:92)
at acceleotest.AcceleoTest.main(AcceleoTest.java:35)
Java Result: 1


Previosly I was getting a different exception. I solved it by including the library org.eclipse.ocl.common in the project.

I don't know what is wrong, can you help me?

Thanks a lot!

[Updated on: Thu, 23 August 2012 13:28]

Report message to a moderator

Re: [Acceleo] Standalone problem [message #903427 is a reply to message #903396] Thu, 23 August 2012 15:10 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

On 23/08/2012 14:28, pere Mising name wrote:
> Hi,
> I created a M2T transformation and need to call it from another
> application (outside Eclipse). I'm following the steps listed here
> (http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.acceleo.doc%2Fpages%2Freference%2Fstandalone.html)
> but i get this exception:
>
> Quote:
>> Exception in thread "main" java.lang.NoClassDefFoundError: Could not
>> initialize class org.eclipse.core.runtime.Platform
>
> Previosly I was getting a different exception. I solved it by
> including the library org.eclipse.ocl.common in the project.
>
> I don't know what is wrong, can you help me?
Keep on going. Add org.eclipse.core.runtime to your project.

It is much easier to make your project a Plugin project so that Eclipse
sorts out your class-path for you.

Regards

Ed Willink
Re: [Acceleo] Standalone problem [message #903434 is a reply to message #903427] Thu, 23 August 2012 15:37 Go to previous messageGo to next message
pere b is currently offline pere bFriend
Messages: 7
Registered: November 2011
Junior Member
Thanks for your answer, Ed.

I should have said that I already have added org.eclipse.core.runtime to the project. In fact, I have added every org.eclipse.core.runtime.* jar that I've found...

How do I make my project a Plugin project? I export my acceleo project as a "Deployable plug-ins and fragments". Should I export it as a Runnable jar?




[Updated on: Thu, 23 August 2012 15:38]

Report message to a moderator

Re: [Acceleo] Standalone problem [message #903445 is a reply to message #903434] Thu, 23 August 2012 16:36 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

In the Package Explorer select a non-plugin project and do
Configure->Convert to Plugin Projects.

See other threads for advice on deployment.

Regards

Ed Willink


On 23/08/2012 16:37, pere b wrote:
> Thanks for your answer, Ed.
>
> I should have sais that I already have added org.eclipse.core.runtime
> to the project. In fact, I have added every org.eclipse.core.runtime.*
> jar that I've found...
>
> How do I make my project a Plugin project? I export my acceleo project
> as a "Deployable plug-ins and fragments". Should I export it as a
> Runnable jar?
>
>
>
>
>
Re: [Acceleo] Standalone problem [message #903471 is a reply to message #903445] Thu, 23 August 2012 18:22 Go to previous messageGo to next message
pere b is currently offline pere bFriend
Messages: 7
Registered: November 2011
Junior Member
I'm sorry but I don't understand it. I started my project (in Eclipse) by choosing New->Acceleo Project and there is no "Convert to Plugin Projects" option available. What kind of Acceleo project I'm supposed to use in order to be able to apply "Convert to Plugin Projects"?

I appreciate your help, thank you very much (and please excuse me for my bad English).

Re: [Acceleo] Standalone problem [message #903524 is a reply to message #903471] Fri, 24 August 2012 06:46 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Sorry, an Acceleo project is already a plugin project. The problem is
that the way you run the transformation does not use Eclipse
capabilities so you need to do everything the hard way.

Regards

Ed Willink

On 23/08/2012 19:22, pere b wrote:
> I'm sorry but I don't understand it. I started my project (in Eclipse)
> by choosing New->Acceleo Project and there is no "Convert to Plugin
> Projects" option available. What kind of Acceleo project I'm supposed
> to use in order to be able to apply "Convert to Plugin Projects"?
> I appreciate your help, thank you very much (and please excuse me for
> my bad English).
>
>
Re: [Acceleo] Standalone problem [message #903566 is a reply to message #903524] Fri, 24 August 2012 11:14 Go to previous messageGo to next message
pere b is currently offline pere bFriend
Messages: 7
Registered: November 2011
Junior Member
Thanks again for your answers, Ed.

I think my project finally works fine. In case that someone is interested, the jars that you have to add (besides the ones listed in http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.acceleo.doc%2Fpages%2Freference%2Fstandalone.html) are:
org.eclipse.core.runtime
org.eclipse.ocl.common
org.eclipse.osgi
Re: [Acceleo] Standalone problem [message #903571 is a reply to message #903566] Fri, 24 August 2012 11:34 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Thanks for the reference. I understand your legitimate confusion now.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=387973

raised to see if we can return to the earlier requirements.

Regards

Ed Willink

On 24/08/2012 12:14, pere b wrote:
> Thanks again for your answers, Ed.
>
> I think my project finally works fine. In case that someone is
> interested, the jars that you have to add (besides the ones listed in
> http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.acceleo.doc%2Fpages%2Freference%2Fstandalone.html)
> are:
> org.eclipse.core.runtime
> org.eclipse.ocl.common
> org.eclipse.osgi
Re: [Acceleo] Standalone problem [message #904418 is a reply to message #903571] Tue, 28 August 2012 11:52 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

The inclusion of these three new "required at runtime" jars is a regression. Commented on the bug mentionned by Ed. o.e.core.runtime at least we can remove, I'd need to track down what forces us to have ocl.common and osgi too in order to determine whether these regressions can be resolved or if we have to live with them.

Laurent Goubet
Obeo
Previous Topic:[Xpand] Out of memory when generating large files with Xpand
Next Topic:[Acceleo] select distinct
Goto Forum:
  


Current Time: Fri Mar 29 07:03:00 GMT 2024

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

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

Back to the top