2008/7/9 Tim Kettler <[EMAIL PROTECTED]>:

> Stuart McCulloch schrieb:
> > 2008/7/9 Tim Kettler <[EMAIL PROTECTED]>:
> >
> >> Here it comes:
> >>
> >> Manifest content:
> >>
> >>   Manifest-Version: 1.0
> >>   Export-Package: testgroup.testbundle;uses:="org.apache.log4j,org.osgi.
> >>    framework"
> >>   Built-By: tik
> >>   Build-Jdk: 1.6.0_06
> >>   Bundle-Version: 1.0.0.SNAPSHOT
> >>   Tool: Bnd-0.0.255
> >>   Bundle-Name: Unnamed - testgroup:testbundle:bundle:1.0-SNAPSHOT
> >>   Bnd-LastModified: 1215605207422
> >>   Created-By: Apache Maven Bundle Plugin
> >>   Bundle-ManifestVersion: 2
> >>   Bundle-SymbolicName: testgroup.testbundle
> >>   Import-Package: org.apache.log4j,org.osgi.framework,testgroup.testbund
> >>    le
> >>
> >
> > you're missing the Bundle-Activator header, which is why your activator
> is
> > not being started:
> >
> >    Bundle-Activator: testgroup.testbundle.Activator
> >
> > see
> >
> http://www2.osgi.org/javadoc/r4/org/osgi/framework/Constants.html#BUNDLE_ACTIVATOR
>
> Strange, it's configured in the bundles pom.xml:
>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.felix</groupId>
>         <artifactId>maven-bundle-plugin</artifactId>
>         <extensions>true</extensions>
>       </plugin>
>     </plugins>
>
>     <pluginManagement>
>       <plugins>
>         <plugin>
>           <groupId>org.apache.felix</groupId>
>           <artifactId>maven-bundle-plugin</artifactId>
>           <version>1.4.1</version>
>           <configuration>
>   <Bundle-Activator>testgroup.testbundle.Activator</Bundle-Activator>
>           </configuration>
>         </plugin>
>

ah, that should be:

  <configuration>
     <instructions>
      <Bundle-Activator>testgroup.testbundle.Activator</Bundle-Activator>
     </instructions>
  </configuration>

any BND instructions must go inside the <instructions> block.

see the examples at:

  http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html

HTH


>         ...
>       </plugins>
>     </pluginManagement>
>   </build>
>
> > Bundle content:
> >>   .
> >>   |-- META-INF
> >>   |   `-- MANIFEST.MF
> >>   `-- testgroup
> >>       `-- testbundle
> >>           `-- Activator.class
> >>
> >> I've also put the project sources on a public accessible location:
> >>
> >>   http://criticalsection.org/public/osgi-bundle.tar.gz
> >>
> >> -Tim
> >>
> >> Niclas Hedhman schrieb:
> >>> Can you send the Manifest of the Test Bundle??
> >>> And also, just to be safe, a list of the content in the bundle...
> >>>
> >>> Cheers
> >>> Niclas
> >>>
> >>> On Wed, Jul 9, 2008 at 3:36 PM, Tim Kettler <[EMAIL PROTECTED]>
> wrote:
> >>>> Hi,
> >>>>
> >>>> I'm trying to get up and running with pax-logging. I have a very
> simple
> >>>> bundle just containing an activator with this code:
> >>>>
> >>>>   Logger LOG = Logger.getLogger( Activator.class );
> >>>>
> >>>>   public void start( BundleContext _bundleContext )
> >>>>       throws Exception
> >>>>   {
> >>>>       LOG.info( "TestBundle started." );
> >>>>   }
> >>>>
> >>>> The bundle depends on pax-logging-api:
> >>>>
> >>>>   <dependency>
> >>>>     <groupId>org.ops4j.pax.logging</groupId>
> >>>>     <artifactId>pax-logging-api</artifactId>
> >>>>     <version>1.2-SNAPSHOT</version>
> >>>>     <scope>provided</scope>
> >>>>   </dependency>
> >>>>
> >>>> Next I have an integration test for this bundle (using pax-drone):
> >>>>
> >>>>   public class SimpleTest extends DroneTestCase
> >>>>   {
> >>>>       Logger LOG = Logger.getLogger( SimpleTest.class );
> >>>>
> >>>>       public ConnectorConfiguration configure()
> >>>>       {
> >>>>           return ConnectorConfigurationFactory.create( this )
> >>>>               .setPlatform(Platforms.FELIX)
> >>>> .addBundle("mvn:org.ops4j.pax.logging/pax-logging-api/1.2-SNAPSHOT")
> >>>>
> .addBundle("mvn:org.ops4j.pax.logging/pax-logging-service/1.2-SNAPSHOT")
> >>>> .addBundle("mvn:testgroup/testbundle/[EMAIL PROTECTED]");
> >>>>       }
> >>>>
> >>>>     public void testBundles()
> >>>>     {
> >>>>         LOG.info( "foo:info" );
> >>>>     }
> >>>> }
> >>>>
> >>>> When I run the integration test I can see that the testbundle is
> started
> >>>> (after pax-logging-*):
> >>>>
> >>>>   OUT: [FelixDispatchQueue] INFO testgroup.testbundle - BundleEvent
> >>>>   RESOLVED
> >>>>   OUT: [FelixDispatchQueue] INFO testgroup.testbundle - BundleEvent
> >>>>   STARTED
> >>>>
> >>>> and that the logging statement from the integration test is printed:
> >>>>
> >>>>   [RMI TCP Connection(1)-192.168.10.100] INFO test1.SimpleTest -
> >>>>   foo:info
> >>>>
> >>>> What is not printed is the expected logging output from
> >>>> Activator.start() of the bundle under testing. I've banged my head for
> a
> >>>> day now to get this working. I've even tried with pax-runner and felix
> >>>> standalone.
> >>>>
> >>>> Do I miss anything obvious that needs to be done/configured to make
> this
> >>>> work?
> >>>>
> >>>> Thanks,
> >>>> -Tim
> >>>>
> >>>> _______________________________________________
> >>>> general mailing list
> >>>> general@lists.ops4j.org
> >>>> http://lists.ops4j.org/mailman/listinfo/general
> >>>>
> >>> _______________________________________________
> >>> general mailing list
> >>> general@lists.ops4j.org
> >>> http://lists.ops4j.org/mailman/listinfo/general
> >>
> >> _______________________________________________
> >> general mailing list
> >> general@lists.ops4j.org
> >> http://lists.ops4j.org/mailman/listinfo/general
> >>
> >
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > general mailing list
> > general@lists.ops4j.org
> > http://lists.ops4j.org/mailman/listinfo/general
>
>
> _______________________________________________
> general mailing list
> general@lists.ops4j.org
> http://lists.ops4j.org/mailman/listinfo/general
>



-- 
Cheers, Stuart
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to