You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Alexander Klimetschek (JIRA)" <ji...@apache.org> on 2009/07/21 21:18:14 UTC

[jira] Updated: (JCRRMI-25) JSR-283: Support for javax.jcr.Binary

     [ https://issues.apache.org/jira/browse/JCRRMI-25?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Klimetschek updated JCRRMI-25:
----------------------------------------

    Fix Version/s: 2.0.0
      Description: 
The RMI interface must support the new javax.jcr.Binary in JSR-283.

Below is the original bug report with the exception when using jcr-rmi 1.6 with a Jackrabbit 2.0 alpha repository.

==============================

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)
    (...)

  was:
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)
    (...)

       Issue Type: New Feature  (was: Bug)
          Summary: JSR-283: Support for javax.jcr.Binary  (was: RemoteRepositoryException creating a node(jcr:content) with a file (jcr:data))

> JSR-283: Support for javax.jcr.Binary
> -------------------------------------
>
>                 Key: JCRRMI-25
>                 URL: https://issues.apache.org/jira/browse/JCRRMI-25
>             Project: Jackrabbit JCR-RMI
>          Issue Type: New Feature
>         Environment: tomcat 6.0.20
> jackrabbit 2.0 sanpshot
>            Reporter: bruno miguel cruz coelho
>             Fix For: 2.0.0
>
>
> The RMI interface must support the new javax.jcr.Binary in JSR-283.
> Below is the original bug report with the exception when using jcr-rmi 1.6 with a Jackrabbit 2.0 alpha repository.
> ==============================
> 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.