Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Export problems (fragment related)
Export problems (fragment related) [message #436716] Thu, 15 September 2005 10:13 Go to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
Hello,

I have an Eclipse 3.1 RCP product, which I try to export via the
Eclipse product wizard available from my .product file. The product
configuration is managed by plugins (not features).

Everything worked fine, until it was necessary to add a fragment
(whatever.org.eclipse.swt.patch) to the project. Just selecting the "add
required plugins" button on the configuration page added the fragment to
the list, but if I start the export process (resynchronization works
fine), I get the error message:

"Problems during export

Reason:
Unable to plugin-id: whatever.org.eclipse.swt.patch_0.0.0. Please
check the error log for more details"

Regrettably the error log window does not show anything, there is also
no log file in the export directory.

Any ideas?

Thank you very much,

Daniel Krügler
Re: Export problems (fragment related) [message #436894 is a reply to message #436716] Tue, 20 September 2005 00:35 Go to previous messageGo to next message
Pascal Rapicault is currently offline Pascal RapicaultFriend
Messages: 440
Registered: July 2009
Senior Member
It seems like if your fragment does not get properly resolved (attached
to the swt bundle) which would explain the cryptic error. Make sure that
all the dependencies of your bundle are satisfied.

If you can figure it out, please post bug against pde build.

Daniel Krügler wrote:
> Hello,
>
> I have an Eclipse 3.1 RCP product, which I try to export via the
> Eclipse product wizard available from my .product file. The product
> configuration is managed by plugins (not features).
>
> Everything worked fine, until it was necessary to add a fragment
> (whatever.org.eclipse.swt.patch) to the project. Just selecting the "add
> required plugins" button on the configuration page added the fragment to
> the list, but if I start the export process (resynchronization works
> fine), I get the error message:
>
> "Problems during export
>
> Reason:
> Unable to plugin-id: whatever.org.eclipse.swt.patch_0.0.0. Please
> check the error log for more details"
>
> Regrettably the error log window does not show anything, there is also
> no log file in the export directory.
>
> Any ideas?
>
> Thank you very much,
>
> Daniel Krügler
>
>
Re: Export problems (fragment related) [message #436917 is a reply to message #436894] Tue, 20 September 2005 07:06 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
Pascal Rapicault wrote:
> It seems like if your fragment does not get properly resolved (attached
> to the swt bundle) which would explain the cryptic error. Make sure that
> all the dependencies of your bundle are satisfied.
>
> If you can figure it out, please post bug against pde build.

Thank you for your answer, Pascal.

In the moment, I have no clue anymore what to do, but my fragment is so
simple, that its easy to publish it here: It is meant as a fragment for
org.eclipse.swt. It contains just one simple java file:

//////////////////////////////////////////////////
package org.eclipse.swt.widgets;

/**
* We need this class as access point to the Spinner.getSelectionText()
method
* which has package (default) visibility. Access to this function is
necessary
* to realize a workaround for Spinner event handling bug
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=100363
*
* @author kruegler
*/
public final class SpinnerAccess {

public final static int getSelectionText(Spinner spinner) {
final int result = spinner.getSelectionText();
return result;
}

public final static int getSelection(Spinner spinner) {
final int selection = spinner.getSelection();
final int result = spinner.getSelectionText();
if (selection != result) {
spinner.setSelection(result);
}
return result;
}

}
//////////////////////////////////////////////////

The manifest is given below. Please note, that I can't remove the
entry 'Require-Bundle' (otherwise the source code will not compile),
although its amusing to see that I need to provide explicitely the
dependency on the fragment host. Do you see any problems with this
file?

//////////////////////////////////////////////////
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %fragment.name
Bundle-Vendor: %provider.name
Bundle-SymbolicName: de.bdal.org.eclipse.swt.patch; singleton:=true
Bundle-Version: 1.0.0
Fragment-Host: org.eclipse.swt;bundle-version="3.1.0"
Bundle-Localization: plugin
Export-Package: org.eclipse.swt.widgets
Require-Bundle: org.eclipse.swt
//////////////////////////////////////////////////

Greetings from Bremen,

Daniel Krügler
Re: Export problems (fragment related) [message #436925 is a reply to message #436917] Tue, 20 September 2005 10:00 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
Maybe it's failing because the SWT doesn't contain anything, but instead, it's in the win32 specific jar org.eclipse.swt.win32.win32.x86_3.1.0.jar. Have you tried making the fragment depend on that instead?
Re: Export problems (fragment related) [message #436929 is a reply to message #436925] Tue, 20 September 2005 10:55 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
Alex Blewitt wrote:
> Maybe it's failing because the SWT doesn't contain anything, but instead, it's in the win32 specific jar org.eclipse.swt.win32.win32.x86_3.1.0.jar. Have you tried making the fragment depend on that instead?

I also had this idea and tried either

Require-Bundle: org.eclipse.swt.win32.win32.x86

or

Require-Bundle: org.eclipse.swt,
org.eclipse.swt.win32.win32.x86

which both are wrong according to the manifest editor saying that:

"org.eclipse.swt.win32.win32.x86 is a fragment"

which is right of course. Is there some special syntax necessary to
express dependencies on fragments?

Thank you very much for your input,

Daniel
Re: Export problems (fragment related) [message #436931 is a reply to message #436929] Tue, 20 September 2005 11:25 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
Technically, it's not possible to depend on a fragment, only on another plugin. I'm not sure whether it's possible/feasible/sensible to have code from one fragment depend on code from another fragment, which is what this seems to be.

Given that it's a simple patch, I'd suggest modifying the source for the original SWT fragment and distributing that with your code, and then re-applying the patch for future versions that come out. That's what I did when a bug didn't get fixed in the 3.0 stream, and provided backwards compatibiltiy with 2.1 stream

https://bugs.eclipse.org/bugs/show_bug.cgi?id=38085
Re: Export problems (fragment related) [message #436934 is a reply to message #436931] Tue, 20 September 2005 12:38 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
Alex Blewitt wrote:
> Technically, it's not possible to depend on a fragment, only on
> another plugin. I'm not sure whether it's possible/feasible/sensible
> to have code from one fragment depend on code from another fragment,
> which is what this seems to be.

Actually it should be feasible to patch a fragment, at least considering
that fragments are now more than simple i18n helper, but also useful for
(temporary) bugfixing and allows access to package accessible members,
which otherwise can not be accessed to due to the class loader-related
problems, which you explained to me in my previous posting ;-))

Allowing to patch fragments would be consistent with Java capability to
get access to package visible items provided I open the same package.
Using a fragment was done to realize solve this problem.

Furtheron I don't understand why the problem occurs only for the export
process and **not** for the RCP app started by the run configuration!


> Given that it's a simple patch, I'd suggest modifying the source for
> the original SWT fragment and distributing that with your code, and
> then re-applying the patch for future versions that come out. That's
> what I did when a bug didn't get fixed in the 3.0 stream, and
> provided backwards compatibiltiy with 2.1 stream
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=38085

Hmmh, you mean I should modify the sources of Spinner and create a jar
with that modified source - Shudder!

I hope there exist another solution... I would try anything else first,
even obscure stuff like class loader context switches or similar. Do you
know a method to use class loader context switch to get access to the
package visible method in another plugin, but same package??

Thanks,

Daniel Krügler
Re: Export problems (fragment related) [message #437020 is a reply to message #436934] Tue, 20 September 2005 13:25 Go to previous message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
It's not that difficult to modify the source, especially as you already know what you're trying to change. Alternatively, you could build/compile a new class, then add the .class into the Jar file (using a utility like 'winzip', for example). You don't necessarily need to build the entier win32.jar from scratch.

The export operation does a slightly different build than the definitions in the project's .classpath; that's why you sometimes get different behaviour between classes visible in the projects, but not visible when running a test app.
Previous Topic:How to add and remove view from fastview programmatically
Next Topic:Size of EditorPart
Goto Forum:
  


Current Time: Thu Dec 26 23:13:20 GMT 2024

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

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

Back to the top