jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <Felix.Meschber...@day.com>
Subject Re: [jira] Erledigt: (JCR-291) jcr-server-webapp: RMI Registration unstable
Date Thu, 15 Dec 2005 07:34:01 GMT
Hi Duke,

This sounds really strange, I cannot remember ever having had such 
issues - except of course if there was no connection at all. So I am a 
bit out of advices ....

Would you mind sharing the com.idc.util.FSImport.importFile(Node, File) 
method ?

Regards
Felix

Duke Fong schrieb:
> Hello Felix.
>
> Thanks for the reply.
>
> I believe it is the latest, we checked it out last week, both the jackrabbit
> trunk and contrib trunk.
>
> The file is relatively small, less than 200K.  I ran it through the debugger
> on the JCR (Client) side.  It seems to connect fine, and am able to "read"
> from the repository, but when I set the File object to the Node Property, is
> when the exception comes up.
>
> On the server side, it is the standard JCR Servlet embedded within Tomcat,
> which creates the RMI Registry.
>
> Do I have to do any special configuration or workarounds to get it to work?
>
> -Duke
>
>
>
> Duke K. Fong
> Integrated Data Corporation
> dfong@idc-global.com
> 310-367-8412
> 310-815-2800 ext. 215
> http://www.idc-global.com
>  
>
> -----Original Message-----
> From: Felix Meschberger [mailto:Felix.Meschberger@day.com] 
> Sent: Wednesday, December 14, 2005 2:02 AM
> To: jackrabbit-dev@incubator.apache.org
> Subject: Re: [jira] Erledigt: (JCR-291) jcr-server-webapp: RMI Registration
> unstable
>
> Hi Doug,
>
> Thanks for the additional info.
>
> Given the name of the file your are trying to upload - mp3/u2-jesus.nzb
> - I assume you are trying to upload a big file, right ? Could this be the
> result of an issue with outdated jcr-rmi stream transmission from client to
> server ? Are you testing with the most recent checkout of the jcr-rmi
> project on both (client and server) sides ?
>
> FYI: The last change to transmission of binary streams from client to server
> included reducing the memory footprint - formerly the whole stream was read
> into memory and then send to the client, while now the stream is sent in
> segments of at most 4K.
>
> Regards
> Felix
>
> Duke Fong schrieb:
>   
>> 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()).shutdow
>> n();
>>
>>
>>     }
>>
>>
>>     /**
>>      *
>>      */
>>     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.j
>> ava:39
>> )
>> 	at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
>> orImpl
>> .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(ObjectOutputStr
>> eam.ja
>> va:1676)
>> 	at
>> java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(Obje
>> ctOutp
>> 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.j
>> ava:39
>> )
>> 	at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
>> orImpl
>> .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(ObjectOutputStr
>> eam.ja
>> va:1676)
>> 	at
>> java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(Obje
>> ctOutp
>> 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
>> dfong@idc-global.com
>> 310-367-8412
>> 310-815-2800 ext. 215
>> http://www.idc-global.com
>>  
>>
>> -----Original Message-----
>> From: Felix Meschberger [mailto:Felix.Meschberger@day.com]
>> Sent: Tuesday, December 13, 2005 2:09 AM
>> To: jackrabbit-dev@incubator.apache.org
>> 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
>>
>>   
>>     
>
>   


Mime
View raw message