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: " +
WGTextUtils.getStackTraceString(e));
                }


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:
        java.lang.AbstractMethodError:
org.apache.jackrabbit.rmi.value.SerialValue.getBinary()Ljavax/jcr/Binary;
        at 
org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java:131)
        at 
wego.ecm.WGContentRepositoryHelper.importFile(WGContentRepositoryHelper.java:325)

Reply via email to