You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by "Prakash Reddy K. L. V." <Pr...@Sun.COM> on 2008/01/28 16:21:01 UTC

java.lang.NullPointerException: name can't be null (similar to JCR-1272 issue)

Hi all,

I am using jackrabbit 1.4 as my content repository and the underlying 
database is derby.
I am using jackrabbit-jca-1.4.rar connector to connect to respository 
from my web-app.

I am trying to store a file as one of the property of a node and then 
retrieving it.
The problem is the property is being created but I am getting an 
exception while retrieving the property.
Strangely when I restart my appserver where the jackrabbit-jca is 
deployed, I will be able to get the property without any exception being 
thrown.
It may not be completely reproducible but definitely in my case it is 
failing most of the time.

I think this is similar to the bug : 
http://www.mail-archive.com/dev@jackrabbit.apache.org/msg09384.html

Any ideas why this is failing??

Regards,
Prakash

Here is the stacktrace :(*Value3* is the property set to a inputstream)

javax.jcr.RepositoryException: Internal error while retrieving value of 
/SecondTest/nb/field/*Value3*: name can't be null: name can't be null
       at 
org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:470)
       at 
org.apache.jackrabbit.core.PropertyImpl.getStream(PropertyImpl.java:479)
       at 
com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getFieldValue(ContentServiceImpl.java:677) 

       at 
com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getContentFromNode(ContentServiceImpl.java:393) 

       at 
com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getContentByNameAndType(ContentServiceImpl.java:351) 

       at 
com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getContentsByType(ContentServiceImpl.java:434) 

       at 
com.sun.portal.cms.portlet.ccd.beans.ContentCreationBean.changeContentType(ContentCreationBean.java:220) 


Caused by: java.lang.NullPointerException: name can't be null
       at java.io.FilePermission.init(FilePermission.java:171)
       at java.io.FilePermission.<init>(FilePermission.java:264)
       at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
       at java.io.FileInputStream.<init>(FileInputStream.java:100)
       at 
org.apache.jackrabbit.core.value.BLOBInTempFile.getStream(BLOBInTempFile.java:145) 

       at 
org.apache.jackrabbit.core.value.InternalValue.toJCRValue(InternalValue.java:366) 

       at 
org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:466)
       ... 97 more
java.lang.NullPointerException: name can't be null
       at java.io.FilePermission.init(FilePermission.java:171)
       at java.io.FilePermission.<init>(FilePermission.java:264)
       at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
       at java.io.FileInputStream.<init>(FileInputStream.java:100)
       at 
org.apache.jackrabbit.core.value.BLOBInTempFile.getStream(BLOBInTempFile.java:145) 

       at 
org.apache.jackrabbit.core.value.InternalValue.toJCRValue(InternalValue.java:366) 

       at 
org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:466)
       at 
org.apache.jackrabbit.core.PropertyImpl.getStream(PropertyImpl.java:479)
       at 
com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getFieldValue(ContentServiceImpl.java:677) 



Re: java.lang.NullPointerException: name can't be null (similar to JCR-1272 issue)

Posted by "Prakash Reddy K. L. V." <Pr...@Sun.COM>.
Hi all,

Setting the system property "org.jackrabbit.useDataStore" to "false" before starting the repository seems to solve this issue.

Thanks to Thomas Mueller for the solution. :-) 

Cheers,
Prakash




Prakash Reddy K. L. V. wrote:
>
> Hi Stefan,
>
> I created a jira issue. Here is the link to the issue :
>
> https://issues.apache.org/jira/browse/JCR-1351
>
>
> Regards,
> Prakash
>
>
> Stefan Guggisberg wrote:
>> hi prakash,
>>
>> On Jan 28, 2008 4:21 PM, Prakash Reddy K. L. V. <Pr...@sun.com> 
>> wrote:
>>  
>>> Hi all,
>>>
>>> I am using jackrabbit 1.4 as my content repository and the underlying
>>> database is derby.
>>> I am using jackrabbit-jca-1.4.rar connector to connect to respository
>>> from my web-app.
>>>
>>> I am trying to store a file as one of the property of a node and then
>>> retrieving it.
>>> The problem is the property is being created but I am getting an
>>> exception while retrieving the property.
>>> Strangely when I restart my appserver where the jackrabbit-jca is
>>> deployed, I will be able to get the property without any exception 
>>> being
>>> thrown.
>>> It may not be completely reproducible but definitely in my case it is
>>> failing most of the time.
>>>
>>> I think this is similar to the bug :
>>> http://www.mail-archive.com/dev@jackrabbit.apache.org/msg09384.html
>>>
>>> Any ideas why this is failing??
>>>     
>>
>> what i can tell from your stack trace, retrieving the the value from 
>> your newly
>> created property seems to return a BLOBInTempFile instance which had 
>> been
>> already discarded (the 'file' field is set to null which causes the 
>> subsequent
>> NullPointerException).
>>
>> please create a jira issue and include all relevant information
>> (repository,xml etc).
>> it would help a lot if you could attach a simple test case for
>> reproducing the issue.
>>
>> BTW: i don't think that  this issue is related to
>> http://issues.apache.org/jira/browse/JCR-1272.
>>
>> thanks!
>> stefan
>>
>>  
>>> Regards,
>>> Prakash
>>>
>>> Here is the stacktrace :(*Value3* is the property set to a inputstream)
>>>
>>> javax.jcr.RepositoryException: Internal error while retrieving value of
>>> /SecondTest/nb/field/*Value3*: name can't be null: name can't be null
>>>        at
>>> org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:470)
>>>        at
>>> org.apache.jackrabbit.core.PropertyImpl.getStream(PropertyImpl.java:479) 
>>>
>>>        at
>>> com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getFieldValue(ContentServiceImpl.java:677) 
>>>
>>>
>>>        at
>>> com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getContentFromNode(ContentServiceImpl.java:393) 
>>>
>>>
>>>        at
>>> com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getContentByNameAndType(ContentServiceImpl.java:351) 
>>>
>>>
>>>        at
>>> com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getContentsByType(ContentServiceImpl.java:434) 
>>>
>>>
>>>        at
>>> com.sun.portal.cms.portlet.ccd.beans.ContentCreationBean.changeContentType(ContentCreationBean.java:220) 
>>>
>>>
>>>
>>> Caused by: java.lang.NullPointerException: name can't be null
>>>        at java.io.FilePermission.init(FilePermission.java:171)
>>>        at java.io.FilePermission.<init>(FilePermission.java:264)
>>>        at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
>>>        at java.io.FileInputStream.<init>(FileInputStream.java:100)
>>>        at
>>> org.apache.jackrabbit.core.value.BLOBInTempFile.getStream(BLOBInTempFile.java:145) 
>>>
>>>
>>>        at
>>> org.apache.jackrabbit.core.value.InternalValue.toJCRValue(InternalValue.java:366) 
>>>
>>>
>>>        at
>>> org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:466)
>>>        ... 97 more
>>> java.lang.NullPointerException: name can't be null
>>>        at java.io.FilePermission.init(FilePermission.java:171)
>>>        at java.io.FilePermission.<init>(FilePermission.java:264)
>>>        at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
>>>        at java.io.FileInputStream.<init>(FileInputStream.java:100)
>>>        at
>>> org.apache.jackrabbit.core.value.BLOBInTempFile.getStream(BLOBInTempFile.java:145) 
>>>
>>>
>>>        at
>>> org.apache.jackrabbit.core.value.InternalValue.toJCRValue(InternalValue.java:366) 
>>>
>>>
>>>        at
>>> org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:466)
>>>        at
>>> org.apache.jackrabbit.core.PropertyImpl.getStream(PropertyImpl.java:479) 
>>>
>>>        at
>>> com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getFieldValue(ContentServiceImpl.java:677) 
>>>
>>>
>>>
>>>
>>>     
>
>


Re: java.lang.NullPointerException: name can't be null (similar to JCR-1272 issue)

Posted by "Prakash Reddy K. L. V." <Pr...@Sun.COM>.
Hi Stefan,

I created a jira issue. Here is the link to the issue :

https://issues.apache.org/jira/browse/JCR-1351


Regards,
Prakash


Stefan Guggisberg wrote:
> hi prakash,
>
> On Jan 28, 2008 4:21 PM, Prakash Reddy K. L. V. <Pr...@sun.com> wrote:
>   
>> Hi all,
>>
>> I am using jackrabbit 1.4 as my content repository and the underlying
>> database is derby.
>> I am using jackrabbit-jca-1.4.rar connector to connect to respository
>> from my web-app.
>>
>> I am trying to store a file as one of the property of a node and then
>> retrieving it.
>> The problem is the property is being created but I am getting an
>> exception while retrieving the property.
>> Strangely when I restart my appserver where the jackrabbit-jca is
>> deployed, I will be able to get the property without any exception being
>> thrown.
>> It may not be completely reproducible but definitely in my case it is
>> failing most of the time.
>>
>> I think this is similar to the bug :
>> http://www.mail-archive.com/dev@jackrabbit.apache.org/msg09384.html
>>
>> Any ideas why this is failing??
>>     
>
> what i can tell from your stack trace, retrieving the the value from your newly
> created property seems to return a BLOBInTempFile instance which had been
> already discarded (the 'file' field is set to null which causes the subsequent
> NullPointerException).
>
> please create a jira issue and include all relevant information
> (repository,xml etc).
> it would help a lot if you could attach a simple test case for
> reproducing the issue.
>
> BTW: i don't think that  this issue is related to
> http://issues.apache.org/jira/browse/JCR-1272.
>
> thanks!
> stefan
>
>   
>> Regards,
>> Prakash
>>
>> Here is the stacktrace :(*Value3* is the property set to a inputstream)
>>
>> javax.jcr.RepositoryException: Internal error while retrieving value of
>> /SecondTest/nb/field/*Value3*: name can't be null: name can't be null
>>        at
>> org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:470)
>>        at
>> org.apache.jackrabbit.core.PropertyImpl.getStream(PropertyImpl.java:479)
>>        at
>> com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getFieldValue(ContentServiceImpl.java:677)
>>
>>        at
>> com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getContentFromNode(ContentServiceImpl.java:393)
>>
>>        at
>> com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getContentByNameAndType(ContentServiceImpl.java:351)
>>
>>        at
>> com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getContentsByType(ContentServiceImpl.java:434)
>>
>>        at
>> com.sun.portal.cms.portlet.ccd.beans.ContentCreationBean.changeContentType(ContentCreationBean.java:220)
>>
>>
>> Caused by: java.lang.NullPointerException: name can't be null
>>        at java.io.FilePermission.init(FilePermission.java:171)
>>        at java.io.FilePermission.<init>(FilePermission.java:264)
>>        at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
>>        at java.io.FileInputStream.<init>(FileInputStream.java:100)
>>        at
>> org.apache.jackrabbit.core.value.BLOBInTempFile.getStream(BLOBInTempFile.java:145)
>>
>>        at
>> org.apache.jackrabbit.core.value.InternalValue.toJCRValue(InternalValue.java:366)
>>
>>        at
>> org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:466)
>>        ... 97 more
>> java.lang.NullPointerException: name can't be null
>>        at java.io.FilePermission.init(FilePermission.java:171)
>>        at java.io.FilePermission.<init>(FilePermission.java:264)
>>        at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
>>        at java.io.FileInputStream.<init>(FileInputStream.java:100)
>>        at
>> org.apache.jackrabbit.core.value.BLOBInTempFile.getStream(BLOBInTempFile.java:145)
>>
>>        at
>> org.apache.jackrabbit.core.value.InternalValue.toJCRValue(InternalValue.java:366)
>>
>>        at
>> org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:466)
>>        at
>> org.apache.jackrabbit.core.PropertyImpl.getStream(PropertyImpl.java:479)
>>        at
>> com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getFieldValue(ContentServiceImpl.java:677)
>>
>>
>>
>>     


Re: java.lang.NullPointerException: name can't be null (similar to JCR-1272 issue)

Posted by Stefan Guggisberg <st...@gmail.com>.
hi prakash,

On Jan 28, 2008 4:21 PM, Prakash Reddy K. L. V. <Pr...@sun.com> wrote:
>
> Hi all,
>
> I am using jackrabbit 1.4 as my content repository and the underlying
> database is derby.
> I am using jackrabbit-jca-1.4.rar connector to connect to respository
> from my web-app.
>
> I am trying to store a file as one of the property of a node and then
> retrieving it.
> The problem is the property is being created but I am getting an
> exception while retrieving the property.
> Strangely when I restart my appserver where the jackrabbit-jca is
> deployed, I will be able to get the property without any exception being
> thrown.
> It may not be completely reproducible but definitely in my case it is
> failing most of the time.
>
> I think this is similar to the bug :
> http://www.mail-archive.com/dev@jackrabbit.apache.org/msg09384.html
>
> Any ideas why this is failing??

what i can tell from your stack trace, retrieving the the value from your newly
created property seems to return a BLOBInTempFile instance which had been
already discarded (the 'file' field is set to null which causes the subsequent
NullPointerException).

please create a jira issue and include all relevant information
(repository,xml etc).
it would help a lot if you could attach a simple test case for
reproducing the issue.

BTW: i don't think that  this issue is related to
http://issues.apache.org/jira/browse/JCR-1272.

thanks!
stefan

>
> Regards,
> Prakash
>
> Here is the stacktrace :(*Value3* is the property set to a inputstream)
>
> javax.jcr.RepositoryException: Internal error while retrieving value of
> /SecondTest/nb/field/*Value3*: name can't be null: name can't be null
>        at
> org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:470)
>        at
> org.apache.jackrabbit.core.PropertyImpl.getStream(PropertyImpl.java:479)
>        at
> com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getFieldValue(ContentServiceImpl.java:677)
>
>        at
> com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getContentFromNode(ContentServiceImpl.java:393)
>
>        at
> com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getContentByNameAndType(ContentServiceImpl.java:351)
>
>        at
> com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getContentsByType(ContentServiceImpl.java:434)
>
>        at
> com.sun.portal.cms.portlet.ccd.beans.ContentCreationBean.changeContentType(ContentCreationBean.java:220)
>
>
> Caused by: java.lang.NullPointerException: name can't be null
>        at java.io.FilePermission.init(FilePermission.java:171)
>        at java.io.FilePermission.<init>(FilePermission.java:264)
>        at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
>        at java.io.FileInputStream.<init>(FileInputStream.java:100)
>        at
> org.apache.jackrabbit.core.value.BLOBInTempFile.getStream(BLOBInTempFile.java:145)
>
>        at
> org.apache.jackrabbit.core.value.InternalValue.toJCRValue(InternalValue.java:366)
>
>        at
> org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:466)
>        ... 97 more
> java.lang.NullPointerException: name can't be null
>        at java.io.FilePermission.init(FilePermission.java:171)
>        at java.io.FilePermission.<init>(FilePermission.java:264)
>        at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
>        at java.io.FileInputStream.<init>(FileInputStream.java:100)
>        at
> org.apache.jackrabbit.core.value.BLOBInTempFile.getStream(BLOBInTempFile.java:145)
>
>        at
> org.apache.jackrabbit.core.value.InternalValue.toJCRValue(InternalValue.java:366)
>
>        at
> org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:466)
>        at
> org.apache.jackrabbit.core.PropertyImpl.getStream(PropertyImpl.java:479)
>        at
> com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getFieldValue(ContentServiceImpl.java:677)
>
>
>