jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ChadDavis <chadmichaelda...@gmail.com>
Subject JCR-RMI 1.5 with Jackrabbit 2.0
Date Mon, 04 Jan 2010 20:54:09 GMT
I'm having problem creating a Binary value.  I searched this list and
discovered that the JCR-RMI package simply doesn't support this 2.0
feature.  The old thread suggests that the RMI stuff might not ever be
updated to support the full 2.0 functionality.  Is this true?

Is there any way to create Binary properties with JCR-RMI 1.5 and
Jackrabbit 2.0 ??

Here's my code:

	// create the mandatory child node - jcr:content
		Node resNode = fileNode.addNode("jcr:content", "nt:resource");
		resNode.setProperty("jcr:mimeType", mimeType);
		resNode.setProperty("jcr:encoding", encoding);
		ValueFactory valueFactory = resNode.getSession().getValueFactory();
		InputStream fileIn =  new FileInputStream ( file );
		try {
			// The createBinary method isn't available in the RMI package we're using
			//Binary binary = valueFactory.createBinary( fileIn);
			//Value fileValue = valueFactory.createValue(binary);
			Value fileValue = valueFactory.createValue(fileIn);
			resNode.setProperty("jcr:data", fileValue );
		} catch ( Exception e ) {
			log_.error( "Problem creating binary associated document: " +

And here's my error:

ERROR ContentRepositoryHelper: Problem creating binary associated
document: org.apache.jackrabbit.rmi.client.RemoteRepositoryException:
java.rmi.ServerError: Error occurred in server thread; nested
exception is:
	at org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java:131)
	at wego.ecm.WGContentRepositoryHelper.importFile(WGContentRepositoryHelper.java:325)

View raw message