Bug or missing configuration?

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

Bug or missing configuration?

djawaica
Hello together,

I try to explain my problem as short as possible.

Context description:
-------------------
Karaf Versions: 4.1.7. , 4.2.0 and 4.2.6
jdk Version: 1.8.0_161
host os: windows 10

Use Case:
---------.
1.) starting karaf in server mode
2.) install feature scr for declarative service support   - feature:install
scr
3.) install very simple bundle from local filesystem       - install
file:///C:/....../...jar
4.) start new installed bundle

How the installed bundle looks like and the resulting problem:
----------------------------------------------------------
@Component(immediate = true)
public final class Main {
        @Activate
        public void OnActivate() {
                System.out.println("Main.OnActivate() ENTER");
                try {
                        System.out.println(SSLContext.class.getName());
                }catch (Exception e) {
                        e.printStackTrace();
                }
                System.out.println("Main.OnActivate() EXIT");
}

The only output I get comes from the first System.out.println.
The trial to access the SSLContext results in a NoClassDefFoundError:
javax/net/ssl/SSLContext
and the bundle changing into state "WAITING"

Has anybody an idea how to bring karaf class loader to find the class file,
which is part of the runtime?
java.home= (.set.to.)\jdk1.8.0_161\jre
java.library.path=(.set.to.)\jdk1.8.0_161\bin;(.some.other.);(...)\apache-karaf-4.2.6\bin\..\lib;(...)\apache-karaf-4.2.6\bin\..\lib;.

Thankx a lot for all comments
djawaica

 



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

Re: Bug or missing configuration?

David Jencks-2
How do you build your bundle?
Does it explicitly import the package of the missing class? (it needs to)

David Jencks

> On Jul 23, 2019, at 11:33 AM, djawaica <[hidden email]> wrote:
>
> Hello together,
>
> I try to explain my problem as short as possible.
>
> Context description:
> -------------------
> Karaf Versions: 4.1.7. , 4.2.0 and 4.2.6
> jdk Version: 1.8.0_161
> host os: windows 10
>
> Use Case:
> ---------.
> 1.) starting karaf in server mode
> 2.) install feature scr for declarative service support   - feature:install
> scr
> 3.) install very simple bundle from local filesystem       - install
> file:///C:/....../...jar
> 4.) start new installed bundle
>
> How the installed bundle looks like and the resulting problem:
> ----------------------------------------------------------
> @Component(immediate = true)
> public final class Main {
> @Activate
> public void OnActivate() {
> System.out.println("Main.OnActivate() ENTER");
> try {
> System.out.println(SSLContext.class.getName());
> }catch (Exception e) {
> e.printStackTrace();
> }
> System.out.println("Main.OnActivate() EXIT");
> }
>
> The only output I get comes from the first System.out.println.
> The trial to access the SSLContext results in a NoClassDefFoundError:
> javax/net/ssl/SSLContext
> and the bundle changing into state "WAITING"
>
> Has anybody an idea how to bring karaf class loader to find the class file,
> which is part of the runtime?
> java.home= (.set.to.)\jdk1.8.0_161\jre
> java.library.path=(.set.to.)\jdk1.8.0_161\bin;(.some.other.);(...)\apache-karaf-4.2.6\bin\..\lib;(...)\apache-karaf-4.2.6\bin\..\lib;.
>
> Thankx a lot for all comments
> djawaica
>
>
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Reply | Threaded
Open this post in threaded view
|

Re: Bug or missing configuration?

djawaica
The bundle is build with:
Eclipse IDE for Enterprise Java Developers.
Version: 2019-03 (4.11.0)
Build id: 20190314-1200

Confirmes to R4 and is running in Eclipse environment perfect.
The class is imported:
import javax.net.ssl.SSLContext;
otherwise it will not be build.

After build export with wizard: Deployable plug-ins and fragments

It seems as Karaf is unable to find the path to javax.net.ssl.SSLContext.
avax.net.ssl.SSLContext is part of the JRE System library (rt.jar).
So, why is Karaf unable to find the class-file?

First I thought: Difference between build jdk and running jdk - but they are
the same.
Missing Import-Package: javax.net.ssl ? No- was there.

Downloaded new Karaf Distribution
Deleted Import-Package: javax.net.ssl
Stored Manifest
Inserted Import-Package: javax.net.ssl
again stored Manifest

--> and now it is running  !!! ???




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

Re: Bug or missing configuration?

jbonofre
Hi,

You can take a look on the wiring with bundle:tree-show. You will see
where the javax.net.ssl coming is coming.

Anyway, it seems to be an issue with your bundle/MANIFEST.

Regards
JB

On 24/07/2019 10:37, djawaica wrote:

> The bundle is build with:
> Eclipse IDE for Enterprise Java Developers.
> Version: 2019-03 (4.11.0)
> Build id: 20190314-1200
>
> Confirmes to R4 and is running in Eclipse environment perfect.
> The class is imported:
> import javax.net.ssl.SSLContext;
> otherwise it will not be build.
>
> After build export with wizard: Deployable plug-ins and fragments
>
> It seems as Karaf is unable to find the path to javax.net.ssl.SSLContext.
> avax.net.ssl.SSLContext is part of the JRE System library (rt.jar).
> So, why is Karaf unable to find the class-file?
>
> First I thought: Difference between build jdk and running jdk - but they are
> the same.
> Missing Import-Package: javax.net.ssl ? No- was there.
>
> Downloaded new Karaf Distribution
> Deleted Import-Package: javax.net.ssl
> Stored Manifest
> Inserted Import-Package: javax.net.ssl
> again stored Manifest
>
> --> and now it is running  !!! ???
>
>
>
>
> --
> 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