Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Problems with Product Export within Eclipse: wrong content in created jars
Problems with Product Export within Eclipse: wrong content in created jars [message #461770] Tue, 16 January 2007 15:47 Go to next message
No real name is currently offline No real nameFriend
Messages: 4
Registered: July 2009
Junior Member
Hi everybody,

I have serious problems with the product export offered by Eclipse and I hope anyone can help me.
I searched serveral forums but I couldn't find any solutions that work, yet.

The project consists of serveral plugins. Some of them using native libraries.

I'm working on the Eclipse Plattform 3.2.1 using Java 5 and I'm
exporting the product to a directory via the Eclipse Product export wizard offered on the overview
page of the product description and configuration dialog (i. e. editor).

The export process terminates without any errors, but starting the product
via the generated exe-file fails. The log reports that the activator of the bundle to execute is invalid and
cannot be found respectively. A ClassNotFoundException is thrown.

Inspecting the plugins subdirectory created during the export process shows
that indeed for every plugin the product consists of, an appropriate jar archive is created
but with wrong content:
Instead of containing all the classes and packages that make up the related plugins
all the jar archives consist of classes and packages of one single plugin (Lets call it plugin A).
Only the manifest.mf files, the plugin.xml files and the referenced libraries are exported correctly to the corresponding archives.

That's why the required activator cannot be found: It isn't exported to the jar file so far.

First I thought that problem could be traced back to dependencies between the different plugins and plugin A, because
almost all plugins depends on plugin A. But the problem even occurs if there is no dependency declared.

Exporting each plugin separately via Export... -> Plug-in Development -> Deployable plug-ins and fragments
with checked "Package plug-ins as individual JAR archives" option leads to the expected result.
But if more than one plugin are exported this way at the same time
(i. e. several plugins are checked within the Export deployable plug-ins and fragments wizard page)
the problem occurs again, even when plugin A is not exported.

Due to posted problem solutions a lot of errors concerning the product export could be traced back to a missing "."
entry within the classpath declaration. I checked all my MANIFEST.MF entries.
If any native library is referenced in the classpath declaration, the "." entry is also there.
The same I checked for the build properties.

Have anyone suggestions what the reason for this problem could be?

Thanks

Markus
Re: Problems with Product Export within Eclipse: wrong content in created j [message #461796 is a reply to message #461770] Wed, 17 January 2007 10:56 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
Having build failures is depressingly common. Anyway, I'd check to see what the build.properties is for each plugin. You can also do 'Export -> Plugins -> Deployable plugins and features' on a per-plugin basis; so I'd suggest trying that to find out what's going on. You can also right-click on a plugin and there's an option to generate the build.xml file (I think it's visible when right-clicking the manifest). That will show you the ant command that's actually run, and you can put e.g. echo messages in there for a bit of mini debugging.

It's definitely odd to find that a plugin contains all the other plugin's classes, and not its own. You're not using Java projects to include other projects exported libraries, or anything weird like that are you?

Anyway, if you have the .classpath, build.properties, Manifest.MF of one of the broken plugins, I'm sure that anything odd will jump out.

Alex.

PS Maybe it's something as weird as missing something out on the bin.includes for the plugins with native code?
Re: Problems with Product Export within Eclipse: wrong content in created j [message #461933 is a reply to message #461796] Thu, 18 January 2007 12:31 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 4
Registered: July 2009
Junior Member
Hi Alex,

many thanks for your fast reply.

Inspired by your question if I am using Java projects to include other projects exported libraries I tried another method to setup my product within the Eclipse IDE:

Our project is hosted within SVN. Till today I checked it out to the filesystem using TortoiseSVN. Then I created for each plugin a new Java project - a project from existing (plugin) source.
There were no problems with executing the product within Eclipse. But the export didn't work.

Today I tried to checkout the plugins to my workspace directly within eclispe via subclipse by selecting the "checkout" (context) menu item within the svn repository view.
Then the product export worked. The different created jars contain the appropriate code.
Are there any problems with creating new Java Projects from existing sources?

Markus
Re: Problems with Product Export within Eclipse: wrong content in created j [message #461935 is a reply to message #461933] Thu, 18 January 2007 12:41 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
Don't know -- it might also depend on whether there were .project files created from before that you (or someone else) had checked in. I doubt that the tortoisesvn/subclipse would have made the difference, but there might have been some (e.g. does tortoisesvn check out .project files?)

Other than that, can't think of a major difference why. Once you get used to what a source should look like, it becomes easier to set them up in the future. To be honest, half the time it's easier to create a new project, and then just specify the location of an existing codebase; Eclispe will then write in the new values. You might have to specify source folders, but in my experience setting up a new plugin is easier than trying to massage an old project into a plugin; and in any case, with SVN, the move of source code is free, right? So create a new plugin (e.g. with a new name), then svn move your source into the right place afterwards.

Alex.
Re: Problems with Product Export within Eclipse: wrong content in created j [message #461952 is a reply to message #461935] Thu, 18 January 2007 15:52 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 4
Registered: July 2009
Junior Member
I just compared the .classpath-, .project-,plugin.xml- and MANIFEST.MF-files between the older "workspace", i. e. the former used svn working copy - and the newer one. They are all consistent. So neither Subclipse nor Eclipse changed the content of these files during the new import process. Perhaps there were any inner mechanisms that failed during the former imports.

Perhaps the problem was that the former working copy was located outside the workspace used by Eclipse. The newer one is located inside. I will examine this issue by opening a new workspace, importing the working plugins from the current workspace by creating new Java Projects from existing source - the conventional way I used to apply - and executing the product export process again. I will report the results.

Markus
Re: Problems with Product Export within Eclipse: wrong content in created j [message #461953 is a reply to message #461935] Thu, 18 January 2007 16:02 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 4
Registered: July 2009
Junior Member
I just compared the .classpath-, .project-,plugin.xml- and MANIFEST.MF-files between the older "workspace", i. e. the former used svn working copy - and the newer one. They are all consistent. So neither Subclipse nor Eclipse changed the content of these files during the new import process. Perhaps there were any inner mechanisms that failed during the former imports.

Perhaps the problem was that the former working copy was located outside the current workspace used by Eclipse. The newer one is located inside. I will examine this issue by opening a new workspace, importing the working plugins from the current workspace by creating new Java Projects from existing source - the conventional way I used to apply - and executing the product export process again. I will report the results.

By all means many thanks for your comments, Alex!

Markus
Re: Problems with Product Export within Eclipse: wrong content in created j [message #461956 is a reply to message #461953] Thu, 18 January 2007 16:53 Go to previous message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
It shouldn't matter whether the projects are inside or outside the workspace. You're not storing the workspace in SVN, though, are you? :-)

Anyway, sometimes these things happen. I've seen big problems with files like .classpath when there's a merge conflict and you have weird characters in the files that can't be loaded by an XML parser.

As long as you've got it working now, I wouldn't worry too much about it :-)

Alex.
Previous Topic:toolbar visible
Next Topic:Enabling and disabling actions according to user priviledges
Goto Forum:
  


Current Time: Tue May 07 13:50:09 GMT 2024

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

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

Back to the top