felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cook, Michael J. (OCTO)" <Michael_J_C...@cable.comcast.com>
Subject Getting Started with iPOJO
Date Thu, 11 Oct 2012 17:13:23 GMT
Hi,

I can't seem to find a good article that will help me resolve the "getting started" issue
I am facing.

I am using Eclipse Juno (4.2) on my Mac.

I have downloaded and installed the iPOJO eclipse plugin, from: http://clement.plop-plop.net/update/

I have created a sample project following the instructions at: http://felix.apache.org/site/ipojo-eclipse-plug-in.html

I have integrated Felix into Eclipse as a project, following instructions here: http://felix.apache.org/site/integrating-felix-with-eclipse.html

I have downloaded the following iPOJO bundle: org.apache.felix.ipojo-1.8.2.jar

I've launched Felix in the Eclipse console and I've installed the org.apache.felix.ipojo-1.8.2.jar
bundle and started it.

I've created a test bundle using iPOJO called iPojoTest.jar and I've installed it and started
it in the OSGI console.

I run bundles in the console and I get:

g! bundles

    0|Active     |    0|org.apache.felix.framework (3.0.7)

    1|Active     |    1|org.apache.felix.bundlerepository (1.6.2)

    2|Active     |    1|org.apache.felix.gogo.command (0.6.1)

    3|Active     |    1|org.apache.felix.gogo.runtime (0.6.1)

    4|Active     |    1|org.apache.felix.gogo.shell (0.6.1)

   12|Active     |    1|iPojoTest (1.4.0)

   13|Active     |    1|org.apache.felix.ipojo (1.8.2)


So, the bundle seems to have started.

But I don't get any console output from my sysouts…

Here are the start() and stop() methods:


 @Validate

    public void start() throws IOException {

                System.out.println("I'm starting...");

        try{

          // Create file

                  FileWriter fstream = new FileWriter("/Users/mcook008/out.txt");

                  BufferedWriter out = new BufferedWriter(fstream);

                  out.write("Hello Java");

                  //Close the output stream

                  out.close();

                  }catch (Exception e){//Catch exception if any

                  System.err.println("Error: " + e.getMessage());

                  }

        throw new IOException() ;

    }

    @Invalidate

    public void stop() {

        System.out.println("I'm leaving !");

    }




I added in the file write to see if a file would be created.  There is no file created.  So,
while OSGi thinks the bundle is ACTIVE, the start method appears never have to been called.


Can anyone tell me what I may have done wrong or provide a clue as to what to look at to help
diagnose the problem?


Thanks,

Mike


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message