You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by ChadDavis <ch...@gmail.com> on 2010/01/04 21:54:09 UTC

JCR-RMI 1.5 with Jackrabbit 2.0

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)

Re: JCR-RMI 1.5 with Jackrabbit 2.0

Posted by ChadDavis <ch...@gmail.com>.
On Mon, Jan 4, 2010 at 3:10 PM, Alexander Klimetschek <ak...@day.com> wrote:
> On Mon, Jan 4, 2010 at 21:54, ChadDavis <ch...@gmail.com> wrote:
>> 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 ??
>
> See https://issues.apache.org/jira/browse/JCRRMI-25
>
> There is currently a discussion going on about the future of jcr-rmi.
> I would say it's open at the moment:
> http://markmail.org/thread/nsew3rbdae63tsdi But if it is to be
> continued (volunteers are always welcome!), JCR 2.0 support is
> definitely the next step.

If I were compelled to push on with the RMI network layer, I would
definitely volunteer to help.  On the other hand, it seems that the
SPI based remoting is the much preferred, more performant path.  If
so, I don't see why I would choose the road less travelled.  I've
already experienced one major and unexpected obstacle due to this.
Would you agree with my assessment of the SPI components as the
preferred method of remoting?

Re: JCR-RMI 1.5 with Jackrabbit 2.0

Posted by Alexander Klimetschek <ak...@day.com>.
On Mon, Jan 4, 2010 at 21:54, ChadDavis <ch...@gmail.com> wrote:
> 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 ??

See https://issues.apache.org/jira/browse/JCRRMI-25

There is currently a discussion going on about the future of jcr-rmi.
I would say it's open at the moment:
http://markmail.org/thread/nsew3rbdae63tsdi But if it is to be
continued (volunteers are always welcome!), JCR 2.0 support is
definitely the next step.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com