You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (JIRA)" <ji...@apache.org> on 2008/05/07 14:42:55 UTC

[jira] Created: (SLING-431) Unexplained NPE in AbstractSlingRepository.pingAndCheck

Unexplained NPE in AbstractSlingRepository.pingAndCheck
-------------------------------------------------------

                 Key: SLING-431
                 URL: https://issues.apache.org/jira/browse/SLING-431
             Project: Sling
          Issue Type: Bug
            Reporter: Bertrand Delacretaz
            Priority: Minor


I've found this trace in the log of my custom launchpad-based Sling webapp:

Exception in thread "Repository Pinger" java.lang.NullPointerException
        at org.apache.sling.jcr.base.AbstractSlingRepository.pingAndCheck(AbstractSlingRepository.java:481)
        at org.apache.sling.jcr.base.AbstractSlingRepository.run(AbstractSlingRepository.java:898)
        at java.lang.Thread.run(Thread.java:613)

This happened at startup, but only once with many successful startups with the same code and configuration.

The corresponding code line is the log.log call in 

            } catch(RepositoryException re) {
                log.log(LogService.LOG_INFO, "pingAndCheck; loginAdministrative failed", re);
            }

So the only explanation is that log is null, which is "impossible" looking at the source code: the thread that calls pingAndCheck is created in activate(), which must be called by the OSGi framework after initializing the log member variable:

     /** @scr.reference bind="bindLog" unbind="unbindLog" */
    private LogService log;

There is something weird about the log class, in the error log:

07.05.2008 13:20:39.574 *ERROR* [SCR Component Actor] org.apache.sling.jcr.jackrabbit.client [org.apache.sling.jcr.jackrabbit.client.SlingClientRepository] Cannot load class used as parameter org.osgi.service.log.Lo
gService (java.lang.ClassNotFoundException: org.osgi.service.log.LogService) java.lang.ClassNotFoundException: org.osgi.service.log.LogService
        at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1504)

That happens before the above NPE.

I won't investigate further for now, but this looks like a weird timing-related bug.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-431) Unexplained NPE in AbstractSlingRepository.pingAndCheck

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594904#action_12594904 ] 

Carsten Ziegeler commented on SLING-431:
----------------------------------------

I experienced the same strange log entry about the ClassNotFoundException. The reason was that my repository client bundle did not have an import for org.osgi.service.log. This *should* be generated by the maven plugin, but for some strange reasons it did not. Even more strange: the app did run without any problems.
So have a look if this import is in the client bundle; if not it should be added.

> Unexplained NPE in AbstractSlingRepository.pingAndCheck
> -------------------------------------------------------
>
>                 Key: SLING-431
>                 URL: https://issues.apache.org/jira/browse/SLING-431
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Bertrand Delacretaz
>            Priority: Minor
>
> I've found this trace in the log of my custom launchpad-based Sling webapp:
> Exception in thread "Repository Pinger" java.lang.NullPointerException
>         at org.apache.sling.jcr.base.AbstractSlingRepository.pingAndCheck(AbstractSlingRepository.java:481)
>         at org.apache.sling.jcr.base.AbstractSlingRepository.run(AbstractSlingRepository.java:898)
>         at java.lang.Thread.run(Thread.java:613)
> This happened at startup, but only once with many successful startups with the same code and configuration.
> The corresponding code line is the log.log call in 
>             } catch(RepositoryException re) {
>                 log.log(LogService.LOG_INFO, "pingAndCheck; loginAdministrative failed", re);
>             }
> So the only explanation is that log is null, which is "impossible" looking at the source code: the thread that calls pingAndCheck is created in activate(), which must be called by the OSGi framework after initializing the log member variable:
>      /** @scr.reference bind="bindLog" unbind="unbindLog" */
>     private LogService log;
> There is something weird about the log class, in the error log:
> 07.05.2008 13:20:39.574 *ERROR* [SCR Component Actor] org.apache.sling.jcr.jackrabbit.client [org.apache.sling.jcr.jackrabbit.client.SlingClientRepository] Cannot load class used as parameter org.osgi.service.log.Lo
> gService (java.lang.ClassNotFoundException: org.osgi.service.log.LogService) java.lang.ClassNotFoundException: org.osgi.service.log.LogService
>         at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1504)
> That happens before the above NPE.
> I won't investigate further for now, but this looks like a weird timing-related bug.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Resolved: (SLING-431) Unexplained NPE in AbstractSlingRepository.pingAndCheck

Posted by Carsten Ziegeler <cz...@apache.org>.
Felix Meschberger wrote:
> Hi,
> 
> Am Mittwoch, den 07.05.2008, 06:46 -0700 schrieb Bertrand Delacretaz
> (JIRA):
>> Thanks for the pointer, I have added the org.osgi.service.log Import-Package to the jcr.jackrabbit.client bundle and that got rid of the ClassNotFoundException.
> 
> Could this be something we should talk to Peter Kriens and Stuart
> about ?
> 
Hmm, yes, it seems that bnd is not detecting the used class and 
therefore is not creating an import statement. This seems to be the case 
if a service inherits from a class from another bundle.

I'll try to make a simple test case and then write to the felix list.

Carsten

> Regards
> Felix



-- 
Carsten Ziegeler
cziegeler@apache.org

Re: [jira] Resolved: (SLING-431) Unexplained NPE in AbstractSlingRepository.pingAndCheck

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Am Mittwoch, den 07.05.2008, 06:46 -0700 schrieb Bertrand Delacretaz
(JIRA):
> Thanks for the pointer, I have added the org.osgi.service.log Import-Package to the jcr.jackrabbit.client bundle and that got rid of the ClassNotFoundException.

Could this be something we should talk to Peter Kriens and Stuart
about ?

Regards
Felix

> 
> Closing this as "cannot reproduce" for now, I'll reopen it if I see the problem again.
> 
> > Unexplained NPE in AbstractSlingRepository.pingAndCheck
> > -------------------------------------------------------
> >
> >                 Key: SLING-431
> >                 URL: https://issues.apache.org/jira/browse/SLING-431
> >             Project: Sling
> >          Issue Type: Bug
> >            Reporter: Bertrand Delacretaz
> >            Priority: Minor
> >
> > I've found this trace in the log of my custom launchpad-based Sling webapp:
> > Exception in thread "Repository Pinger" java.lang.NullPointerException
> >         at org.apache.sling.jcr.base.AbstractSlingRepository.pingAndCheck(AbstractSlingRepository.java:481)
> >         at org.apache.sling.jcr.base.AbstractSlingRepository.run(AbstractSlingRepository.java:898)
> >         at java.lang.Thread.run(Thread.java:613)
> > This happened at startup, but only once with many successful startups with the same code and configuration.
> > The corresponding code line is the log.log call in 
> >             } catch(RepositoryException re) {
> >                 log.log(LogService.LOG_INFO, "pingAndCheck; loginAdministrative failed", re);
> >             }
> > So the only explanation is that log is null, which is "impossible" looking at the source code: the thread that calls pingAndCheck is created in activate(), which must be called by the OSGi framework after initializing the log member variable:
> >      /** @scr.reference bind="bindLog" unbind="unbindLog" */
> >     private LogService log;
> > There is something weird about the log class, in the error log:
> > 07.05.2008 13:20:39.574 *ERROR* [SCR Component Actor] org.apache.sling.jcr.jackrabbit.client [org.apache.sling.jcr.jackrabbit.client.SlingClientRepository] Cannot load class used as parameter org.osgi.service.log.Lo
> > gService (java.lang.ClassNotFoundException: org.osgi.service.log.LogService) java.lang.ClassNotFoundException: org.osgi.service.log.LogService
> >         at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1504)
> > That happens before the above NPE.
> > I won't investigate further for now, but this looks like a weird timing-related bug.
> 


[jira] Resolved: (SLING-431) Unexplained NPE in AbstractSlingRepository.pingAndCheck

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-431?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bertrand Delacretaz resolved SLING-431.
---------------------------------------

    Resolution: Cannot Reproduce

Thanks for the pointer, I have added the org.osgi.service.log Import-Package to the jcr.jackrabbit.client bundle and that got rid of the ClassNotFoundException.

Closing this as "cannot reproduce" for now, I'll reopen it if I see the problem again.

> Unexplained NPE in AbstractSlingRepository.pingAndCheck
> -------------------------------------------------------
>
>                 Key: SLING-431
>                 URL: https://issues.apache.org/jira/browse/SLING-431
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Bertrand Delacretaz
>            Priority: Minor
>
> I've found this trace in the log of my custom launchpad-based Sling webapp:
> Exception in thread "Repository Pinger" java.lang.NullPointerException
>         at org.apache.sling.jcr.base.AbstractSlingRepository.pingAndCheck(AbstractSlingRepository.java:481)
>         at org.apache.sling.jcr.base.AbstractSlingRepository.run(AbstractSlingRepository.java:898)
>         at java.lang.Thread.run(Thread.java:613)
> This happened at startup, but only once with many successful startups with the same code and configuration.
> The corresponding code line is the log.log call in 
>             } catch(RepositoryException re) {
>                 log.log(LogService.LOG_INFO, "pingAndCheck; loginAdministrative failed", re);
>             }
> So the only explanation is that log is null, which is "impossible" looking at the source code: the thread that calls pingAndCheck is created in activate(), which must be called by the OSGi framework after initializing the log member variable:
>      /** @scr.reference bind="bindLog" unbind="unbindLog" */
>     private LogService log;
> There is something weird about the log class, in the error log:
> 07.05.2008 13:20:39.574 *ERROR* [SCR Component Actor] org.apache.sling.jcr.jackrabbit.client [org.apache.sling.jcr.jackrabbit.client.SlingClientRepository] Cannot load class used as parameter org.osgi.service.log.Lo
> gService (java.lang.ClassNotFoundException: org.osgi.service.log.LogService) java.lang.ClassNotFoundException: org.osgi.service.log.LogService
>         at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1504)
> That happens before the above NPE.
> I won't investigate further for now, but this looks like a weird timing-related bug.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-431) Unexplained NPE in AbstractSlingRepository.pingAndCheck

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594895#action_12594895 ] 

Bertrand Delacretaz commented on SLING-431:
-------------------------------------------

Note that things worked fine after stopping and restarting the repository client bundle.

> Unexplained NPE in AbstractSlingRepository.pingAndCheck
> -------------------------------------------------------
>
>                 Key: SLING-431
>                 URL: https://issues.apache.org/jira/browse/SLING-431
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Bertrand Delacretaz
>            Priority: Minor
>
> I've found this trace in the log of my custom launchpad-based Sling webapp:
> Exception in thread "Repository Pinger" java.lang.NullPointerException
>         at org.apache.sling.jcr.base.AbstractSlingRepository.pingAndCheck(AbstractSlingRepository.java:481)
>         at org.apache.sling.jcr.base.AbstractSlingRepository.run(AbstractSlingRepository.java:898)
>         at java.lang.Thread.run(Thread.java:613)
> This happened at startup, but only once with many successful startups with the same code and configuration.
> The corresponding code line is the log.log call in 
>             } catch(RepositoryException re) {
>                 log.log(LogService.LOG_INFO, "pingAndCheck; loginAdministrative failed", re);
>             }
> So the only explanation is that log is null, which is "impossible" looking at the source code: the thread that calls pingAndCheck is created in activate(), which must be called by the OSGi framework after initializing the log member variable:
>      /** @scr.reference bind="bindLog" unbind="unbindLog" */
>     private LogService log;
> There is something weird about the log class, in the error log:
> 07.05.2008 13:20:39.574 *ERROR* [SCR Component Actor] org.apache.sling.jcr.jackrabbit.client [org.apache.sling.jcr.jackrabbit.client.SlingClientRepository] Cannot load class used as parameter org.osgi.service.log.Lo
> gService (java.lang.ClassNotFoundException: org.osgi.service.log.LogService) java.lang.ClassNotFoundException: org.osgi.service.log.LogService
>         at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1504)
> That happens before the above NPE.
> I won't investigate further for now, but this looks like a weird timing-related bug.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.