Hi everyone . I am trying to get a very basic embedded version of Felix
running in an maven build using OBR. I am sure I am missing something
basic, but am failing to find the answer. I am guessing I need to load
the OBR bundle and then load my bundle, but doesn't the specific loading
defeat the purpose of OBR?
 
 In my main project enclosing the embedded Felix I have 
 
public static void main(String[] args) {

final Felix felix = new Felix(null);

try {

felix.start();

} catch (BundleException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {

@Override

public void run() {

try {

System.out.println("Stopping felix");

felix.stop();

felix.waitForStop(6000);

} catch (BundleException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (InterruptedException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

}));

    OtherClass o = new OtherClass();

    o.doFunction();

}

In the pom.xml I have 

<dependency>

<groupId>org.apache.felix</groupId>

<artifactId>org.apache.felix.framework</artifactId>

<version>1.4.1</version>

</dependency>

<dependency>

<groupId>org.apache.felix</groupId>

<artifactId>org.osgi.service.obr</artifactId>

<version>1.0.2</version>

<type>bundle</type>

</dependency>

<dependency>

<groupId>otherclass</groupId>

<artifactId>otherclass</artifactId>

<version> 0.0.1</version>

<type>bundle</type>

</dependency>

The source for otherclass is:

class OtherClass

{

    public void doSomething()

{

    system.out.println("doing something");

}

}

The otherclass pom contains 

<build>

<plugins>

<plugin>

<groupId>org.apache.felix</groupId>

<artifactId>maven-bundle-plugin</artifactId>

<version>2.0.0</version>

<extensions>true</extensions>

<configuration>

<instructions>

<Export-Package>*</Export-Package>

</instructions>

</configuration>

</plugin>

</plugins>

</build>

Damon Jacobsen

Software Engineer

Lifetouch Portrait Studios

(775)677-6909

 

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

Reply via email to