jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "bruno miguel cruz coelho (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCRRMI-25) RemoteRepositoryException creating a node(jcr:content) with a file (jcr:data)
Date Tue, 21 Jul 2009 17:32:14 GMT
RemoteRepositoryException creating a node(jcr:content) with a file (jcr:data)
-----------------------------------------------------------------------------

                 Key: JCRRMI-25
                 URL: https://issues.apache.org/jira/browse/JCRRMI-25
             Project: Jackrabbit JCR-RMI
          Issue Type: Bug
         Environment: tomcat 6.0.20
jackrabbit 2.0 sanpshot
            Reporter: bruno miguel cruz coelho


I have deployed the jackrabbit web-app in a tomcat (6.0.20) and now I trying
to connect another web-app, in the same tomcat instance, to the repository
by RMI.

I can get the repository client, create nodes and browse the repository in
this other web-app, all by RMI.

the only thing I can't do is create a node (jcr:content) with a file
(jcr:data):

           Repository repository;
           Session repositorySession = (Session)
session.getAttribute("repositorySession");
           if (repositorySession == null) {
               repository =
RepositoryAccessServlet.getRepository(pageContext.getServletContext());
               try {
                   repositorySession = repository.login(new
SimpleCredentials("admin", "admin".toCharArray()));
                   session.setAttribute("repositorySession",
repositorySession);
                } catch (LoginException le) {
                    error = le.toString();
                } catch (RepositoryException re) {
                    error = re.toString();
                }
           }
           Node root = repositorySession.getRootNode();

           [...]

                 InputStream uploadedStream = item.getInputStream();
                  try {
                      Node fileNode = root.addNode(item.getName(),
"nt:file");
                          Node resNode = fileNode.addNode("jcr:content",
"nt:resource");
                           resNode.setProperty("jcr:mimeType",
item.getContentType());
                          resNode.setProperty("jcr:data", uploadedStream);
                          resNode.setProperty("jcr:lastModified",
Calendar.getInstance());
                   } catch (Exception e) {
                      error = e.toString();
                  } finally {
                          uploadedStream.close();
                      }


I get an AbstractMethodError exception (check the complete stack trace at
the end).


from what I could dig in the code, looks like these is caused by the lack of
the method getBinary(Binary bin) in SerialValue.

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
org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java:182)
     at repo.NodeHouseImpl.createNode(NodeHouseImpl.java:77)
     at
org.apache.jsp.createNodesPost_jsp._jspService(createNodesPost_jsp.java:142)
     at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
     at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
  (...)
Caused by: 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
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
     at sun.rmi.transport.Transport$1.run(Transport.java:153)
     at java.security.AccessController.doPrivileged(Native Method)
     at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
     at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
     at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
     at java.lang.Thread.run(Thread.java:595)
     at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
     at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
     at
org.apache.jackrabbit.rmi.server.ServerNode_Stub.setProperty(Unknown Source)
     at
org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java:126)
     ... 21 more
Caused by: java.lang.AbstractMethodError:
org.apache.jackrabbit.rmi.value.SerialValue.getBinary()Ljavax/jcr/Binary;
     at
org.apache.jackrabbit.core.value.InternalValue.create(InternalValue.java:134)
     at
org.apache.jackrabbit.core.PropertyImpl.setValue(PropertyImpl.java:660)
     at
org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2462)
     at
org.apache.jackrabbit.rmi.server.ServerNode.setProperty(ServerNode.java:246)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    (...)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message