Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M4
    • Fix Version/s: 2.0.0-M7
    • Component/s: None
    • Labels:
    • Environment:
      linux

      Description

      ApacheDS is moving on OSGI. To easily run and debug code on OSGI, custom Felix Framework and its launchers must be added to ApacheDS.

      1. custom-felix.diff
        31 kB
        Göktürk Gezer
      2. ApacheDS-OSGI.launch.log
        74 kB
        Pierre-Arnaud Marcelot

        Activity

        Hide
        Göktürk Gezer added a comment -

        Patch Notes:
        2 submodule added:

        • apacheds/apache-felix
        • apacheds/dependencies
        • in both apacheds and shared, there are some changed poms.

        Custom Felix Framework is added as apacheds/apache-felix submodule. Felix is embedded as POM. On install, this pom fetches all necessary felix binaries and ApacheDS's dependencies into corresponding directories. There is also a launcher named ApacheDS-OSGI.launch for launching Felix with all dependencies and ApacheDS bundles.

        3 dependencies of ApacheDS is not OSGI compatible. So i embed them in a new project apacheds/dependencies and export their needed packages.

        Show
        Göktürk Gezer added a comment - Patch Notes: 2 submodule added: apacheds/apache-felix apacheds/dependencies in both apacheds and shared, there are some changed poms. Custom Felix Framework is added as apacheds/apache-felix submodule. Felix is embedded as POM. On install, this pom fetches all necessary felix binaries and ApacheDS's dependencies into corresponding directories. There is also a launcher named ApacheDS-OSGI.launch for launching Felix with all dependencies and ApacheDS bundles. 3 dependencies of ApacheDS is not OSGI compatible. So i embed them in a new project apacheds/dependencies and export their needed packages.
        Hide
        Pierre-Arnaud Marcelot added a comment -

        The patch got applied by Emmanuel.

        Really good job.

        I was almost able to run ApacheDS inside Felix. Unfortunately recent modifications done in the interceptors projects has made the bundle hierarchy a little inconsistent (see the log file).

        I had to manually add the 'felix.jar' from the 'bin' folder to the build path to be able to run Felix, otherwise I'd get the following error:
        Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/felix/main/Main
        Caused by: java.lang.ClassNotFoundException: org.apache.felix.main.Main
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

        Is this normal ?

        Looking forward to be able to fully run it.

        Show
        Pierre-Arnaud Marcelot added a comment - The patch got applied by Emmanuel. Really good job. I was almost able to run ApacheDS inside Felix. Unfortunately recent modifications done in the interceptors projects has made the bundle hierarchy a little inconsistent (see the log file). I had to manually add the 'felix.jar' from the 'bin' folder to the build path to be able to run Felix, otherwise I'd get the following error: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/felix/main/Main Caused by: java.lang.ClassNotFoundException: org.apache.felix.main.Main at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Is this normal ? Looking forward to be able to fully run it.
        Hide
        Göktürk Gezer added a comment -

        Hi Pierre,

        As i described in the email. You must first rightclick at apache-felix/bin/felix.jar and then click "Build Path" -> "Add to Build Path". After that you can run felix using the launcher i provided.

        To be able to debug with source code support, you must also add all projects as project dependency for apache-felix project, and then restart the eclipse.

        Show
        Göktürk Gezer added a comment - Hi Pierre, As i described in the email. You must first rightclick at apache-felix/bin/felix.jar and then click "Build Path" -> "Add to Build Path". After that you can run felix using the launcher i provided. To be able to debug with source code support, you must also add all projects as project dependency for apache-felix project, and then restart the eclipse.
        Hide
        Göktürk Gezer added a comment -

        By the way, for now there is not so many things in ApacheDS that you can run and test inside felix. You can only test it by putting brake-point on shared-ldap-extra-codec's BundleActivator.

        Show
        Göktürk Gezer added a comment - By the way, for now there is not so many things in ApacheDS that you can run and test inside felix. You can only test it by putting brake-point on shared-ldap-extra-codec's BundleActivator.
        Hide
        Pierre-Arnaud Marcelot added a comment -

        Hi Göktürk,

        Sorry I didn't saw the instructions in the mail.

        How about adding it as a 'provided' dependency to the pom?
        <dependencies>
        <dependency>
        <groupId>org.apache.felix</groupId>
        <artifactId>org.apache.felix.main</artifactId>
        <version>4.0.1</version>
        <scope>provided</scope>
        </dependency>

        This would avoid the extra step and manual configuration.

        Show
        Pierre-Arnaud Marcelot added a comment - Hi Göktürk, Sorry I didn't saw the instructions in the mail. How about adding it as a 'provided' dependency to the pom? <dependencies> <dependency> <groupId>org.apache.felix</groupId> <artifactId>org.apache.felix.main</artifactId> <version>4.0.1</version> <scope>provided</scope> </dependency> This would avoid the extra step and manual configuration.
        Hide
        Göktürk Gezer added a comment -

        Hi Pierre,

        Yes we can also add dependencies for other projects to avoid the second step too. As first i just didn't want to inflate the pom much.

        But i'm not sure about adding felix.main as dependency will solve the first step, because its location is set manually, but i didn't try though. I'll try it and patch if it goes well.

        Show
        Göktürk Gezer added a comment - Hi Pierre, Yes we can also add dependencies for other projects to avoid the second step too. As first i just didn't want to inflate the pom much. But i'm not sure about adding felix.main as dependency will solve the first step, because its location is set manually, but i didn't try though. I'll try it and patch if it goes well.
        Hide
        Pierre-Arnaud Marcelot added a comment -

        I thought the project was there on its own, to allow us to run and debug ApacheDS inside Felix (and that the project was not intended to be used by any other project).

        There's no need to manually set the location. The classpath is updated automatically by 'mvn eclipse:eclipse'.
        I tested it and I was able to run Felix successfully (with the same current errors as before).

        Show
        Pierre-Arnaud Marcelot added a comment - I thought the project was there on its own, to allow us to run and debug ApacheDS inside Felix (and that the project was not intended to be used by any other project). There's no need to manually set the location. The classpath is updated automatically by 'mvn eclipse:eclipse'. I tested it and I was able to run Felix successfully (with the same current errors as before).
        Hide
        Göktürk Gezer added a comment -

        Hmm, okey. If it works, that's good

        So we can fine tune that apache-felix pom by making it fully integrated to eclipse.

        Show
        Göktürk Gezer added a comment - Hmm, okey. If it works, that's good So we can fine tune that apache-felix pom by making it fully integrated to eclipse.
        Hide
        Göktürk Gezer added a comment -

        No longer necessary inside Eclipse, since we're able to launch Equinox Launcher.

        Show
        Göktürk Gezer added a comment - No longer necessary inside Eclipse, since we're able to launch Equinox Launcher.

          People

          • Assignee:
            Unassigned
            Reporter:
            Göktürk Gezer
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development