You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Marcel Reutegger (JIRA)" <ji...@apache.org> on 2007/12/14 15:43:43 UTC

[jira] Created: (JCR-1272) Property.getValue() throws RepositoryException with internal error

Property.getValue() throws RepositoryException with internal error
------------------------------------------------------------------

                 Key: JCR-1272
                 URL: https://issues.apache.org/jira/browse/JCR-1272
             Project: Jackrabbit
          Issue Type: Bug
          Components: jackrabbit-core
            Reporter: Marcel Reutegger
            Priority: Minor


Running ConcurrentReadWriteTest (NUM_NODES=5, NUM_THREADS=3, RUN_NUM_SECONDS=120) resulted in a RepositoryException calling Property.getValue():

javax.jcr.RepositoryException: Internal error while retrieving value of b3fc1ea8-3364-4236-bcc7-dea0baf90640/{}test: null: null

Debugging shows that it is a NullPointerException:

java.lang.NullPointerException
	at org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:481)
	at org.apache.jackrabbit.core.ConcurrentReadWriteTest$1$1.execute(ConcurrentReadWriteTest.java:68)
	at org.apache.jackrabbit.core.AbstractConcurrencyTest$Executor.run(AbstractConcurrencyTest.java:110)
	at java.lang.Thread.run(Thread.java:619)

It's probably the state which has been discarded after the sanityCheck().

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


[jira] Updated: (JCR-1272) Property.getValue() throws RepositoryException with internal error

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

Jukka Zitting updated JCR-1272:
-------------------------------

    Attachment: JCR-1272.jz.patch

The attached patch (JCR-1272.jz.patch) makes all type-specific getters and setters use the generic Value methods.

The new private getPropertyState() takes care of the sanity check and returns a safe PropertyState reference if the property is OK.

There still are a number of direct unprotected references to the state variable in PropertyImpl, NodeImpl, and ItemImpl. I'm not sure how vulnerable those references are to this error condition.

> Property.getValue() throws RepositoryException with internal error
> ------------------------------------------------------------------
>
>                 Key: JCR-1272
>                 URL: https://issues.apache.org/jira/browse/JCR-1272
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>            Priority: Minor
>         Attachments: JCR-1272.jz.patch, JCR-1272.patch
>
>
> Running ConcurrentReadWriteTest (NUM_NODES=5, NUM_THREADS=3, RUN_NUM_SECONDS=120) resulted in a RepositoryException calling Property.getValue():
> javax.jcr.RepositoryException: Internal error while retrieving value of b3fc1ea8-3364-4236-bcc7-dea0baf90640/{}test: null: null
> Debugging shows that it is a NullPointerException:
> java.lang.NullPointerException
> 	at org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:481)
> 	at org.apache.jackrabbit.core.ConcurrentReadWriteTest$1$1.execute(ConcurrentReadWriteTest.java:68)
> 	at org.apache.jackrabbit.core.AbstractConcurrencyTest$Executor.run(AbstractConcurrencyTest.java:110)
> 	at java.lang.Thread.run(Thread.java:619)
> It's probably the state which has been discarded after the sanityCheck().

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


[jira] Resolved: (JCR-1272) Property.getValue() throws RepositoryException with internal error

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

Marcel Reutegger resolved JCR-1272.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4

Committed Jukkas patch in revision: 605506

> Property.getValue() throws RepositoryException with internal error
> ------------------------------------------------------------------
>
>                 Key: JCR-1272
>                 URL: https://issues.apache.org/jira/browse/JCR-1272
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: JCR-1272.jz.patch, JCR-1272.patch
>
>
> Running ConcurrentReadWriteTest (NUM_NODES=5, NUM_THREADS=3, RUN_NUM_SECONDS=120) resulted in a RepositoryException calling Property.getValue():
> javax.jcr.RepositoryException: Internal error while retrieving value of b3fc1ea8-3364-4236-bcc7-dea0baf90640/{}test: null: null
> Debugging shows that it is a NullPointerException:
> java.lang.NullPointerException
> 	at org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:481)
> 	at org.apache.jackrabbit.core.ConcurrentReadWriteTest$1$1.execute(ConcurrentReadWriteTest.java:68)
> 	at org.apache.jackrabbit.core.AbstractConcurrencyTest$Executor.run(AbstractConcurrencyTest.java:110)
> 	at java.lang.Thread.run(Thread.java:619)
> It's probably the state which has been discarded after the sanityCheck().

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


[jira] Commented: (JCR-1272) Property.getValue() throws RepositoryException with internal error

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552760 ] 

Jukka Zitting commented on JCR-1272:
------------------------------------

What about all the other value getters like getString()? I guess we should make them just call getValue() instead of trying to optimize things.

> Property.getValue() throws RepositoryException with internal error
> ------------------------------------------------------------------
>
>                 Key: JCR-1272
>                 URL: https://issues.apache.org/jira/browse/JCR-1272
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>            Priority: Minor
>         Attachments: JCR-1272.patch
>
>
> Running ConcurrentReadWriteTest (NUM_NODES=5, NUM_THREADS=3, RUN_NUM_SECONDS=120) resulted in a RepositoryException calling Property.getValue():
> javax.jcr.RepositoryException: Internal error while retrieving value of b3fc1ea8-3364-4236-bcc7-dea0baf90640/{}test: null: null
> Debugging shows that it is a NullPointerException:
> java.lang.NullPointerException
> 	at org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:481)
> 	at org.apache.jackrabbit.core.ConcurrentReadWriteTest$1$1.execute(ConcurrentReadWriteTest.java:68)
> 	at org.apache.jackrabbit.core.AbstractConcurrencyTest$Executor.run(AbstractConcurrencyTest.java:110)
> 	at java.lang.Thread.run(Thread.java:619)
> It's probably the state which has been discarded after the sanityCheck().

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


[jira] Commented: (JCR-1272) Property.getValue() throws RepositoryException with internal error

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552774 ] 

Marcel Reutegger commented on JCR-1272:
---------------------------------------

You are right. The funny thing is getString() already uses getValue(). :-)

I think we should get rid of the sections documented with:
// avoid unnecessary object creation if possible

They add a significant amount of code and I doubt it is worth it.

> Property.getValue() throws RepositoryException with internal error
> ------------------------------------------------------------------
>
>                 Key: JCR-1272
>                 URL: https://issues.apache.org/jira/browse/JCR-1272
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>            Priority: Minor
>         Attachments: JCR-1272.patch
>
>
> Running ConcurrentReadWriteTest (NUM_NODES=5, NUM_THREADS=3, RUN_NUM_SECONDS=120) resulted in a RepositoryException calling Property.getValue():
> javax.jcr.RepositoryException: Internal error while retrieving value of b3fc1ea8-3364-4236-bcc7-dea0baf90640/{}test: null: null
> Debugging shows that it is a NullPointerException:
> java.lang.NullPointerException
> 	at org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:481)
> 	at org.apache.jackrabbit.core.ConcurrentReadWriteTest$1$1.execute(ConcurrentReadWriteTest.java:68)
> 	at org.apache.jackrabbit.core.AbstractConcurrencyTest$Executor.run(AbstractConcurrencyTest.java:110)
> 	at java.lang.Thread.run(Thread.java:619)
> It's probably the state which has been discarded after the sanityCheck().

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


[jira] Commented: (JCR-1272) Property.getValue() throws RepositoryException with internal error

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12553290 ] 

Marcel Reutegger commented on JCR-1272:
---------------------------------------

Looks good.

+1

I'll commit the patch.

> Property.getValue() throws RepositoryException with internal error
> ------------------------------------------------------------------
>
>                 Key: JCR-1272
>                 URL: https://issues.apache.org/jira/browse/JCR-1272
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>            Priority: Minor
>         Attachments: JCR-1272.jz.patch, JCR-1272.patch
>
>
> Running ConcurrentReadWriteTest (NUM_NODES=5, NUM_THREADS=3, RUN_NUM_SECONDS=120) resulted in a RepositoryException calling Property.getValue():
> javax.jcr.RepositoryException: Internal error while retrieving value of b3fc1ea8-3364-4236-bcc7-dea0baf90640/{}test: null: null
> Debugging shows that it is a NullPointerException:
> java.lang.NullPointerException
> 	at org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:481)
> 	at org.apache.jackrabbit.core.ConcurrentReadWriteTest$1$1.execute(ConcurrentReadWriteTest.java:68)
> 	at org.apache.jackrabbit.core.AbstractConcurrencyTest$Executor.run(AbstractConcurrencyTest.java:110)
> 	at java.lang.Thread.run(Thread.java:619)
> It's probably the state which has been discarded after the sanityCheck().

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


[jira] Commented: (JCR-1272) Property.getValue() throws RepositoryException with internal error

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552769 ] 

Jukka Zitting commented on JCR-1272:
------------------------------------

In fact there are tons of unguarded code that accesses the state variable. I'll come up with a patch for fixing them all.

> Property.getValue() throws RepositoryException with internal error
> ------------------------------------------------------------------
>
>                 Key: JCR-1272
>                 URL: https://issues.apache.org/jira/browse/JCR-1272
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>            Priority: Minor
>         Attachments: JCR-1272.patch
>
>
> Running ConcurrentReadWriteTest (NUM_NODES=5, NUM_THREADS=3, RUN_NUM_SECONDS=120) resulted in a RepositoryException calling Property.getValue():
> javax.jcr.RepositoryException: Internal error while retrieving value of b3fc1ea8-3364-4236-bcc7-dea0baf90640/{}test: null: null
> Debugging shows that it is a NullPointerException:
> java.lang.NullPointerException
> 	at org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:481)
> 	at org.apache.jackrabbit.core.ConcurrentReadWriteTest$1$1.execute(ConcurrentReadWriteTest.java:68)
> 	at org.apache.jackrabbit.core.AbstractConcurrencyTest$Executor.run(AbstractConcurrencyTest.java:110)
> 	at java.lang.Thread.run(Thread.java:619)
> It's probably the state which has been discarded after the sanityCheck().

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


[jira] Updated: (JCR-1272) Property.getValue() throws RepositoryException with internal error

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

Marcel Reutegger updated JCR-1272:
----------------------------------

    Attachment: JCR-1272.patch

Moved getItemState() to the top of the method. This ensures that the state reference is still valid even if the property is discarded after the sanityCheck().

> Property.getValue() throws RepositoryException with internal error
> ------------------------------------------------------------------
>
>                 Key: JCR-1272
>                 URL: https://issues.apache.org/jira/browse/JCR-1272
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>            Priority: Minor
>         Attachments: JCR-1272.patch
>
>
> Running ConcurrentReadWriteTest (NUM_NODES=5, NUM_THREADS=3, RUN_NUM_SECONDS=120) resulted in a RepositoryException calling Property.getValue():
> javax.jcr.RepositoryException: Internal error while retrieving value of b3fc1ea8-3364-4236-bcc7-dea0baf90640/{}test: null: null
> Debugging shows that it is a NullPointerException:
> java.lang.NullPointerException
> 	at org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:481)
> 	at org.apache.jackrabbit.core.ConcurrentReadWriteTest$1$1.execute(ConcurrentReadWriteTest.java:68)
> 	at org.apache.jackrabbit.core.AbstractConcurrencyTest$Executor.run(AbstractConcurrencyTest.java:110)
> 	at java.lang.Thread.run(Thread.java:619)
> It's probably the state which has been discarded after the sanityCheck().

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