karaf 3.0.1 just prints NullPointerException trying to append a property

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

karaf 3.0.1 just prints NullPointerException trying to append a property

KARR, DAVID
I'm unfortunately forced to use Karaf 3.0.1 for some maintenance changes I need to make, and I don't even regularly use karaf.

The setup process requires entering some commands into karaf after it starts up.  First there's a call to "config:property-append" with certain parameters.  When I do this, or even just "config:property-append --help", it just says "Error executing command: java.lang.NullPointerException", with no other information.

What might be wrong here, and what can I do to get more information?

Assuming I get this working, is it practical to pipe a set of commands into karaf, so it will enter them after it presents the command prompt?
Reply | Threaded
Open this post in threaded view
|

Re: karaf 3.0.1 just prints NullPointerException trying to append a property

jbonofre
Hi David,

Something is wrong on 3.0.1 (at least with Java 8): all commands throw a
NullPointerException (even a simple bundle:list).

After a quick look, it seems to be related to blueprint and aries proxy (and asm).

I'm checking and I will fix that.

Regards
JB

On 09/28/2017 12:45 AM, KARR, DAVID wrote:
> I'm unfortunately forced to use Karaf 3.0.1 for some maintenance changes I need to make, and I don't even regularly use karaf.
>
> The setup process requires entering some commands into karaf after it starts up.  First there's a call to "config:property-append" with certain parameters.  When I do this, or even just "config:property-append --help", it just says "Error executing command: java.lang.NullPointerException", with no other information.
>
> What might be wrong here, and what can I do to get more information?
>
> Assuming I get this working, is it practical to pipe a set of commands into karaf, so it will enter them after it presents the command prompt?
>

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

Re: karaf 3.0.1 just prints NullPointerException trying to append a property

Achim Nierbeck
Hi, 

afair 3.0.x was never "designed" to work with Java8. 
The reason might have been the ASM stuff, so I wouldn't rely on that. 

If you want to use Karaf 3.0.x you'll need to stick to Java 7 I fear. 

regards, Achim 


2017-09-28 7:22 GMT+02:00 Jean-Baptiste Onofré <[hidden email]>:
Hi David,

Something is wrong on 3.0.1 (at least with Java 8): all commands throw a NullPointerException (even a simple bundle:list).

After a quick look, it seems to be related to blueprint and aries proxy (and asm).

I'm checking and I will fix that.

Regards
JB


On 09/28/2017 12:45 AM, KARR, DAVID wrote:
I'm unfortunately forced to use Karaf 3.0.1 for some maintenance changes I need to make, and I don't even regularly use karaf.

The setup process requires entering some commands into karaf after it starts up.  First there's a call to "config:property-append" with certain parameters.  When I do this, or even just "config:property-append --help", it just says "Error executing command: java.lang.NullPointerException", with no other information.

What might be wrong here, and what can I do to get more information?

Assuming I get this working, is it practical to pipe a set of commands into karaf, so it will enter them after it presents the command prompt?


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



--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master 

Reply | Threaded
Open this post in threaded view
|

Re: karaf 3.0.1 just prints NullPointerException trying to append a property

jbonofre
Karaf 3.x works with Java8. Even Karaf 2.4.x also works with Java8. However, we
fixed issues with Java8 starting from Karaf 3.0.4.

I just tested 3.0.7 on Java8 without problem.

Regards
JB

On 09/28/2017 08:37 AM, Achim Nierbeck wrote:

> Hi,
>
> afair 3.0.x was never "designed" to work with Java8.
> The reason might have been the ASM stuff, so I wouldn't rely on that.
>
> If you want to use Karaf 3.0.x you'll need to stick to Java 7 I fear.
>
> regards, Achim
>
>
> 2017-09-28 7:22 GMT+02:00 Jean-Baptiste Onofré <[hidden email]
> <mailto:[hidden email]>>:
>
>     Hi David,
>
>     Something is wrong on 3.0.1 (at least with Java 8): all commands throw a
>     NullPointerException (even a simple bundle:list).
>
>     After a quick look, it seems to be related to blueprint and aries proxy (and
>     asm).
>
>     I'm checking and I will fix that.
>
>     Regards
>     JB
>
>
>     On 09/28/2017 12:45 AM, KARR, DAVID wrote:
>
>         I'm unfortunately forced to use Karaf 3.0.1 for some maintenance changes
>         I need to make, and I don't even regularly use karaf.
>
>         The setup process requires entering some commands into karaf after it
>         starts up.  First there's a call to "config:property-append" with
>         certain parameters.  When I do this, or even just
>         "config:property-append --help", it just says "Error executing command:
>         java.lang.NullPointerException", with no other information.
>
>         What might be wrong here, and what can I do to get more information?
>
>         Assuming I get this working, is it practical to pipe a set of commands
>         into karaf, so it will enter them after it presents the command prompt?
>
>
>     --
>     Jean-Baptiste Onofré
>     [hidden email] <mailto:[hidden email]>
>     http://blog.nanthrax.net
>     Talend - http://www.talend.com
>
>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>

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

RE: karaf 3.0.1 just prints NullPointerException trying to append a property

KARR, DAVID
In reply to this post by KARR, DAVID


> -----Original Message-----
> From: KARR, DAVID
> Sent: Wednesday, September 27, 2017 3:46 PM
> To: [hidden email]
> Subject: karaf 3.0.1 just prints NullPointerException trying to append a
> property
>
> I'm unfortunately forced to use Karaf 3.0.1 for some maintenance changes
> I need to make, and I don't even regularly use karaf.
>
> The setup process requires entering some commands into karaf after it
> starts up.  First there's a call to "config:property-append" with
> certain parameters.  When I do this, or even just "config:property-
> append --help", it just says "Error executing command:
> java.lang.NullPointerException", with no other information.
>
> What might be wrong here, and what can I do to get more information?
>
> Assuming I get this working, is it practical to pipe a set of commands
> into karaf, so it will enter them after it presents the command prompt?

I realized that although the console doesn't tell me much, the log file would tell me more.

I found the NPE in the log, and there was also another exception before it.  Here's an excerpt that includes both:
----------------------
java.lang.IllegalArgumentException
        at org.objectweb.asm.ClassReader.<init>(Unknown Source)
        at org.objectweb.asm.ClassReader.<init>(Unknown Source)
        at org.objectweb.asm.ClassReader.<init>(Unknown Source)
        at org.apache.aries.proxy.impl.gen.ProxySubclassAdapter.visit(ProxySubclassAdapter.java:274)
        at org.objectweb.asm.ClassReader.accept(Unknown Source)
        at org.objectweb.asm.ClassReader.accept(Unknown Source)
        at org.apache.aries.proxy.impl.gen.ProxySubclassGenerator.processClass(ProxySubclassGenerator.java:245)
        at org.apache.aries.proxy.impl.gen.ProxySubclassGenerator.generateAndLoadSubclass(ProxySubclassGenerator.java:224)
        at org.apache.aries.proxy.impl.gen.ProxySubclassGenerator.getProxySubclass(ProxySubclassGenerator.java:126)
        at org.apache.aries.proxy.impl.gen.ProxySubclassGenerator.newProxySubclassInstance(ProxySubclassGenerator.java:161)
        at org.apache.aries.proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:103)
        at org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingInterceptingProxy(AbstractProxyManager.java:75)
        at org.apache.aries.proxy.impl.AbstractProxyManager.createInterceptingProxy(AbstractProxyManager.java:53)
        at org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:535)
        at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:308)
        at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:219)
        at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:320)
        at org.apache.felix.framework.Felix.getService(Felix.java:3568)
        at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)
        at org.apache.karaf.service.guard.impl.GuardProxyCatalog$ProxyServiceFactory.getService(GuardProxyCatalog.java:424)
        at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:308)
        at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:219)
        at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:320)
        at org.apache.felix.framework.Felix.getService(Felix.java:3568)
        at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)
        at org.apache.karaf.shell.console.completer.CommandsCompleter.unProxy(CommandsCompleter.java:298)
        at org.apache.karaf.shell.console.completer.CommandsCompleter.checkData(CommandsCompleter.java:234)
        at org.apache.karaf.shell.console.completer.CommandsCompleter.complete(CommandsCompleter.java:86)
        at org.apache.karaf.shell.console.impl.jline.CompleterAsCompletor.complete(CompleterAsCompletor.java:32)
        at jline.console.ConsoleReader.complete(ConsoleReader.java:3077)[26:jline:2.11.0]
        at jline.console.ConsoleReader.readLine(ConsoleReader.java:2501)[26:jline:2.11.0]
        at jline.console.ConsoleReader.readLine(ConsoleReader.java:2162)[26:jline:2.11.0]
        at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.readAndParseCommand(ConsoleImpl.java:280)[37:org.apache.karaf.shell.console:3.0.1]
        at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:207)[37:org.apache.karaf.shell.console:3.0.1]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_102]
        at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.doRun(ConsoleFactoryService.java:126)[37:org.apache.karaf.shell.console:3.0.1]
        at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3$1.run(ConsoleFactoryService.java:117)
        at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_102]
        at org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:47)[38:org.apache.karaf.jaas.modules:3.0.1]
        at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.run(ConsoleFactoryService.java:115)[37:org.apache.karaf.shell.console:3.0.1]
2017-09-27 15:41:18,970 | ERROR | Local user karaf | ShellUtil                        | 37 - org.apache.karaf.shell.console - 3.0.1 | Exception caught while executing command
java.lang.NullPointerException
        at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:61)
        at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)[37:org.apache.karaf.shell.console:3.0.1]
        at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[37:org.apache.karaf.shell.console:3.0.1]
        at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[37:org.apache.karaf.shell.console:3.0.1]
        at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[37:org.apache.karaf.shell.console:3.0.1]
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[37:org.apache.karaf.shell.console:3.0.1]
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[37:org.apache.karaf.shell.console:3.0.1]
        at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
        at org.apache.karaf.shell.console.impl.jline.ConsoleImpl$DelegateSession.execute(ConsoleImpl.java:521)
        at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:212)
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_102]
        at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.doRun(ConsoleFactoryService.java:126)[37:org.apache.karaf.shell.console:3.0.1]
        at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3$1.run(ConsoleFactoryService.java:117)
        at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_102]
        at org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:47)[38:org.apache.karaf.jaas.modules:3.0.1]
        at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.run(ConsoleFactoryService.java:115)[37:org.apache.karaf.shell.console:3.0.1]
----------------------
Reply | Threaded
Open this post in threaded view
|

RE: karaf 3.0.1 just prints NullPointerException trying to append a property

KARR, DAVID
In reply to this post by jbonofre
> -----Original Message-----
> From: Jean-Baptiste Onofré [mailto:[hidden email]]
> Sent: Wednesday, September 27, 2017 11:42 PM
> To: [hidden email]
> Subject: Re: karaf 3.0.1 just prints NullPointerException trying to
> append a property
>
> Karaf 3.x works with Java8. Even Karaf 2.4.x also works with Java8.
> However, we fixed issues with Java8 starting from Karaf 3.0.4.
>
> I just tested 3.0.7 on Java8 without problem.

Ok, well, I just tried making karaf use 1.7.0_131, and the problem no longer occurs.  I guess I'm going to move forward with that.

> Regards
> JB
>
> On 09/28/2017 08:37 AM, Achim Nierbeck wrote:
> > Hi,
> >
> > afair 3.0.x was never "designed" to work with Java8.
> > The reason might have been the ASM stuff, so I wouldn't rely on that.
> >
> > If you want to use Karaf 3.0.x you'll need to stick to Java 7 I fear.
> >
> > regards, Achim
> >
> >
> > 2017-09-28 7:22 GMT+02:00 Jean-Baptiste Onofré <[hidden email]
> > <mailto:[hidden email]>>:
> >
> >     Hi David,
> >
> >     Something is wrong on 3.0.1 (at least with Java 8): all commands
> throw a
> >     NullPointerException (even a simple bundle:list).
> >
> >     After a quick look, it seems to be related to blueprint and aries
> proxy (and
> >     asm).
> >
> >     I'm checking and I will fix that.
> >
> >     Regards
> >     JB
> >
> >
> >     On 09/28/2017 12:45 AM, KARR, DAVID wrote:
> >
> >         I'm unfortunately forced to use Karaf 3.0.1 for some
> maintenance changes
> >         I need to make, and I don't even regularly use karaf.
> >
> >         The setup process requires entering some commands into karaf
> after it
> >         starts up.  First there's a call to "config:property-append"
> with
> >         certain parameters.  When I do this, or even just
> >         "config:property-append --help", it just says "Error executing
> command:
> >         java.lang.NullPointerException", with no other information.
> >
> >         What might be wrong here, and what can I do to get more
> information?
> >
> >         Assuming I get this working, is it practical to pipe a set of
> commands
> >         into karaf, so it will enter them after it presents the
> command prompt?
> >
> >
> >     --
> >     Jean-Baptiste Onofré
> >     [hidden email] <mailto:[hidden email]>
> >     https://urldefense.proofpoint.com/v2/url?u=http-
> 3A__blog.nanthrax.net&d=DwIDaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=OsTemSXEn-
> xy2uk0vYF_EA&m=ieXUMpCKPGqdTfC74NxVMiUDjH9jViR7qlfHbpHE6ho&s=ZPDfCesGP6N
> emwU9Cfa65tyki0-793TbpiJBChW7U1I&e=
> >     Talend -
> > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.talend.com&d=D
> > wIDaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=ieXUMpCKPGqd
> > TfC74NxVMiUDjH9jViR7qlfHbpHE6ho&s=u4d95VbGZN8EtDp7zKNBs-4Sl-kZSNb8zdCb
> > nTM7i1I&e=
> >
> >
> >
> >
> > --
> >
> > Apache Member
> > Apache Karaf
> > <https://urldefense.proofpoint.com/v2/url?u=http-3A__karaf.apache.org_
> > &d=DwIDaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=ieXUMpCK
> > PGqdTfC74NxVMiUDjH9jViR7qlfHbpHE6ho&s=_sxjMqQX23TPC66IvJIRdcVDr-qShQzh
> > -LVXKELe1-w&e= > Committer & PMC OPS4J Pax Web
> > <https://urldefense.proofpoint.com/v2/url?u=http-3A__wiki.ops4j.org_di
> > splay_paxweb_Pax-2BWeb_&d=DwIDaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=OsTemSXEn-
> > xy2uk0vYF_EA&m=ieXUMpCKPGqdTfC74NxVMiUDjH9jViR7qlfHbpHE6ho&s=vnWVVqyS9
> > IILoEJlkpmqDOtgjwgB_h1Bi8iWWZitiGY&e= > Committer & Project Lead blog
> > <https://urldefense.proofpoint.com/v2/url?u=http-3A__notizblog.nierbec
> > k.de_&d=DwIDaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=ieX
> > UMpCKPGqdTfC74NxVMiUDjH9jViR7qlfHbpHE6ho&s=-LJoQVoz-mB8Sdcw4KM-9IL3Nl0
> > GXywagNK3733Z7ow&e= > Co-Author of Apache Karaf Cookbook
> > <https://urldefense.proofpoint.com/v2/url?u=http-3A__bit.ly_1ps9rkS&d=
> > DwIDaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=ieXUMpCKPGq
> > dTfC74NxVMiUDjH9jViR7qlfHbpHE6ho&s=BqTDlbhLQvFhq0xwyLHSM1fjio5niwfU0yc
> > -nhIX7xc&e= >
> >
> > Software Architect / Project Manager / Scrum Master
> >
>
> --
> Jean-Baptiste Onofré
> [hidden email]
> https://urldefense.proofpoint.com/v2/url?u=http-
> 3A__blog.nanthrax.net&d=DwIDaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=OsTemSXEn-
> xy2uk0vYF_EA&m=ieXUMpCKPGqdTfC74NxVMiUDjH9jViR7qlfHbpHE6ho&s=ZPDfCesGP6N
> emwU9Cfa65tyki0-793TbpiJBChW7U1I&e=
> Talend - https://urldefense.proofpoint.com/v2/url?u=http-
> 3A__www.talend.com&d=DwIDaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=OsTemSXEn-
> xy2uk0vYF_EA&m=ieXUMpCKPGqdTfC74NxVMiUDjH9jViR7qlfHbpHE6ho&s=u4d95VbGZN8
> EtDp7zKNBs-4Sl-kZSNb8zdCbnTM7i1I&e=