"Unknown value type 10" when reading values of a weakreference property via RMI
-------------------------------------------------------------------------------
Key: JCRRMI-33
URL: https://issues.apache.org/jira/browse/JCRRMI-33
Project: Jackrabbit JCR-RMI
Issue Type: Bug
Affects Versions: 2.0.0, 2.0.1, 2.1.0
Reporter: Torsten Witte
Priority: Critical
When calling
{noformat}
javax.jcr.Property jcrProperty = ...
Value[] values = jcrProperty.getValues();
{noformat}
on a weakreference property the following error occurs:
{noformat}
javax.jcr.ValueFormatException: Unknown value type 10
at
org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:139)
at
org.apache.jackrabbit.rmi.server.ServerProperty.getValues(ServerProperty.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at org.apache.jackrabbit.rmi.server.ServerProperty_Stub.getValues(Unknown
Source)
at
org.apache.jackrabbit.rmi.client.ClientProperty.getValues(ClientProperty.java:173)
{noformat}
I think the reason is that
{{org.apache.jackrabbit.rmi.value.SerialValueFactory.createValue(Value value,
int type)}} does not support the property type "weakreference".
See
http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java?view=markup
in line 159.
Just adding the case for {{PropertyType.WEAKREFERENCE}} should fix the problem.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira