Felix.
Here is my configuration:
Server (embedded within Tomcat, via the JCR-RMI from the contrib).
I am attaching my sample client code and the exception.
-Duke
------
package com.idc;
import javax.jcr.*;
public class RepoClient {
private static org.apache.log4j.Logger logger =
org.apache.log4j.Logger.getLogger(RepoClient.class);
public static final String rmiURI =
"//IDC19:1099/jackrabbit.repository";
protected static javax.jcr.Repository r = null;
protected static Session s = null;
static{
try{
System.setProperty("java.rmi.server.useCodebaseOnly", "true");
} catch(Exception e){
e.printStackTrace();
logger.error(e);
}
}
/**
*
*/
private RepoClient(){}
/**
*
*/
public static void connectRMI() {
try {
r =
new
org.apache.jackrabbit.rmi.client.ClientRepositoryFactory().getRepository(
rmiURI);
if ( null!=r ){
s = r.login(new javax.jcr.SimpleCredentials(
"username", "password".toCharArray()));
logger.info("JCR SESSION BOUNDED: " +
s.getRootNode().toString());
//RepoTest.dump(s.getRootNode());
}
} catch (NoClassDefFoundError e) {
logger.error(e);
} catch (Exception e) {
logger.error(e);
}
}
/**
*
*/
public static final void shutdownTest(){
((org.apache.jackrabbit.core.RepositoryImpl)s.getRepository()).shutdown();
}
/**
*
*/
public static final void addBinaryTest(){
java.io.File f =
new java.io.File("C:/mp3/u2-jesus.nzb");
try {
com.idc.util.FSImport.importFile(s.getRootNode(), f);
s.save();
logger.debug("ADDED CONTENT.");
} catch (javax.jcr.RepositoryException e) {
e.printStackTrace();
logger.error(e);
} catch (java.io.IOException e) {
e.printStackTrace();
logger.error(e);
}
}
/**
*
* @param args
*/
public static final void main(String args[]){
RepoClient.connectRMI();
RepoClient.addNodeTest();
}
}
EXCEPTION:
---------------------------------------------------------------------
org.apache.jackrabbit.rmi.client.RemoteRepositoryException: error
marshalling arguments; nested exception is:
java.net.SocketException: Software caused connection abort: socket
write error: error marshalling arguments; nested exception is:
java.net.SocketException: Software caused connection abort: socket
write error
at
org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java:127)
at
org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java:162)
at com.idc.util.FSImport.importFile(FSImport.java:90)
at com.idc.RepoClient.addBinaryTest(RepoClient.java:152)
at com.idc.RepoClient.main(RepoClient.java:174)
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:585)
at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)
Caused by: java.rmi.MarshalException: error marshalling arguments; nested
exception is:
java.net.SocketException: Software caused connection abort: socket
write error
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at
org.apache.jackrabbit.rmi.server.ServerNode_Stub.setProperty(Unknown Source)
at
org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java:123)
... 9 more
Caused by: java.net.SocketException: Software caused connection abort:
socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:109)
at
java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.ja
va:1676)
at
java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutp
utStream.java:1585)
at
java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1395)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:294)
at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:258)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:117)
... 11 more
java.rmi.MarshalException: error marshalling arguments; nested exception is:
java.net.SocketException: Software caused connection abort: socket
write error
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at
org.apache.jackrabbit.rmi.server.ServerNode_Stub.setProperty(Unknown Source)
at
org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java:123)
at
org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java:162)
at com.idc.util.FSImport.importFile(FSImport.java:90)
at com.idc.RepoClient.addBinaryTest(RepoClient.java:152)
at com.idc.RepoClient.main(RepoClient.java:174)
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:585)
at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)
Caused by: java.net.SocketException: Software caused connection abort:
socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:109)
at
java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.ja
va:1676)
at
java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutp
utStream.java:1585)
at
java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1395)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:294)
at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:258)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:117)
... 11 more
2005-12-13 09:57:23,622 [ERROR] [main] (RepoClient.java:158)
org.apache.jackrabbit.rmi.client.RemoteRepositoryException: error
marshalling arguments; nested exception is:
java.net.SocketException: Software caused connection abort: socket
write error: error marshalling arguments; nested exception is:
java.net.SocketException: Software caused connection abort: socket
write error
Duke K. Fong
Integrated Data Corporation
[EMAIL PROTECTED]
310-367-8412
310-815-2800 ext. 215
http://www.idc-global.com
-----Original Message-----
From: Felix Meschberger [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 13, 2005 2:09 AM
To: [email protected]
Subject: Re: [jira] Erledigt: (JCR-291) jcr-server-webapp: RMI Registration
unstable
Hi Duke,
Duke Fong schrieb:
> Hello all.
>
> I've been trying to work with the Jackrabbit JCR in Server/RMI mode.
> Read only and simple Value object insertions work fine.
>
> However, when I attempt to insert a file object (InputStream) via a
> JCR client to a JCR Server via RMI, I get a socket exception.
>
Do you have sample code to reproduce and a stack trace at hand, so that we
could find out, where the problem might be ?
> Has anyone successfully performed this on the JCR Server? If so, I
> would love to share the experiences and get any input on the concept.
>
I do not have any problems doing read and write from and to the server over
RMI.
Regards,
Felix