You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Julian Reschke (JIRA)" <ji...@apache.org> on 2007/07/25 20:25:31 UTC
[jira] Created: (JCR-1036) JCR2SPI; setProperty(name, date-string)
fails when property is added and property type is PropertyType.DATE.
JCR2SPI; setProperty(name, date-string) fails when property is added and property type is PropertyType.DATE.
------------------------------------------------------------------------------------------------------------
Key: JCR-1036
URL: https://issues.apache.org/jira/browse/JCR-1036
Project: Jackrabbit
Issue Type: Bug
Components: SPI
Reporter: Julian Reschke
Example code:
Node l_parent = (Node)session.getItem(this.m_path);
Node l_test = l_parent.addNode("createcontenttest", "nt:file");
Node l_content = l_test.addNode("jcr:content", "nt:resource");
l_content.setProperty("jcr:encoding", "UTF-8");
l_content.setProperty("jcr:mimeType", "text/plain");
l_content.setProperty("jcr:data", new ByteArrayInputStream("foobar".getBytes()));
l_content.setProperty("jcr:lastModified", "2007-07-25T17:04:00.000Z"); // TODO: this should work as well, bug in JCR2SPI?
session.save();
This will fail when the property is defined as DATE, what should happen is that a value comparison is attempted (note that it works when the property already exists and just is overwritten).
The exception is:
javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {http://www.jcp.org/jcr/1.0}lastModified
at org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProviderImpl.getQPropertyDefinition(ItemDefinitionProviderImpl.java:269)
at org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProviderImpl.getQPropertyDefinition(ItemDefinitionProviderImpl.java:159)
at org.apache.jackrabbit.jcr2spi.NodeImpl.getApplicablePropertyDefinition(NodeImpl.java:1672)
at org.apache.jackrabbit.jcr2spi.NodeImpl.createProperty(NodeImpl.java:1369)
at org.apache.jackrabbit.jcr2spi.NodeImpl.setProperty(NodeImpl.java:264)
at org.apache.jackrabbit.jcr2spi.NodeImpl.setProperty(NodeImpl.java:345)
at org.apache.jackrabbit.jcr2spi.NodeImpl.setProperty(NodeImpl.java:336)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1036) JCR2SPI; setProperty(name, date-string)
fails when property is added and property type is PropertyType.DATE.
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1036?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting updated JCR-1036:
-------------------------------
Fix Version/s: 1.4
> JCR2SPI; setProperty(name, date-string) fails when property is added and property type is PropertyType.DATE.
> ------------------------------------------------------------------------------------------------------------
>
> Key: JCR-1036
> URL: https://issues.apache.org/jira/browse/JCR-1036
> Project: Jackrabbit
> Issue Type: Bug
> Components: SPI
> Reporter: Julian Reschke
> Assignee: Julian Reschke
> Fix For: 1.4
>
>
> Example code:
> Node l_parent = (Node)session.getItem(this.m_path);
>
> Node l_test = l_parent.addNode("createcontenttest", "nt:file");
> Node l_content = l_test.addNode("jcr:content", "nt:resource");
>
> l_content.setProperty("jcr:encoding", "UTF-8");
> l_content.setProperty("jcr:mimeType", "text/plain");
> l_content.setProperty("jcr:data", new ByteArrayInputStream("foobar".getBytes()));
> l_content.setProperty("jcr:lastModified", "2007-07-25T17:04:00.000Z"); // TODO: this should work as well, bug in JCR2SPI?
> session.save();
> This will fail when the property is defined as DATE, what should happen is that a value comparison is attempted (note that it works when the property already exists and just is overwritten).
> The exception is:
> javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {http://www.jcp.org/jcr/1.0}lastModified
> at org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProviderImpl.getQPropertyDefinition(ItemDefinitionProviderImpl.java:269)
> at org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProviderImpl.getQPropertyDefinition(ItemDefinitionProviderImpl.java:159)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.getApplicablePropertyDefinition(NodeImpl.java:1672)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.createProperty(NodeImpl.java:1369)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.setProperty(NodeImpl.java:264)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.setProperty(NodeImpl.java:345)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.setProperty(NodeImpl.java:336)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (JCR-1036) JCR2SPI; setProperty(name, date-string)
fails when property is added and property type is PropertyType.DATE.
Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1036?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julian Reschke resolved JCR-1036.
---------------------------------
Resolution: Fixed
Fixed with r559802.
> JCR2SPI; setProperty(name, date-string) fails when property is added and property type is PropertyType.DATE.
> ------------------------------------------------------------------------------------------------------------
>
> Key: JCR-1036
> URL: https://issues.apache.org/jira/browse/JCR-1036
> Project: Jackrabbit
> Issue Type: Bug
> Components: SPI
> Reporter: Julian Reschke
> Assignee: Julian Reschke
>
> Example code:
> Node l_parent = (Node)session.getItem(this.m_path);
>
> Node l_test = l_parent.addNode("createcontenttest", "nt:file");
> Node l_content = l_test.addNode("jcr:content", "nt:resource");
>
> l_content.setProperty("jcr:encoding", "UTF-8");
> l_content.setProperty("jcr:mimeType", "text/plain");
> l_content.setProperty("jcr:data", new ByteArrayInputStream("foobar".getBytes()));
> l_content.setProperty("jcr:lastModified", "2007-07-25T17:04:00.000Z"); // TODO: this should work as well, bug in JCR2SPI?
> session.save();
> This will fail when the property is defined as DATE, what should happen is that a value comparison is attempted (note that it works when the property already exists and just is overwritten).
> The exception is:
> javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {http://www.jcp.org/jcr/1.0}lastModified
> at org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProviderImpl.getQPropertyDefinition(ItemDefinitionProviderImpl.java:269)
> at org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProviderImpl.getQPropertyDefinition(ItemDefinitionProviderImpl.java:159)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.getApplicablePropertyDefinition(NodeImpl.java:1672)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.createProperty(NodeImpl.java:1369)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.setProperty(NodeImpl.java:264)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.setProperty(NodeImpl.java:345)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.setProperty(NodeImpl.java:336)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (JCR-1036) JCR2SPI; setProperty(name, date-string)
fails when property is added and property type is PropertyType.DATE.
Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1036?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julian Reschke reassigned JCR-1036:
-----------------------------------
Assignee: Julian Reschke
> JCR2SPI; setProperty(name, date-string) fails when property is added and property type is PropertyType.DATE.
> ------------------------------------------------------------------------------------------------------------
>
> Key: JCR-1036
> URL: https://issues.apache.org/jira/browse/JCR-1036
> Project: Jackrabbit
> Issue Type: Bug
> Components: SPI
> Reporter: Julian Reschke
> Assignee: Julian Reschke
>
> Example code:
> Node l_parent = (Node)session.getItem(this.m_path);
>
> Node l_test = l_parent.addNode("createcontenttest", "nt:file");
> Node l_content = l_test.addNode("jcr:content", "nt:resource");
>
> l_content.setProperty("jcr:encoding", "UTF-8");
> l_content.setProperty("jcr:mimeType", "text/plain");
> l_content.setProperty("jcr:data", new ByteArrayInputStream("foobar".getBytes()));
> l_content.setProperty("jcr:lastModified", "2007-07-25T17:04:00.000Z"); // TODO: this should work as well, bug in JCR2SPI?
> session.save();
> This will fail when the property is defined as DATE, what should happen is that a value comparison is attempted (note that it works when the property already exists and just is overwritten).
> The exception is:
> javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {http://www.jcp.org/jcr/1.0}lastModified
> at org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProviderImpl.getQPropertyDefinition(ItemDefinitionProviderImpl.java:269)
> at org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProviderImpl.getQPropertyDefinition(ItemDefinitionProviderImpl.java:159)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.getApplicablePropertyDefinition(NodeImpl.java:1672)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.createProperty(NodeImpl.java:1369)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.setProperty(NodeImpl.java:264)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.setProperty(NodeImpl.java:345)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.setProperty(NodeImpl.java:336)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-1036) JCR2SPI; setProperty(name,
date-string) fails when property is added and property type is
PropertyType.DATE.
Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515645 ]
Julian Reschke commented on JCR-1036:
-------------------------------------
The problem applies to all cases where a conversion from the "implied" type String to another type is needed, so it is not restricted to dates.
> JCR2SPI; setProperty(name, date-string) fails when property is added and property type is PropertyType.DATE.
> ------------------------------------------------------------------------------------------------------------
>
> Key: JCR-1036
> URL: https://issues.apache.org/jira/browse/JCR-1036
> Project: Jackrabbit
> Issue Type: Bug
> Components: SPI
> Reporter: Julian Reschke
> Assignee: Julian Reschke
>
> Example code:
> Node l_parent = (Node)session.getItem(this.m_path);
>
> Node l_test = l_parent.addNode("createcontenttest", "nt:file");
> Node l_content = l_test.addNode("jcr:content", "nt:resource");
>
> l_content.setProperty("jcr:encoding", "UTF-8");
> l_content.setProperty("jcr:mimeType", "text/plain");
> l_content.setProperty("jcr:data", new ByteArrayInputStream("foobar".getBytes()));
> l_content.setProperty("jcr:lastModified", "2007-07-25T17:04:00.000Z"); // TODO: this should work as well, bug in JCR2SPI?
> session.save();
> This will fail when the property is defined as DATE, what should happen is that a value comparison is attempted (note that it works when the property already exists and just is overwritten).
> The exception is:
> javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {http://www.jcp.org/jcr/1.0}lastModified
> at org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProviderImpl.getQPropertyDefinition(ItemDefinitionProviderImpl.java:269)
> at org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProviderImpl.getQPropertyDefinition(ItemDefinitionProviderImpl.java:159)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.getApplicablePropertyDefinition(NodeImpl.java:1672)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.createProperty(NodeImpl.java:1369)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.setProperty(NodeImpl.java:264)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.setProperty(NodeImpl.java:345)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.setProperty(NodeImpl.java:336)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.