[jira] [Assigned] (FELIX-6088) NPE in LoggerImpl when formatted logger called with null or empty arguments

2019-05-10 Thread JIRA


 [ 
https://issues.apache.org/jira/browse/FELIX-6088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Raymond Augé reassigned FELIX-6088:
---

Assignee: Raymond Augé

> NPE in LoggerImpl when formatted logger called with null or empty arguments 
> 
>
> Key: FELIX-6088
> URL: https://issues.apache.org/jira/browse/FELIX-6088
> Project: Felix
>  Issue Type: Bug
>  Components: Log Service
>Affects Versions: log-1.2.0
>Reporter: Jan Hendriks
>Assignee: Raymond Augé
>Priority: Major
>  Labels: NPE, logger, logging
>
> When calling the "formatter" logger with null or empty arguments like the 
> following sample code (using bnd launchpad):
> {code:java}
> import org.junit.Test;
> import org.osgi.service.log.Logger;
> import org.osgi.service.log.LoggerFactory;
> import aQute.launchpad.Launchpad;
> import aQute.launchpad.LaunchpadBuilder;
> public class FelixLoggerTest {
> @Test
> public void letApacheFelixLogThrowNPE() throws Exception {
> try (final Launchpad launchpad = new 
> LaunchpadBuilder().runfw("org.apache.felix.framework").bundles("org.apache.felix.log;version='[1.2.0,1.2.1)'").create())
>  {
> LoggerFactory osgiLoggerFactory = 
> launchpad.getService(LoggerFactory.class).get();
> Logger osgiLogger = 
> osgiLoggerFactory.getLogger(getClass().getName());
> osgiLogger.info("Test formatted logging...", new Object[0]); // 
> throws NPE
> osgiLogger.debug("Test formatted logging...", null); // throws NPE
> }
> }
> }
> {code}
> following NPE is thrown:
> {noformat}
> java.lang.NullPointerException
> at org.apache.felix.log.LoggerImpl.format(LoggerImpl.java:335)
> at org.apache.felix.log.LoggerImpl.info(LoggerImpl.java:164)
> at 
> com.[REDACTED].run.FelixLoggerTest.letApacheFelixLogThrowNPE(FelixLoggerTest.java:21)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> at 
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
> at 
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
> at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
> at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
> at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
> at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


Felix Log Bug

2019-05-10 Thread Amit
Hi,

Recently I have encountered NPE several times in the LoggerImpl class. Felix 
Jetty HTTP Bundle can therefore not be started since the NPE in LoggerImpl 
occurs during its activation. The problem has already been reported in 
https://issues.apache.org/jira/browse/FELIX-6088. Could anyone kindly have a 
look if we could use the fix mentioned in the bug?

Thanks in advance.

Best Regards,

Amit Kumar Mondal
Phone: +49 160 9100 3436  Email: a...@amitinside.com
Skype: arsenalnerk   GitHub: amitjoy
Blog: blog.amitinside.com

[jira] [Commented] (FELIX-6088) NPE in LoggerImpl when formatted logger called with null or empty arguments

2019-05-10 Thread Karl Pauls (JIRA)


[ 
https://issues.apache.org/jira/browse/FELIX-6088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16837264#comment-16837264
 ] 

Karl Pauls commented on FELIX-6088:
---

[~rotty3000], is this something you could look into?

> NPE in LoggerImpl when formatted logger called with null or empty arguments 
> 
>
> Key: FELIX-6088
> URL: https://issues.apache.org/jira/browse/FELIX-6088
> Project: Felix
>  Issue Type: Bug
>  Components: Log Service
>Affects Versions: log-1.2.0
>Reporter: Jan Hendriks
>Priority: Major
>  Labels: NPE, logger, logging
>
> When calling the "formatter" logger with null or empty arguments like the 
> following sample code (using bnd launchpad):
> {code:java}
> import org.junit.Test;
> import org.osgi.service.log.Logger;
> import org.osgi.service.log.LoggerFactory;
> import aQute.launchpad.Launchpad;
> import aQute.launchpad.LaunchpadBuilder;
> public class FelixLoggerTest {
> @Test
> public void letApacheFelixLogThrowNPE() throws Exception {
> try (final Launchpad launchpad = new 
> LaunchpadBuilder().runfw("org.apache.felix.framework").bundles("org.apache.felix.log;version='[1.2.0,1.2.1)'").create())
>  {
> LoggerFactory osgiLoggerFactory = 
> launchpad.getService(LoggerFactory.class).get();
> Logger osgiLogger = 
> osgiLoggerFactory.getLogger(getClass().getName());
> osgiLogger.info("Test formatted logging...", new Object[0]); // 
> throws NPE
> osgiLogger.debug("Test formatted logging...", null); // throws NPE
> }
> }
> }
> {code}
> following NPE is thrown:
> {noformat}
> java.lang.NullPointerException
> at org.apache.felix.log.LoggerImpl.format(LoggerImpl.java:335)
> at org.apache.felix.log.LoggerImpl.info(LoggerImpl.java:164)
> at 
> com.[REDACTED].run.FelixLoggerTest.letApacheFelixLogThrowNPE(FelixLoggerTest.java:21)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> at 
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
> at 
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
> at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
> at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
> at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
> at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FELIX-6117) generalchecks - json does not show tags

2019-05-10 Thread Stefan Bischof (JIRA)


[ 
https://issues.apache.org/jira/browse/FELIX-6117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16837249#comment-16837249
 ] 

Stefan Bischof commented on FELIX-6117:
---

The Result of Gogo SCR:info
{code:java}
Component Description: org.apache.felix.hc.generalchecks.DiskSpaceCheck
===
Class: org.apache.felix.hc.generalchecks.DiskSpaceCheck
Bundle:    26 (org.apache.felix.healthcheck.generalchecks:2.0.0)
Enabled:   true
Immediate: false
Services:  [org.apache.felix.hc.api.HealthCheck]
Scope: singleton
Config PID(s): [org.apache.felix.hc.generalchecks.DiskSpaceCheck], Policy: 
require
Base Props:    (5 entries)
  diskPaths = [.]
  diskUsedThresholdCritical = 97
  diskUsedThresholdWarn = 90
  hc.name = Disk Space
  webconsole.configurationFactory.nameHint = {hc.name}: {diskPaths} 
used>{diskUsedThresholdWarn}% -> WARN  used>{diskUsedThresholdCritical}% -> 
CRITICAL

Component Configuration Id: 11
--
State:    SATISFIED
Service:  43 [org.apache.felix.hc.api.HealthCheck]
Config Props: (11 entries)
  component.id = 11
  component.name = org.apache.felix.hc.generalchecks.DiskSpaceCheck
  diskPaths = [.]
  diskUsedThresholdCritical = 10
  diskUsedThresholdWarn = 15
  hc.name = myTest222
  hc.tags = [system, system_memory, dings]
  service.factoryPid = org.apache.felix.hc.generalchecks.DiskSpaceCheck
  service.pid = org.apache.felix.hc.generalchecks.DiskSpaceCheck~test2
  webconsole.configurationFactory.nameHint = {hc.name}: {diskPaths} 
used>{diskUsedThresholdWarn}% -> WARN  used>{diskUsedThresholdCritical}% -> 
CRITICAL
References:   (total 0)

{code}
{code:java}
I think the configuration works correct!  

hc.tags = [system, system_memory, dings]{code}

did you tryed to request the json?

[http://localhost:8080/system/health/*.json]

 

> generalchecks - json does not show tags
> ---
>
> Key: FELIX-6117
> URL: https://issues.apache.org/jira/browse/FELIX-6117
> Project: Felix
>  Issue Type: Bug
>  Components: Health Checks
>Affects Versions: healthcheck.core 2.0.0, healthcheck.generalchecks 2.0.0
>Reporter: Stefan Bischof
>Assignee: Georg Henzler
>Priority: Minor
> Attachments: tags-in-html-rendering.png
>
>
> Hi,
>  
> i configured a generalchecks.DiskSpaceCheck with tags
> {code:java}
> //config
> org.apache.felix.hc.generalchecks.DiskSpaceCheck~test2:
>    hc.name: myTest222
>    hc.tags: [system,system_memory,dings]
>    diskPaths: [.]
>    diskUsedThresholdWarn: 15
>    diskUsedThresholdCritical: 10
> {code}
> filtering by these tags works ans shows the corrent results.
> http://localhost:8080/system/health/*.json
> [http://localhost:8080/system/health/system.json]
>  
> but ins the result json the  attribute "tags" isn't set properly.
> {code:java}
> {
>   "overallResult": "CRITICAL",
>   "results": [
> {
>   "name": "myTest222",
>   "status": "CRITICAL",
>   "timeInMs": 2,
>   "finishedAt": "2019-05-02T15:22:18.646",
>   "tags": [],
>   "messages": [
> {
>   "status": "CRITICAL",
>   "message": "Disk Usage /home/name/dev/git/fooo/health/.: 11.3% of 
> 166.2GB used / 147.5GB free"
> }
>   ]
> }
>   ]
> }
> {code}
> With my own implementations of healthcheck this works.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FELIX-6106) Regression after a change in maven-bundle-plugin:4.2.0 related to non-existing files

2019-05-10 Thread Stefan Seifert (JIRA)


[ 
https://issues.apache.org/jira/browse/FELIX-6106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16836986#comment-16836986
 ] 

Stefan Seifert commented on FELIX-6106:
---

in felix osgi bundles are usually versioned using an even/odd version number 
scheme for the third digit.
but there is no real need to do it for maven plugins, though - although it's 
often done as a habit anyways.
setting next version to 4.2.1 here.

> Regression after a change in maven-bundle-plugin:4.2.0 related to 
> non-existing files
> 
>
> Key: FELIX-6106
> URL: https://issues.apache.org/jira/browse/FELIX-6106
> Project: Felix
>  Issue Type: Bug
>  Components: Maven Bundle Plugin
>Affects Versions: maven-bundle-plugin-4.2.0
>Reporter: Martin Grigorov
>Assignee: Stefan Seifert
>Priority: Major
> Fix For: maven-bundle-plugin-4.2.1
>
>
> Commit 
> https://github.com/apache/felix/commit/9487647dc2fa8734a0ab4a113b0b93ec281a2594
>  introduced with FELIX-6074 leads to an error in one of our projects:
> {code}
> INFO] --- maven-bundle-plugin:4.2.0:bundle (default-bundle) @
> wicketstuff-bundle ---
> [ERROR] An internal error occurred
> java.lang.IllegalArgumentException: A Jar can only accept a file or
> directory that exists:
> /home/solomax/work/wicketstuff-core/wicket-bundle-parent/wicket-bundle/target/classes
> at aQute.bnd.osgi.Jar. (Jar.java:124)
> at aQute.bnd.osgi.Jar. (Jar.java:172)
> at org.apache.felix.bundleplugin.BundlePlugin.getOSGiBuilder
> (BundlePlugin.java:603)
> {code}
> The code of the module can be found at 
> https://github.com/wicketstuff/core/tree/master/wicket-bundle-parent/wicket-bundle.
>  It is mostly Maven code (pom.xml and assembly.xml) that generates an OSGi 
> compatible bundle.
> After upgrading to maven-bundle-plugin:4.2.0 it started failing with the 
> above error.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)