You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jacco van Weert (JIRA)" <ji...@apache.org> on 2009/02/18 14:41:01 UTC

[jira] Created: (JCR-1985) NullPointerException GarbageCollector.scan()

NullPointerException GarbageCollector.scan()
--------------------------------------------

                 Key: JCR-1985
                 URL: https://issues.apache.org/jira/browse/JCR-1985
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-core
    Affects Versions: 1.5.2
         Environment: Windows XP
            Reporter: Jacco van Weert
             Fix For: 1.5.3



I am running the garbage collector in a separate thread every 5 minutes.

            GarbageCollector gc = ((SessionImpl)mSession).createDataStoreGarbageCollector();
            gc.scan();
            gc.stopScan();
            int du = gc.deleteUnused();

When using Jackrabbit v1.5.2 I get sometimes a null pointer exception;

java.lang.NullPointerException
        at org.apache.jackrabbit.core.data.GarbageCollector.scan(GarbageCollector.java:153)





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


[jira] Commented: (JCR-1985) NullPointerException GarbageCollector.scan()

Posted by "Jacco van Weert (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674627#action_12674627 ] 

Jacco van Weert commented on JCR-1985:
--------------------------------------


Hello Thomas,

I looked to the repository.xml. You are right, the repository.xml wasn't configured to use the datastore.

Is there a "programmatic" way to detect if the GarbageCollector could run?

Greetings,

   Jacco



> NullPointerException GarbageCollector.scan()
> --------------------------------------------
>
>                 Key: JCR-1985
>                 URL: https://issues.apache.org/jira/browse/JCR-1985
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.5.2
>         Environment: Windows XP
>            Reporter: Jacco van Weert
>             Fix For: 1.5.3
>
>
> I am running the garbage collector in a separate thread every 5 minutes.
>             GarbageCollector gc = ((SessionImpl)mSession).createDataStoreGarbageCollector();
>             gc.scan();
>             gc.stopScan();
>             int du = gc.deleteUnused();
> When using Jackrabbit v1.5.2 I get sometimes a null pointer exception;
> java.lang.NullPointerException
>         at org.apache.jackrabbit.core.data.GarbageCollector.scan(GarbageCollector.java:153)

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


[jira] Commented: (JCR-1985) NullPointerException in GarbageCollector.scan() if no DataStore configured

Posted by "Jacco van Weert (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674644#action_12674644 ] 

Jacco van Weert commented on JCR-1985:
--------------------------------------


> Anyway the exception you get is not very clear. 
> What about this throws a RepositoryException: 
> ((SessionImpl)mSession).createDataStoreGarbageCollector(); 
> "No data store configured."
>

Personally I would like that createDataStoreGarbageCollector() returns a <null> when no collector could be created, but then this is more a matter of style I guess.





> NullPointerException in GarbageCollector.scan() if no DataStore configured
> --------------------------------------------------------------------------
>
>                 Key: JCR-1985
>                 URL: https://issues.apache.org/jira/browse/JCR-1985
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.5.2
>         Environment: Windows XP
>            Reporter: Jacco van Weert
>             Fix For: 1.5.3
>
>
> I am running the garbage collector in a separate thread every 5 minutes.
>             GarbageCollector gc = ((SessionImpl)mSession).createDataStoreGarbageCollector();
>             gc.scan();
>             gc.stopScan();
>             int du = gc.deleteUnused();
> When using Jackrabbit v1.5.2 I get sometimes a null pointer exception;
> java.lang.NullPointerException
>         at org.apache.jackrabbit.core.data.GarbageCollector.scan(GarbageCollector.java:153)

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


[jira] Updated: (JCR-1985) NullPointerException in GarbageCollector.scan() if no DataStore configured

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

Thomas Mueller updated JCR-1985:
--------------------------------

    Priority: Minor  (was: Major)

> NullPointerException in GarbageCollector.scan() if no DataStore configured
> --------------------------------------------------------------------------
>
>                 Key: JCR-1985
>                 URL: https://issues.apache.org/jira/browse/JCR-1985
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.5.2
>         Environment: Windows XP
>            Reporter: Jacco van Weert
>            Priority: Minor
>             Fix For: 1.6.0
>
>
> I am running the garbage collector in a separate thread every 5 minutes.
>             GarbageCollector gc = ((SessionImpl)mSession).createDataStoreGarbageCollector();
>             gc.scan();
>             gc.stopScan();
>             int du = gc.deleteUnused();
> When using Jackrabbit v1.5.2 I get sometimes a null pointer exception;
> java.lang.NullPointerException
>         at org.apache.jackrabbit.core.data.GarbageCollector.scan(GarbageCollector.java:153)

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


[jira] Commented: (JCR-1985) NullPointerException GarbageCollector.scan()

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674635#action_12674635 ] 

Thomas Mueller commented on JCR-1985:
-------------------------------------

> "programmatic" way to detect

Yes. If this is null then there is no data store:
((RepositoryImpl) s.getRepository()).getDataStore()

Anyway the exception you get is not very clear.
What about this throws a RepositoryException:
((SessionImpl)mSession).createDataStoreGarbageCollector(); 
"No data store configured."

> NullPointerException GarbageCollector.scan()
> --------------------------------------------
>
>                 Key: JCR-1985
>                 URL: https://issues.apache.org/jira/browse/JCR-1985
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.5.2
>         Environment: Windows XP
>            Reporter: Jacco van Weert
>             Fix For: 1.5.3
>
>
> I am running the garbage collector in a separate thread every 5 minutes.
>             GarbageCollector gc = ((SessionImpl)mSession).createDataStoreGarbageCollector();
>             gc.scan();
>             gc.stopScan();
>             int du = gc.deleteUnused();
> When using Jackrabbit v1.5.2 I get sometimes a null pointer exception;
> java.lang.NullPointerException
>         at org.apache.jackrabbit.core.data.GarbageCollector.scan(GarbageCollector.java:153)

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


[jira] Updated: (JCR-1985) NullPointerException in GarbageCollector.scan() if no DataStore configured

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

Thomas Mueller updated JCR-1985:
--------------------------------

    Summary: NullPointerException in GarbageCollector.scan() if no DataStore configured  (was: NullPointerException GarbageCollector.scan())

> NullPointerException in GarbageCollector.scan() if no DataStore configured
> --------------------------------------------------------------------------
>
>                 Key: JCR-1985
>                 URL: https://issues.apache.org/jira/browse/JCR-1985
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.5.2
>         Environment: Windows XP
>            Reporter: Jacco van Weert
>             Fix For: 1.5.3
>
>
> I am running the garbage collector in a separate thread every 5 minutes.
>             GarbageCollector gc = ((SessionImpl)mSession).createDataStoreGarbageCollector();
>             gc.scan();
>             gc.stopScan();
>             int du = gc.deleteUnused();
> When using Jackrabbit v1.5.2 I get sometimes a null pointer exception;
> java.lang.NullPointerException
>         at org.apache.jackrabbit.core.data.GarbageCollector.scan(GarbageCollector.java:153)

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


[jira] Commented: (JCR-1985) NullPointerException in GarbageCollector.scan() if no DataStore configured

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674657#action_12674657 ] 

Thomas Mueller commented on JCR-1985:
-------------------------------------

I saw that one of the tests first calls session.createDataStoreGarbageCollector(), and then gc.getDataStore() to check if the data store is configured. Existing applications could do that as well, so it's probably better not to throw an exception or return null in createDataStoreGarbageCollector().

> NullPointerException in GarbageCollector.scan() if no DataStore configured
> --------------------------------------------------------------------------
>
>                 Key: JCR-1985
>                 URL: https://issues.apache.org/jira/browse/JCR-1985
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.5.2
>         Environment: Windows XP
>            Reporter: Jacco van Weert
>            Priority: Minor
>             Fix For: 1.6.0
>
>
> I am running the garbage collector in a separate thread every 5 minutes.
>             GarbageCollector gc = ((SessionImpl)mSession).createDataStoreGarbageCollector();
>             gc.scan();
>             gc.stopScan();
>             int du = gc.deleteUnused();
> When using Jackrabbit v1.5.2 I get sometimes a null pointer exception;
> java.lang.NullPointerException
>         at org.apache.jackrabbit.core.data.GarbageCollector.scan(GarbageCollector.java:153)

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


[jira] Commented: (JCR-1985) NullPointerException GarbageCollector.scan()

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674619#action_12674619 ] 

Thomas Mueller commented on JCR-1985:
-------------------------------------

Hi,

Did you configure a data store? How does the repository.xml look like? Do you have any elements in the data store?

Regards,
Thomas

> NullPointerException GarbageCollector.scan()
> --------------------------------------------
>
>                 Key: JCR-1985
>                 URL: https://issues.apache.org/jira/browse/JCR-1985
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.5.2
>         Environment: Windows XP
>            Reporter: Jacco van Weert
>             Fix For: 1.5.3
>
>
> I am running the garbage collector in a separate thread every 5 minutes.
>             GarbageCollector gc = ((SessionImpl)mSession).createDataStoreGarbageCollector();
>             gc.scan();
>             gc.stopScan();
>             int du = gc.deleteUnused();
> When using Jackrabbit v1.5.2 I get sometimes a null pointer exception;
> java.lang.NullPointerException
>         at org.apache.jackrabbit.core.data.GarbageCollector.scan(GarbageCollector.java:153)

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


[jira] Resolved: (JCR-1985) NullPointerException in GarbageCollector.scan() if no DataStore configured

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

Thomas Mueller resolved JCR-1985.
---------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 1.5.3)
                   1.6.0

Committed in 745534 (trunk)

GarbageCollector.scan() now throws a RepositoryException with the message "No DataStore configured." instead of a NullPointerException.

> NullPointerException in GarbageCollector.scan() if no DataStore configured
> --------------------------------------------------------------------------
>
>                 Key: JCR-1985
>                 URL: https://issues.apache.org/jira/browse/JCR-1985
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.5.2
>         Environment: Windows XP
>            Reporter: Jacco van Weert
>             Fix For: 1.6.0
>
>
> I am running the garbage collector in a separate thread every 5 minutes.
>             GarbageCollector gc = ((SessionImpl)mSession).createDataStoreGarbageCollector();
>             gc.scan();
>             gc.stopScan();
>             int du = gc.deleteUnused();
> When using Jackrabbit v1.5.2 I get sometimes a null pointer exception;
> java.lang.NullPointerException
>         at org.apache.jackrabbit.core.data.GarbageCollector.scan(GarbageCollector.java:153)

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