jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sirčne vip" <sirene_...@hotmail.com>
Subject ConstraintViolationException
Date Sun, 29 Jan 2006 15:54:35 GMT
Hello Everyone,

This becoming really annoying!

I have verified my program thousands of time and made all possible changes 
but keep having the exception "ConstraintViolationException:[other 
application_specific information]  mandatory property 
{http://www.jcp.org/jcr/1.0}created does not exist"

My code consists in the following:

public void store(String feName, String document) {

  Node root = session.getRootNode();
  Node n = root.addNode(feName, "nt:file");
  Node content = expNode.addNode("jcr:content", "nt:resource");
  content.setProperty("jcr:mimeType", "text/xml");
  content.setProperty("jcr:encoding", "");
  content.setProperty("jcr:data", document);

  Calendar lastModified = Calendar.getInstance ();
  long currentTime = System.currentTimeMillis();
  final long duration = currentTime - start;
  lastModified.setTimeInMillis(duration);
  content.setProperty("jcr:lastModified", lastModified);
   session.save();
}

Any help is truly appreciated. Thank you!
Best Regards.

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


Mime
View raw message