[
https://issues.apache.org/jira/browse/KARAF-7102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul Spencer updated KARAF-7102:
--------------------------------
Description:
Starting with a virgin Karaf 4.2.11 installation, I added my own repository and
I attempted to remove the default remote repositories.
Removing the repository id central fails with a NPE. Why?
Per [link
Freeman|http://karaf.922171.n3.nabble.com/Karaf-4-2-11-maven-repository-remove-id-central-fails-with-NPE-Why-tp4059832p4059834.html]:
{quote}This is caused by that you don't have ~/.m2/settings.xml, so
mavenSettings is null. We need to add a NPE guard here.
{quote}
karaf@root()> maven:repository-add -id myrepo
[http://myrepo.example.com|http://myrepo.example.com/]
karaf@root()> maven:repository-remove -id central
Are you sure to remove repository with ID "central" for URL
[https://repo1.maven.org/maven2/]? (y/N) y
null
karaf@root()>
>From karaf.log
14:16:28.422 WARN [pipe-maven:repository-remove -id central] The Parser of
class
org.apache.karaf.shell.impl.console.ConsoleSessionImpl$$Lambda$411/734988569
does not support the CompletingParsedLine interface. Completion with escaped or
quoted words won't work correctly.
14:16:30.081 ERROR [pipe-maven:repository-remove -id central] null
java.lang.NullPointerException: null
at
org.apache.karaf.maven.command.RepositoryRemoveCommand.edit(RepositoryRemoveCommand.java:73)
~[!/:?]
at
org.apache.karaf.maven.command.RepositoryEditCommandSupport.doAction(RepositoryEditCommandSupport.java:65)
~[!/:?]
at
org.apache.karaf.maven.command.MavenConfigurationSupport.execute(MavenConfigurationSupport.java:161)
[!/:?]
at
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
[!/:4.2.11]
at
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
[!/:4.2.11]
at
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
[!/:4.2.11]
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
[!/:4.2.11]
at
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
[!/:4.2.11]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415)
[!/:4.2.11]
at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) [!/:4.2.11]
at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) [!/:4.2.11]
at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) [!/:4.2.11]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[?:1.8.0_282]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[?:1.8.0_282]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[?:1.8.0_282]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
Paul Spencer
was:
{{Starting with a virgin Karaf 4.2.11 installation, I added my own repository
and I attempted to remove the default remote repositories. }}
{{Removing the repository id central fails with a NPE. Why? }}
Per [link
Freeman|http://karaf.922171.n3.nabble.com/Karaf-4-2-11-maven-repository-remove-id-central-fails-with-NPE-Why-tp4059832p4059834.html]:
{quote}This is caused by that you don't have ~/.m2/settings.xml, so
mavenSettings is null. We need to add a NPE guard here.{quote}
{{karaf@root()> maven:repository-add -id myrepo
[http://myrepo.example.com|http://myrepo.example.com/]}}
{{karaf@root()> maven:repository-remove -id central }}
{{Are you sure to remove repository with ID "central" for URL
[https://repo1.maven.org/maven2/]? (y/N) y }}
{{null }}
{{karaf@root()> }}
{{*** }}
{{* From karaf.log }}
{{*** }}
{{14:16:28.422 WARN [pipe-maven:repository-remove -id central] The Parser of
class
org.apache.karaf.shell.impl.console.ConsoleSessionImpl$$Lambda$411/734988569
does not support the CompletingParsedLine interface. Completion with escaped or
quoted words won't work correctly. }}
{{14:16:30.081 ERROR [pipe-maven:repository-remove -id central] null }}
{{java.lang.NullPointerException: null }}
{{ at
org.apache.karaf.maven.command.RepositoryRemoveCommand.edit(RepositoryRemoveCommand.java:73)
~[!/:?] }}
{{ at
org.apache.karaf.maven.command.RepositoryEditCommandSupport.doAction(RepositoryEditCommandSupport.java:65)
~[!/:?] }}
{{ at
org.apache.karaf.maven.command.MavenConfigurationSupport.execute(MavenConfigurationSupport.java:161)
[!/:?] }}
{{ at
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
[!/:4.2.11] }}
{{ at
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
[!/:4.2.11] }}
{{ at
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
[!/:4.2.11] }}
{{ at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
[!/:4.2.11] }}
{{ at
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
[!/:4.2.11] }}
{{ at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415)
[!/:4.2.11] }}
{{ at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416)
[!/:4.2.11] }}
{{ at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) [!/:4.2.11]
}}
{{ at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) [!/:4.2.11]
}}
{{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[?:1.8.0_282] }}
{{ at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[?:1.8.0_282] }}
{{ at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[?:1.8.0_282] }}
{{ at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282] }}
{{Paul Spencer}}
> maven:repository-remove fails with NPE if ~/.m2/settings does not exist
> -----------------------------------------------------------------------
>
> Key: KARAF-7102
> URL: https://issues.apache.org/jira/browse/KARAF-7102
> Project: Karaf
> Issue Type: Bug
> Components: karaf
> Affects Versions: 4.2.11
> Environment: {{Karaf 4.2.11 }}
> {{Java 1.8.0_282 }}
> {{OS Redhat 8.2 }}
> Reporter: Paul Spencer
> Priority: Minor
>
> Starting with a virgin Karaf 4.2.11 installation, I added my own repository
> and I attempted to remove the default remote repositories.
> Removing the repository id central fails with a NPE. Why?
> Per [link
> Freeman|http://karaf.922171.n3.nabble.com/Karaf-4-2-11-maven-repository-remove-id-central-fails-with-NPE-Why-tp4059832p4059834.html]:
> {quote}This is caused by that you don't have ~/.m2/settings.xml, so
> mavenSettings is null. We need to add a NPE guard here.
> {quote}
> karaf@root()> maven:repository-add -id myrepo
> [http://myrepo.example.com|http://myrepo.example.com/]
> karaf@root()> maven:repository-remove -id central
> Are you sure to remove repository with ID "central" for URL
> [https://repo1.maven.org/maven2/]? (y/N) y
> null
> karaf@root()>
> From karaf.log
> 14:16:28.422 WARN [pipe-maven:repository-remove -id central] The Parser of
> class
> org.apache.karaf.shell.impl.console.ConsoleSessionImpl$$Lambda$411/734988569
> does not support the CompletingParsedLine interface. Completion with escaped
> or quoted words won't work correctly.
> 14:16:30.081 ERROR [pipe-maven:repository-remove -id central] null
> java.lang.NullPointerException: null
> at
> org.apache.karaf.maven.command.RepositoryRemoveCommand.edit(RepositoryRemoveCommand.java:73)
> ~[!/:?]
> at
> org.apache.karaf.maven.command.RepositoryEditCommandSupport.doAction(RepositoryEditCommandSupport.java:65)
> ~[!/:?]
> at
> org.apache.karaf.maven.command.MavenConfigurationSupport.execute(MavenConfigurationSupport.java:161)
> [!/:?]
> at
> org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
> [!/:4.2.11]
> at
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
> [!/:4.2.11]
> at
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
> [!/:4.2.11]
> at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
> [!/:4.2.11]
> at
> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
> [!/:4.2.11]
> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415)
> [!/:4.2.11]
> at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416)
> [!/:4.2.11]
> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) [!/:4.2.11]
> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) [!/:4.2.11]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> [?:1.8.0_282]
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> [?:1.8.0_282]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> [?:1.8.0_282]
> at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
> Paul Spencer
--
This message was sent by Atlassian Jira
(v8.3.4#803005)