Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Java Services classpath
[Acceleo] Java Services classpath [message #1009681] Fri, 15 February 2013 14:08 Go to next message
Nicola Serreli is currently offline Nicola SerreliFriend
Messages: 26
Registered: July 2009
Junior Member
Hi,

I'm writing an eclipse plugin with an Action that runs an Acceleo generation.
Inside a template I use the invoke construct to call a java method.

The problem is that Acceleo is not able to find the .class file if I run an eclipse application from the 'eclipse plugins sdk' application.

Here is an idea about file locations:

* developing plugin's sources at "c:/sources_repository/path/plugin_a"
* developing workspace at "c:/workspace"
* testing workspace at "c:/workspace_runtime"

Running the generation, Acceleo asks to AcceleoServicesEclipseUtil.registerService(URI uri, String qualifiedName) to find the class. The provided url is like "c:/sources_repository/path/plugin_a/...emtl" and it does not offers to acceleo any clue about where the bundle is located:
* it is not a platform plugin
* it is not in the workspace (the generator runs in the runtime one !)
* plugin_a is not the plugin symbolic name

Probably it is possible to identify the correct bundle checking the position of all registred bundles against the initial part of uri (note that if there is some kind of eclipse-link, the path may be completely unrelated to the bundle location).

I looked for a solution (different for renaming the plugin folder) that allow me to test and debug the entire application (i.e. inside an eclipse application). The only one I found that everything workins if I call (once) this method before run the generation:

AcceleoServicesEclipseUtil.registerService(Activator.getBundle(), MyJavaService.class.getCanonicalName())

The problem now is that this class is an internal one.

Any suggestion?
There is a way to register the service using only public methods?

thanks in advance
Nicola

Re: [Acceleo] Java Services classpath [message #1011802 is a reply to message #1009681] Wed, 20 February 2013 09:26 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Nicola,

Quote:
Running the generation, Acceleo asks to AcceleoServicesEclipseUtil.registerService(URI uri, String qualifiedName) to find the class. The provided url is like "c:/sources_repository/path/plugin_a/...emtl" and it does not offers to acceleo any clue about where the bundle is located:
* it is not a platform plugin
* it is not in the workspace (the generator runs in the runtime one !)
* plugin_a is not the plugin symbolic name


plugin_a is the plugin that contains your acceleo module. We use its classpath to find the service class. You do not have to worry about that as long as : a) the java class you use as a service is exported by its containing plugin, and b) plugin_a has a dependency towards the plugin that contains the java class.

Laurent Goubet
Obeo
Re: [Acceleo] Java Services classpath [message #1049074 is a reply to message #1011802] Thu, 25 April 2013 10:16 Go to previous message
Stephane Bouchet is currently offline Stephane BouchetFriend
Messages: 280
Registered: July 2009
Senior Member
Hi,

got exactly the same problem.
cannot test my generator using junit.
provided an example here :https://bugs.eclipse.org/bugs/show_bug.cgi?id=406528
Previous Topic: [Xpand/Xtend] Extension problem with xsd metamodel
Next Topic:[acceleo] another acceleo standalone question
Goto Forum:
  


Current Time: Fri Mar 29 11:26:04 GMT 2024

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

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

Back to the top