Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Plug-in Fragment cannot resolve classes from host
Plug-in Fragment cannot resolve classes from host [message #488656] Tue, 29 September 2009 15:48 Go to next message
Eclipse UserFriend
Originally posted by: cold.phusion.gmail.com

Hi,

I am new to extending plugins with fragments, so I guess this should be
straight-forward. Imagine the following set-up:

Host: org.eclipse.swt
Fragment: xyz.abc.product

The Fragment's manifest:
=============================
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Extension Fragment
Bundle-SymbolicName: xyz.abc.product
Bundle-Version: 1.5.0
Bundle-Vendor: ABC
Fragment-Host: org.eclipse.swt

All imports from the host plugin are not resolved in the any of the fragment
classes as if the host plugin was not on the classpath...
Is there anything I've forgotten in the manifest / fragment configuration?


Thanks,
Alex
Re: Plug-in Fragment cannot resolve classes from host [message #490611 is a reply to message #488656] Fri, 09 October 2009 12:12 Go to previous messageGo to next message
Andre Kullmann is currently offline Andre KullmannFriend
Messages: 33
Registered: September 2009
Member
He Alex,

I have the same problem, do you found a solution ?
Please let me know.

Thanks,
André

[Updated on: Fri, 09 October 2009 12:28]

Report message to a moderator

Re: Plug-in Fragment cannot resolve classes from host [message #490714 is a reply to message #488656] Fri, 09 October 2009 19:04 Go to previous messageGo to next message
Chris Aniszczyk is currently offline Chris AniszczykFriend
Messages: 674
Registered: July 2009
Senior Member
Alex Shterev wrote:
> Hi,
>
> I am new to extending plugins with fragments, so I guess this should be
> straight-forward. Imagine the following set-up:
>
> Host: org.eclipse.swt
> Fragment: xyz.abc.product
>
> The Fragment's manifest:
> =============================
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: Extension Fragment
> Bundle-SymbolicName: xyz.abc.product
> Bundle-Version: 1.5.0
> Bundle-Vendor: ABC
> Fragment-Host: org.eclipse.swt
>
> All imports from the host plugin are not resolved in the any of the fragment
> classes as if the host plugin was not on the classpath...
> Is there anything I've forgotten in the manifest / fragment configuration?

Are you patching SWT or something else? PDE has two headers to deal with
these type of things:

The Eclipse-ExtensibleAPI is used to specify whether a host bundle
allows fragment bundles to add addtional API to the host. This header
should be used if a host bundle wants to allow fragments to add
additional packages to the API of the host. If this header is not
specified then a default value of 'false' is used. The
Eclipse-ExtensibleAPI header must use the following syntax:

Eclipse-ExtensibleAPI ::= ( 'true' | 'false' )
The following is an example of the Eclipse-ExtensibleAPI header:

Eclipse-ExtensibleAPI: true

--

Eclipse-PatchFragment ::= ( 'true' | 'false' )

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

Cheers,

Chris Aniszczyk | EclipseSource Austin | +1 860 839 2465
http://twitter.com/eclipsesource | http://twitter.com/caniszczyk
Re: Plug-in Fragment cannot resolve classes from host [message #490826 is a reply to message #488656] Sun, 11 October 2009 15:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cold.phusion.gmail.com

Hi,

@Chris - thank you for replying. Yes, I'm trying to extend the SWT library
(org.eclipse.swt) and yes - its manifest includes "Eclipse-ExtensibleAPI: true".
I'm wondering if this is not actually the correct behavior? That is - if you are
extending a plugin with a fragment, are you allowed to use its classes or not?

@André - no, unfortunately I haven't. I'll post another thread on the equinox
newsgroup, because I need a solution rather urgently. I'll keep you posted.

Cheers,
Alex

Alex Shterev <cold.phusion@gmail.com> wrote:

> Hi,
>
> I am new to extending plugins with fragments, so I guess this should be
> straight-forward. Imagine the following set-up:
>
> Host: org.eclipse.swt
> Fragment: xyz.abc.product
>
> The Fragment's manifest:
> =============================
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: Extension Fragment
> Bundle-SymbolicName: xyz.abc.product
> Bundle-Version: 1.5.0
> Bundle-Vendor: ABC
> Fragment-Host: org.eclipse.swt
>
> All imports from the host plugin are not resolved in the any of the fragment
> classes as if the host plugin was not on the classpath...
> Is there anything I've forgotten in the manifest / fragment configuration?
>
>
> Thanks,
> Alex
>
>
Re: Plug-in Fragment cannot resolve classes from host [message #496306 is a reply to message #490826] Mon, 09 November 2009 16:46 Go to previous messageGo to next message
Andre Kullmann is currently offline Andre KullmannFriend
Messages: 33
Registered: September 2009
Member
Hi,

I found me mistake. The host- plugin was not in the feature. After I include the plugin in the same feature.xml as the fragment everythink works fine.

Cheers,
André
Re: Plug-in Fragment cannot resolve classes from host [message #496476 is a reply to message #496306] Tue, 10 November 2009 09:10 Go to previous message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 851
Registered: July 2009
Location: Grenoble, France
Senior Member

Andre Kullmann a écrit :
> Hi,
>
> I found me mistake. The host- plugin was not in the feature. After I
> include the plugin in the same feature.xml as the fragment everythink
> works fine.
>
> Cheers,
> André

Thanks a lot Andre. I met a similar issue with automated tests because of org.eclipse.ant.optionla.junit fragmant and stggled for days until I saw you message. Now it's ok thanks to your tip.

IMHO, this should be considered as a bug or a feature request against Equinox, since Equinox users (ie plugin developers) do not expect nor understand such a constraint. Should we file a bug for it?

--
Mickael Istria - BonitaSoft S.A.
http://www.bonitasoft.com/products/downloads.php
Re: Plug-in Fragment cannot resolve classes from host [message #602369 is a reply to message #488656] Fri, 09 October 2009 12:12 Go to previous message
Andre Kullmann is currently offline Andre KullmannFriend
Messages: 33
Registered: September 2009
Member
He Alex,

I have the same problem, do you found a solution ?
Please let me know.

Thanks,
André
Re: Plug-in Fragment cannot resolve classes from host [message #602376 is a reply to message #488656] Fri, 09 October 2009 19:04 Go to previous message
Chris Aniszczyk is currently offline Chris AniszczykFriend
Messages: 674
Registered: July 2009
Senior Member
Alex Shterev wrote:
> Hi,
>
> I am new to extending plugins with fragments, so I guess this should be
> straight-forward. Imagine the following set-up:
>
> Host: org.eclipse.swt
> Fragment: xyz.abc.product
>
> The Fragment's manifest:
> =============================
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: Extension Fragment
> Bundle-SymbolicName: xyz.abc.product
> Bundle-Version: 1.5.0
> Bundle-Vendor: ABC
> Fragment-Host: org.eclipse.swt
>
> All imports from the host plugin are not resolved in the any of the fragment
> classes as if the host plugin was not on the classpath...
> Is there anything I've forgotten in the manifest / fragment configuration?

Are you patching SWT or something else? PDE has two headers to deal with
these type of things:

The Eclipse-ExtensibleAPI is used to specify whether a host bundle
allows fragment bundles to add addtional API to the host. This header
should be used if a host bundle wants to allow fragments to add
additional packages to the API of the host. If this header is not
specified then a default value of 'false' is used. The
Eclipse-ExtensibleAPI header must use the following syntax:

Eclipse-ExtensibleAPI ::= ( 'true' | 'false' )
The following is an example of the Eclipse-ExtensibleAPI header:

Eclipse-ExtensibleAPI: true

--

Eclipse-PatchFragment ::= ( 'true' | 'false' )

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

Cheers,

Chris Aniszczyk | EclipseSource Austin | +1 860 839 2465
http://twitter.com/eclipsesource | http://twitter.com/caniszczyk
Re: Plug-in Fragment cannot resolve classes from host [message #602401 is a reply to message #488656] Sun, 11 October 2009 15:54 Go to previous message
Alex Shterev is currently offline Alex ShterevFriend
Messages: 20
Registered: April 2010
Junior Member
Hi,

@Chris - thank you for replying. Yes, I'm trying to extend the SWT library
(org.eclipse.swt) and yes - its manifest includes "Eclipse-ExtensibleAPI: true".
I'm wondering if this is not actually the correct behavior? That is - if you are
extending a plugin with a fragment, are you allowed to use its classes or not?

@André - no, unfortunately I haven't. I'll post another thread on the equinox
newsgroup, because I need a solution rather urgently. I'll keep you posted.

Cheers,
Alex

Alex Shterev <cold.phusion@gmail.com> wrote:

> Hi,
>
> I am new to extending plugins with fragments, so I guess this should be
> straight-forward. Imagine the following set-up:
>
> Host: org.eclipse.swt
> Fragment: xyz.abc.product
>
> The Fragment's manifest:
> =============================
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: Extension Fragment
> Bundle-SymbolicName: xyz.abc.product
> Bundle-Version: 1.5.0
> Bundle-Vendor: ABC
> Fragment-Host: org.eclipse.swt
>
> All imports from the host plugin are not resolved in the any of the fragment
> classes as if the host plugin was not on the classpath...
> Is there anything I've forgotten in the manifest / fragment configuration?
>
>
> Thanks,
> Alex
>
>
Re: Plug-in Fragment cannot resolve classes from host [message #603122 is a reply to message #490826] Mon, 09 November 2009 16:46 Go to previous message
Andre Kullmann is currently offline Andre KullmannFriend
Messages: 33
Registered: September 2009
Member
Hi,

I found me mistake. The host- plugin was not in the feature. After I include the plugin in the same feature.xml as the fragment everythink works fine.

Cheers,
André
Re: Plug-in Fragment cannot resolve classes from host [message #603130 is a reply to message #603122] Tue, 10 November 2009 09:10 Go to previous message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 851
Registered: July 2009
Location: Grenoble, France
Senior Member

Andre Kullmann a écrit :
> Hi,
>
> I found me mistake. The host- plugin was not in the feature. After I
> include the plugin in the same feature.xml as the fragment everythink
> works fine.
>
> Cheers,
> André

Thanks a lot Andre. I met a similar issue with automated tests because of org.eclipse.ant.optionla.junit fragmant and stggled for days until I saw you message. Now it's ok thanks to your tip.

IMHO, this should be considered as a bug or a feature request against Equinox, since Equinox users (ie plugin developers) do not expect nor understand such a constraint. Should we file a bug for it?

--
Mickael Istria - BonitaSoft S.A.
http://www.bonitasoft.com/products/downloads.php
Previous Topic:Does doc.zip no longer work in 3.5?
Next Topic:Adding annotation model to default text editor
Goto Forum:
  


Current Time: Sat Aug 08 18:46:01 GMT 2020

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

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

Back to the top