The Private-Package settting finally worked :-) Thanks for your effort . Andreas .
-------- Original-Nachricht -------- > Datum: Wed, 24 Jun 2009 09:09:52 +0200 > Von: Stuart McCulloch <[email protected]> > An: [email protected] > Betreff: Re: packaging problem in bundle > 2009/6/24 Andreas Mucha <[email protected]> > > > I know. This was the original plan. > > But it does not work. > > If the activator is in the a.b.impl package > > i will recive errors like '...unable to load class activator' . > > Only if all packages are exported via bundle, it works. > > > > this really sounds like your build is not working properly and > you are not getting the "impl" classes in your final JAR file. > > please do a "jar tvf" on your JAR, as I explained later on in > my reply (my comments were interleaved with your email) > > if the impl classes are missing then add this Bnd instruction: > > Private-Package: a.b.impl > > as Filippo also suggested - this will then pull in your impl > classes, at which point moving your bundle activator to > also be in 'impl' will also work (as I also explained in my > earlier reply ;) > > HTH > > > > -------- Original-Nachricht -------- > > > Datum: Tue, 23 Jun 2009 21:12:40 +0200 > > > Von: Stuart McCulloch <[email protected]> > > > An: [email protected] > > > Betreff: Re: packaging problem in bundle > > > > > 2009/6/23 Andreas Mucha <[email protected]> > > > > > > > Hello all, > > > > > > > > i have the following packaging problem. > > > > I have e.g. the following package structure: > > > > > > > > a.b > > > > SomeInterface.java > > > > SomeBundleActivator.java > > > > > > > > > > FYI your bundle activator does not have to be exported, it only needs > to > > > be > > > a public class. > > > Best-practice is to keep your activator under the implementation > package, > > > as > > > it's often an > > > implementation detail rather than part of the external API > > > > > > > > > > a.b.impl > > > > SomeInterfaceImpl.java > > > > > > > > Based on this i create a bnd file like this: > > > > > > > > Bundle-Version: 1.0.0 > > > > Export-Package: a.b;version=1.0.0 > > > > Bundle-Name: a.b > > > > Bundle-SymbolicName: SomeBundle > > > > Bundle-Activator: a.b.SomeBundleActivator > > > > Bundle-Vendor: AnM > > > > > > > > If i create a bundle based on this i get an error while starting > > > > because the a.b.impl package cannot be resolved. > > > > How can this be??? It is only used within the bundle. > > > > > > > > > Check the package actually exists in your bundle (ie. "jar tvf > > > myBundle.jar") > > > > > > Because if you are using Bnd's Ant task then you need to tell it to > also > > > pull in the private packages as well as the exported packages like so: > > > > > > Export-Package: a.b;version=1.0.0 > > > Private-Package: a.b.impl > > > > > > Otherwise you'll just end up with the exported packages in the final > > > bundle. > > > ( Bnd uses a "pull" approach, as explained in > http://aqute.biz/Code/Bnd) > > > > > > FYI if you use the 2.0.0 maven-bundle-plugin then it will > automatically > > > add > > > the Private-Package instruction based your source code if you miss it > > out, > > > before calling Bnd to create the actuall bundle > > > > > > HTH > > > > > > I will hide the a.b.impl package. Only the a.b package > > > > should be available to other bundles. > > > > I thought that a bundle is selfcontaint. > > > > > > > > If i export all packages than it works. > > > > > > > > Can you tell me what is happening here ? > > > > > > > > Thanks in advance. > > > > > > > > Andreas . > > > > -- > > > > GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! > > > > Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: [email protected] > > > > For additional commands, e-mail: [email protected] > > > > > > > > > > > -- > > > Cheers, Stuart > > > > -- > > GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! > > Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > -- > Cheers, Stuart -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

