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 2012/10/30 16:10:11 UTC

[jira] [Created] (SLING-2640) NPE in JcrResourceProviderFactory due to "impossible" null Repository reference

Bertrand Delacretaz created SLING-2640:
------------------------------------------

             Summary: NPE in JcrResourceProviderFactory due to "impossible" null Repository reference
                 Key: SLING-2640
                 URL: https://issues.apache.org/jira/browse/SLING-2640
             Project: Sling
          Issue Type: Bug
          Components: JCR
    Affects Versions: JCR Resource 2.1.0
            Reporter: Bertrand Delacretaz


After heavy SCR-related activity, I get an NPE at JcrResourceProviderFactory.java:136, which is 

session = repository.loginAdministrative(workspace);

and repository is null, which in theory cannot happen as that's an @Reference.

This looks similar to FELIX-3317, but reporting here as it affects Sling and is reproducible as follows:

1. Start the sling launchpad/builder

2. Install my test bundle from https://github.com/bdelacretaz/bundle-start-stop-test, which semi-randomly stops and restarts bundles to trigger SCR activity

3. When the test bundle says "Waiting up to 10000 msec to start next cycle" in the log, request / and check the logs for the NPE. Maybe set a breakpoint on that log message to better control the sequence

In my case I get the NPE after 3-4 cycles of the test stopping/restarting bundles.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SLING-2640) NPE in JcrResourceProviderFactory due to "impossible" null Repository reference

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

Felix Meschberger updated SLING-2640:
-------------------------------------

    Attachment: org.apache.felix.scr-1.6.1-R1404065.jar

As I said elsewhere, the NPE per-se is not a problem. The problem is that this seems to be an old (deactivated) instance of the JcrResourceProviderFactory instance still being used. And we must see why this is still being used.

But right, this might well be related to FELIX-3317 (and related issues). So you might want to re-run the test with the attached top-of-trunk internal release 1.6.1-R1404065 of the Felix SCR bundle.
                
> NPE in JcrResourceProviderFactory due to "impossible" null Repository reference
> -------------------------------------------------------------------------------
>
>                 Key: SLING-2640
>                 URL: https://issues.apache.org/jira/browse/SLING-2640
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Resource 2.1.0
>            Reporter: Bertrand Delacretaz
>         Attachments: org.apache.felix.scr-1.6.1-R1404065.jar
>
>
> After heavy SCR-related activity, I get an NPE at JcrResourceProviderFactory.java:136, which is 
> session = repository.loginAdministrative(workspace);
> and repository is null, which in theory cannot happen as that's an @Reference.
> This looks similar to FELIX-3317, but reporting here as it affects Sling and is reproducible as follows:
> 1. Start the sling launchpad/builder
> 2. Install my test bundle from https://github.com/bdelacretaz/bundle-start-stop-test, which semi-randomly stops and restarts bundles to trigger SCR activity
> 3. When the test bundle says "Waiting up to 10000 msec to start next cycle" in the log, request / and check the logs for the NPE. Maybe set a breakpoint on that log message to better control the sequence
> In my case I get the NPE after 3-4 cycles of the test stopping/restarting bundles.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (SLING-2640) NPE in JcrResourceProviderFactory due to "impossible" null Repository reference

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

Bertrand Delacretaz resolved SLING-2640.
----------------------------------------

    Resolution: Fixed

Turns out this was indeed a Sling problem, SCR is not at fault - our ResourceProviderEntry did not correctly unbind services in some cases, and kept using deactivated instances of the JcrResourceProviderFactory.

Fixed in revision 1404209
                
> NPE in JcrResourceProviderFactory due to "impossible" null Repository reference
> -------------------------------------------------------------------------------
>
>                 Key: SLING-2640
>                 URL: https://issues.apache.org/jira/browse/SLING-2640
>             Project: Sling
>          Issue Type: Bug
>          Components: ResourceResolver
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>             Fix For: Resource Resolver 1.0.0
>
>
> After heavy SCR-related activity, I get an NPE at JcrResourceProviderFactory.java:136, which is 
> session = repository.loginAdministrative(workspace);
> and repository is null, which in theory cannot happen as that's an @Reference.
> This looks similar to FELIX-3317, but reporting here as it affects Sling and is reproducible as follows:
> 1. Start the sling launchpad/builder
> 2. Install my test bundle from https://github.com/bdelacretaz/bundle-start-stop-test, which semi-randomly stops and restarts bundles to trigger SCR activity
> 3. When the test bundle says "Waiting up to 10000 msec to start next cycle" in the log, request / and check the logs for the NPE. Maybe set a breakpoint on that log message to better control the sequence
> In my case I get the NPE after 3-4 cycles of the test stopping/restarting bundles.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SLING-2640) NPE in JcrResourceProviderFactory due to "impossible" null Repository reference

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

Bertrand Delacretaz updated SLING-2640:
---------------------------------------

          Component/s:     (was: JCR)
                       ResourceResolver
    Affects Version/s:     (was: JCR Resource 2.1.0)
        Fix Version/s: Resource Resolver 1.0.0
             Assignee: Bertrand Delacretaz
    
> NPE in JcrResourceProviderFactory due to "impossible" null Repository reference
> -------------------------------------------------------------------------------
>
>                 Key: SLING-2640
>                 URL: https://issues.apache.org/jira/browse/SLING-2640
>             Project: Sling
>          Issue Type: Bug
>          Components: ResourceResolver
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>             Fix For: Resource Resolver 1.0.0
>
>         Attachments: org.apache.felix.scr-1.6.1-R1404065.jar
>
>
> After heavy SCR-related activity, I get an NPE at JcrResourceProviderFactory.java:136, which is 
> session = repository.loginAdministrative(workspace);
> and repository is null, which in theory cannot happen as that's an @Reference.
> This looks similar to FELIX-3317, but reporting here as it affects Sling and is reproducible as follows:
> 1. Start the sling launchpad/builder
> 2. Install my test bundle from https://github.com/bdelacretaz/bundle-start-stop-test, which semi-randomly stops and restarts bundles to trigger SCR activity
> 3. When the test bundle says "Waiting up to 10000 msec to start next cycle" in the log, request / and check the logs for the NPE. Maybe set a breakpoint on that log message to better control the sequence
> In my case I get the NPE after 3-4 cycles of the test stopping/restarting bundles.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SLING-2640) NPE in JcrResourceProviderFactory due to "impossible" null Repository reference

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

Bertrand Delacretaz updated SLING-2640:
---------------------------------------

    Attachment:     (was: org.apache.felix.scr-1.6.1-R1404065.jar)
    
> NPE in JcrResourceProviderFactory due to "impossible" null Repository reference
> -------------------------------------------------------------------------------
>
>                 Key: SLING-2640
>                 URL: https://issues.apache.org/jira/browse/SLING-2640
>             Project: Sling
>          Issue Type: Bug
>          Components: ResourceResolver
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>             Fix For: Resource Resolver 1.0.0
>
>
> After heavy SCR-related activity, I get an NPE at JcrResourceProviderFactory.java:136, which is 
> session = repository.loginAdministrative(workspace);
> and repository is null, which in theory cannot happen as that's an @Reference.
> This looks similar to FELIX-3317, but reporting here as it affects Sling and is reproducible as follows:
> 1. Start the sling launchpad/builder
> 2. Install my test bundle from https://github.com/bdelacretaz/bundle-start-stop-test, which semi-randomly stops and restarts bundles to trigger SCR activity
> 3. When the test bundle says "Waiting up to 10000 msec to start next cycle" in the log, request / and check the logs for the NPE. Maybe set a breakpoint on that log message to better control the sequence
> In my case I get the NPE after 3-4 cycles of the test stopping/restarting bundles.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira