|
|
Re: Missing bin suffix at getCodeSource().getLocation() [message #654365 is a reply to message #654363] |
Tue, 15 February 2011 12:50 |
Thomas Pilarski Messages: 6 Registered: November 2010 Location: Hannover |
Junior Member |
|
|
Paul Webster wrote on Tue, 15 February 2011 07:32 |
What are you trying to do, exactly? You have a project in eclipse that
you are currently working on, and you want to run "what" on it that you
need to find its classpath? Do you want to run it in your eclipse on
your working project?
|
I am creating a non eclipse data transformation with antlr. The transformation classes are loaded dynamically for all parts, during creation of the transformator. This part is already working as a standalone java project, as file://... and jar resource.
This transformation is used in a graphical and textual editor and it works fine, when I import the transformation project as jar file and add the classpath to the editors, as the the package is at the top level of the jar file.
To allow debugging of the transformator within the eclipse run-time environment I have changes the project type of the transformator to a plugin project and started the run-time environment. The transformation parts are not found anymore, as the binary files are store in $(projectRoot)/bin the getCodeSource().getLocation() returns $(projectRoot) only.
Paul Webster wrote on Tue, 15 February 2011 07:32 |
Or you are going to launch an inner Eclipse app? Java app? and you'd
like to operate on what from the inner?
|
The transformation package is used in a standalone application and a eclipse plugin. The second does only work with a jar file, not a normal (plugin) project.
|
|
|
|
Re: Missing bin suffix at getCodeSource().getLocation() [message #654402 is a reply to message #654382] |
Tue, 15 February 2011 15:31 |
Thomas Pilarski Messages: 6 Registered: November 2010 Location: Hannover |
Junior Member |
|
|
I will explain my project dependencies.
STI-Project:
I am using simple transformation infrastructure for translating between different models. It scans within a given package name for classes with a runtime annotation. Checks theses classes for a method with a given name and put the type of the first parameter to as key and a callback object as value in a look-up map.
ATransformation-Project:
This project provides the transformation classes for the model elements.
Both projects are not eclipse plug-ins, therefore they cannot use the eclipse platform framework.
AModelEditor-Project:
Is an gmf editor, which uses the STI and ATransformation projects for a transformation.
The junit tests for STI- and ATransformation-projects works fine, while using the eclipse project or the exported project jars.
I have converted the STI- and ATransformation-projects as eclise plugins, to add these as dependencies in the AModelEditor project. If I export the STI- and ATransformation-Project as "Deployable plug-in and fragments", the transformation works fine, as the package is exported to the root of the jar file.
If I just start the AModelEditor-Plugin with the STI- and ATransformation-projects as dependencies for debugging purposes, the transformation classes are not found, as the AnAnnotationClass.class.getProtectionDomain().getCodeSource( ).getLocation() does not return the binary folder ($project/bin), but the project root. AnAnnotationClass.class is part of the ATransformation-project, which contains the transformation classes.
I have tried a lot of changes in plugin.xml or the MANIFEST.MF, but with no success. And all resources on the web I have found, tells that ....getCodeSource().getLocation() returns the binary folder. On my machine it's the project root.
How can I change the plugin.xml or the MANIFEST.MF, so that the AnAnnotationClass.class.getProtectionDomain().getCodeSource( ).getLocation() returns the binaryFolder and not the project root folder?
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05001 seconds