You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by CesarX <ci...@gmail.com> on 2009/11/30 17:38:37 UTC
Error Updating a node
Hi everybody,
i'm using jackrabbit with liferay 5.1, it was very good but 3 weeks ago when
i want to do an update of anyfile, my console show the next error:
this error appear in any cases and other files are normal.
com.liferay.portal.SystemException: javax.jcr.ItemNotFoundException:
38dfef6e-ecd2-470e-bd47-bb459f57d683
at
com.liferay.documentlibrary.util.JCRHook.updateFile(JCRHook.java:626)
at
com.liferay.documentlibrary.service.impl.DLLocalServiceImpl.updateFile(DLLocalServiceImpl.java:187)
at
com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.updateFileEntry(DLFileEntryLocalServiceImpl.java:906)
at
com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.updateFileEntry(DLFileEntryLocalServiceImpl.java:732)
at
com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil.updateFileEntry(DLFileEntryLocalServiceUtil.java:454)
at
com.liferay.portlet.documentlibrary.action.EditFileEntryAction.updateFileEntry(EditFileEntryAction.java:308)
at
com.liferay.portlet.documentlibrary.action.EditFileEntryAction.processAction(EditFileEntryAction.java:103)
at
com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:178)
at
com.liferay.portlet.StrutsPortlet.processAction(StrutsPortlet.java:197)
i have done a debug and i found the error appear in this line:
session = JCRFactoryUtil.createSession();
Node rootNode = getRootNode(session, companyId);
Node repositoryNode = getFolderNode(rootNode, repositoryId);
Node fileNode = repositoryNode.getNode(fileName);
Node contentNode = fileNode.getNode(JCRConstants.JCR_CONTENT);
contentNode.checkout();//ERROR IS HERE
contentNode.setProperty(JCRConstants.JCR_MIME_TYPE, "text/plain");
contentNode.setProperty(JCRConstants.JCR_DATA, is);
contentNode.setProperty(
JCRConstants.JCR_LAST_MODIFIED, Calendar.getInstance());
session.save();
--
View this message in context: http://n4.nabble.com/Error-Updating-a-node-tp931412p931412.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Error Updating a node
Posted by CesarX <ci...@gmail.com>.
Hi alexander,
i have printed this linecode in the console
System.out.println("getPrimaryItem: "+contentNode.getPrimaryItem());
then show this:
/10109/documentlibrary/51117/DLFE-2507.swf/jcr:content/jcr:data
How can i check if direccion exist?
Alexander Klimetschek wrote:
>
> On Tue, Dec 1, 2009 at 15:52, CesarX <ci...@gmail.com> wrote:
>> Excuse me, how can i check if the node have a primary property?.
>> I wrote the next line of code:
>> System.out.println("getPrimaryItem: "+contentNode.getPrimaryItem());
>
> That's already the right direction: If the primary item does not
> exist, getPrimaryItem() will throw an ItemNotFoundException.
>
> Regards,
> Alex
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>
>
--
View this message in context: http://n4.nabble.com/Error-Updating-a-node-tp931412p932453.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Error Updating a node
Posted by Alexander Klimetschek <ak...@day.com>.
On Tue, Dec 1, 2009 at 15:52, CesarX <ci...@gmail.com> wrote:
> Excuse me, how can i check if the node have a primary property?.
> I wrote the next line of code:
> System.out.println("getPrimaryItem: "+contentNode.getPrimaryItem());
That's already the right direction: If the primary item does not
exist, getPrimaryItem() will throw an ItemNotFoundException.
Regards,
Alex
--
Alexander Klimetschek
alexander.klimetschek@day.com
RE: Error Updating a node
Posted by CesarX <ci...@gmail.com>.
Hi Sunil,
Excuse me, how can i check if the node have a primary property?.
I wrote the next line of code:
System.out.println("getPrimaryItem: "+contentNode.getPrimaryItem());
The Console print this:
/10109/documentlibrary/51117/DLFE-2507.swf/jcr:content/jcr:data
Thanks for your help!.
Sunil Dhage wrote:
>
> Hi Cesar,
>
> It may be because the node, which you are trying to checkout is not
> versionable. or the former version does not have a primary property
> associated with that.
>
> From javadocs: Node will throw ItemNotFoundException if this node does
> not have a primary child item, either because none is declared in the node
> type or because a declared primary item is not present on this node
> instance.
>
> please double check whether the node actually have a primary property.
> if yes, then did you set the property at the time of node addition. i.e.
> before update.
>
>
> /Sunil Dhage
> ________________________________________
> From: CesarX [cingaruca@gmail.com]
> Sent: Monday, November 30, 2009 10:08 PM
> To: users@jackrabbit.apache.org
> Subject: Error Updating a node
>
> Hi everybody,
>
> i'm using jackrabbit with liferay 5.1, it was very good but 3 weeks ago
> when
> i want to do an update of anyfile, my console show the next error:
>
>
> this error appear in any cases and other files are normal.
> com.liferay.portal.SystemException: javax.jcr.ItemNotFoundException:
> 38dfef6e-ecd2-470e-bd47-bb459f57d683
>
> at
> com.liferay.documentlibrary.util.JCRHook.updateFile(JCRHook.java:626)
>
> at
> com.liferay.documentlibrary.service.impl.DLLocalServiceImpl.updateFile(DLLocalServiceImpl.java:187)
> at
> com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.updateFileEntry(DLFileEntryLocalServiceImpl.java:906)
> at
> com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.updateFileEntry(DLFileEntryLocalServiceImpl.java:732)
> at
> com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil.updateFileEntry(DLFileEntryLocalServiceUtil.java:454)
> at
> com.liferay.portlet.documentlibrary.action.EditFileEntryAction.updateFileEntry(EditFileEntryAction.java:308)
> at
> com.liferay.portlet.documentlibrary.action.EditFileEntryAction.processAction(EditFileEntryAction.java:103)
> at
> com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:178)
> at
> com.liferay.portlet.StrutsPortlet.processAction(StrutsPortlet.java:197)
>
> i have done a debug and i found the error appear in this line:
> session = JCRFactoryUtil.createSession();
>
> Node rootNode = getRootNode(session, companyId);
> Node repositoryNode = getFolderNode(rootNode,
> repositoryId);
> Node fileNode = repositoryNode.getNode(fileName);
> Node contentNode =
> fileNode.getNode(JCRConstants.JCR_CONTENT);
>
> contentNode.checkout();//ERROR IS HERE
>
>
> contentNode.setProperty(JCRConstants.JCR_MIME_TYPE, "text/plain");
> contentNode.setProperty(JCRConstants.JCR_DATA,
> is);
> contentNode.setProperty(
> JCRConstants.JCR_LAST_MODIFIED,
> Calendar.getInstance());
>
> session.save();
> --
> View this message in context:
> http://n4.nabble.com/Error-Updating-a-node-tp931412p931412.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>
--
View this message in context: http://n4.nabble.com/Error-Updating-a-node-tp931412p932255.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
RE: Error Updating a node
Posted by Sunil Dhage <su...@coreobjects.com>.
Hi Cesar,
It may be because the node, which you are trying to checkout is not versionable. or the former version does not have a primary property associated with that.
>From javadocs: Node will throw ItemNotFoundException if this node does not have a primary child item, either because none is declared in the node type or because a declared primary item is not present on this node instance.
please double check whether the node actually have a primary property.
if yes, then did you set the property at the time of node addition. i.e. before update.
/Sunil Dhage
________________________________________
From: CesarX [cingaruca@gmail.com]
Sent: Monday, November 30, 2009 10:08 PM
To: users@jackrabbit.apache.org
Subject: Error Updating a node
Hi everybody,
i'm using jackrabbit with liferay 5.1, it was very good but 3 weeks ago when
i want to do an update of anyfile, my console show the next error:
this error appear in any cases and other files are normal.
com.liferay.portal.SystemException: javax.jcr.ItemNotFoundException:
38dfef6e-ecd2-470e-bd47-bb459f57d683
at
com.liferay.documentlibrary.util.JCRHook.updateFile(JCRHook.java:626)
at
com.liferay.documentlibrary.service.impl.DLLocalServiceImpl.updateFile(DLLocalServiceImpl.java:187)
at
com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.updateFileEntry(DLFileEntryLocalServiceImpl.java:906)
at
com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.updateFileEntry(DLFileEntryLocalServiceImpl.java:732)
at
com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil.updateFileEntry(DLFileEntryLocalServiceUtil.java:454)
at
com.liferay.portlet.documentlibrary.action.EditFileEntryAction.updateFileEntry(EditFileEntryAction.java:308)
at
com.liferay.portlet.documentlibrary.action.EditFileEntryAction.processAction(EditFileEntryAction.java:103)
at
com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:178)
at
com.liferay.portlet.StrutsPortlet.processAction(StrutsPortlet.java:197)
i have done a debug and i found the error appear in this line:
session = JCRFactoryUtil.createSession();
Node rootNode = getRootNode(session, companyId);
Node repositoryNode = getFolderNode(rootNode, repositoryId);
Node fileNode = repositoryNode.getNode(fileName);
Node contentNode = fileNode.getNode(JCRConstants.JCR_CONTENT);
contentNode.checkout();//ERROR IS HERE
contentNode.setProperty(JCRConstants.JCR_MIME_TYPE, "text/plain");
contentNode.setProperty(JCRConstants.JCR_DATA, is);
contentNode.setProperty(
JCRConstants.JCR_LAST_MODIFIED, Calendar.getInstance());
session.save();
--
View this message in context: http://n4.nabble.com/Error-Updating-a-node-tp931412p931412.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.