Using Felix HTTP Bundle in Karaf v4.2.0

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using Felix HTTP Bundle in Karaf v4.2.0

themanatuf
I'm trying to get org.apache.felix.http.bundle v3.0.0 to work under Karaf
v4.2.0 but am not having much success. We are using Karaf on an internal
network that does not have Internet access so I cannot use the http feature
that is already within Karaf.

We are upgrading Karaf from v3.0 and we were also using
org.apache.felix.http.bundle v2.2.2. This worked as expected (the HTTP
service started with Karaf and hosted our internal web pages). However
trying to use the latest version of Karaf and this new http bundle is giving
us an "IncompatibleClassChangeError: Implementing class" when the
org.apache.felix.http.bundle is started. Here are the steps to reproduce:

1. Download a copy of apache-karaf-4.2.0.tar.gz and untar it
2. Download a copy of org.apache.felix.http.bundle-3.0.0.jar
3. cd into apache-karaf-4.2.0
4. mkdir -p system/org/apache/felix/org.apache.felix.http.bundle/3.0.0/
5. Copy org.apache.felix.http.bundle-3.0.0.jar into the directory you just
created
6. Open
system/org/apache/karaf/features/standard/4.2.0/standard-4.2.0-features.xml
7. At the bottom, before '<feature name="standard"...>' add the following
lines:

<feature name="felix-http" description="Apache Felix HTTP Bundle"
version="4.2.0">
    <bundle>mvn:org.apache.felix/org.apache.felix.http.bundle/3.0.0</bundle>
    <config name="org.apache.felix.http">
        org.osgi.service.http.port=8888
    </config>
</feature>

8. Open etc/custom.properties
9. Add the following line to the bottom: org.apache.felix.jettyEnabled =
true
10. Execute ./bin/karaf
11. At the karaf prompt type: feature:install felix-http

At this point I get a stack trace about trying to start the bundle. Am I
doing something wrong? This seems like a pretty simple use case but I cannot
figure out how to make it work. Thanks a lot for anyone's help as this has
been bugging me for days.



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Using Felix HTTP Bundle in Karaf v4.2.0

jbonofre
Hi,

In Karaf, the HTTP service is provided by Pax Web, and it's the
recommended approach (feature:install http).

Any reason why to use Felix HTTP instead ?

Anyway, regarding your error, I have to check if the Felix HTTP bundle
has been compiled with Java 7/8.

Regards
JB

On 11/06/2018 22:11, themanatuf wrote:

> I'm trying to get org.apache.felix.http.bundle v3.0.0 to work under Karaf
> v4.2.0 but am not having much success. We are using Karaf on an internal
> network that does not have Internet access so I cannot use the http feature
> that is already within Karaf.
>
> We are upgrading Karaf from v3.0 and we were also using
> org.apache.felix.http.bundle v2.2.2. This worked as expected (the HTTP
> service started with Karaf and hosted our internal web pages). However
> trying to use the latest version of Karaf and this new http bundle is giving
> us an "IncompatibleClassChangeError: Implementing class" when the
> org.apache.felix.http.bundle is started. Here are the steps to reproduce:
>
> 1. Download a copy of apache-karaf-4.2.0.tar.gz and untar it
> 2. Download a copy of org.apache.felix.http.bundle-3.0.0.jar
> 3. cd into apache-karaf-4.2.0
> 4. mkdir -p system/org/apache/felix/org.apache.felix.http.bundle/3.0.0/
> 5. Copy org.apache.felix.http.bundle-3.0.0.jar into the directory you just
> created
> 6. Open
> system/org/apache/karaf/features/standard/4.2.0/standard-4.2.0-features.xml
> 7. At the bottom, before '<feature name="standard"...>' add the following
> lines:
>
> <feature name="felix-http" description="Apache Felix HTTP Bundle"
> version="4.2.0">
>     <bundle>mvn:org.apache.felix/org.apache.felix.http.bundle/3.0.0</bundle>
>     <config name="org.apache.felix.http">
>         org.osgi.service.http.port=8888
>     </config>
> </feature>
>
> 8. Open etc/custom.properties
> 9. Add the following line to the bottom: org.apache.felix.jettyEnabled =
> true
> 10. Execute ./bin/karaf
> 11. At the karaf prompt type: feature:install felix-http
>
> At this point I get a stack trace about trying to start the bundle. Am I
> doing something wrong? This seems like a pretty simple use case but I cannot
> figure out how to make it work. Thanks a lot for anyone's help as this has
> been bugging me for days.
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Using Felix HTTP Bundle in Karaf v4.2.0

jbonofre
OK, it seems that the problem is in Felix HTTP. Let me try.

By the way, you can always prepare your own Karaf distribution embedding
Pax Web, it will work without internet connection.

Regards
JB

On 12/06/2018 13:21, themanatuf wrote:

> The reasoning is we are running this application on an internal network that
> is not connected to the Internet. The org.apache.felix.http.bundle is a
> single jar rather than downloading all of the jars included in the http
> feature. The older version of Felix (v2.2.2) works with the upgraded Karaf,
> but the v3.0.0 version does not. If you repeat my steps but use Felix v2.2.2
> instead of v3.0.0 everything will work just fine. We need v3.0.0 due to some
> of the security updates that are included with it. Thanks for any other
> advice you can provide.
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com