You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2005/12/11 13:35:09 UTC

[jira] Erstellt: (JCR-291) jcr-server-webapp: RMI Registration unstable

jcr-server-webapp: RMI Registration unstable
--------------------------------------------

         Key: JCR-291
         URL: http://issues.apache.org/jira/browse/JCR-291
     Project: Jackrabbit
        Type: Improvement
 Environment: SVN Rev. 355696
    Reporter: Felix Meschberger
    Priority: Minor


Registration of the repository to a RMI registry in RepositoryStartupServlet.registerRMI uses web application parameters inconsistently and may not always succeed registering the repository.

Today, the registerRMI uses these parameters for registration to RMI:

    rmi-host : The name of the host on which the registry is running
    rmi-port : The port on which the registry is running
    rmi-uri : An RMI URI to use for registration
    repository-name : The name to bind the repository to

The problem is, that rmi-port is used to try to create the registry to make sure a registry is running on the local host. The rmi-uri is used to register the repository using the static Naming.bind method. If the rmi-uri is not configured, the URI is created from rmi-host, rmi-port and repository-name.

This may now create a bunch of problems: If the rmi-port and rmi-uri configurations do not match, registration fails, if rmi-host does not resolve to an IP address to which the registry is bound, registration fails.

I encounter this issue, when trying to register the repository to an RMI registry using default rmi-port configuration (rmi-host and rmi-uri not configured) when running the web app in Jetty.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (JCR-291) jcr-server-webapp: RMI Registration unstable

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-291?page=all ]
     
Jukka Zitting closed JCR-291:
-----------------------------

    Fix Version: 1.0
                     (was: 1.0.1)
     Resolution: Fixed

Closed with the correct fix version.

> jcr-server-webapp: RMI Registration unstable
> --------------------------------------------
>
>          Key: JCR-291
>          URL: http://issues.apache.org/jira/browse/JCR-291
>      Project: Jackrabbit
>         Type: Improvement
>  Environment: SVN Rev. 355696
>     Reporter: Felix Meschberger
>     Assignee: Felix Meschberger
>     Priority: Minor
>      Fix For: 1.0
>  Attachments: RMIRegistry_fm_051211.diff
>
> Registration of the repository to a RMI registry in RepositoryStartupServlet.registerRMI uses web application parameters inconsistently and may not always succeed registering the repository.
> Today, the registerRMI uses these parameters for registration to RMI:
>     rmi-host : The name of the host on which the registry is running
>     rmi-port : The port on which the registry is running
>     rmi-uri : An RMI URI to use for registration
>     repository-name : The name to bind the repository to
> The problem is, that rmi-port is used to try to create the registry to make sure a registry is running on the local host. The rmi-uri is used to register the repository using the static Naming.bind method. If the rmi-uri is not configured, the URI is created from rmi-host, rmi-port and repository-name.
> This may now create a bunch of problems: If the rmi-port and rmi-uri configurations do not match, registration fails, if rmi-host does not resolve to an IP address to which the registry is bound, registration fails.
> I encounter this issue, when trying to register the repository to an RMI registry using default rmi-port configuration (rmi-host and rmi-uri not configured) when running the web app in Jetty.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Zugewiesen: (JCR-291) jcr-server-webapp: RMI Registration unstable

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-291?page=all ]

Felix Meschberger reassigned JCR-291:
-------------------------------------

    Assign To: Felix Meschberger

> jcr-server-webapp: RMI Registration unstable
> --------------------------------------------
>
>          Key: JCR-291
>          URL: http://issues.apache.org/jira/browse/JCR-291
>      Project: Jackrabbit
>         Type: Improvement
>  Environment: SVN Rev. 355696
>     Reporter: Felix Meschberger
>     Assignee: Felix Meschberger
>     Priority: Minor
>  Attachments: RMIRegistry_fm_051211.diff
>
> Registration of the repository to a RMI registry in RepositoryStartupServlet.registerRMI uses web application parameters inconsistently and may not always succeed registering the repository.
> Today, the registerRMI uses these parameters for registration to RMI:
>     rmi-host : The name of the host on which the registry is running
>     rmi-port : The port on which the registry is running
>     rmi-uri : An RMI URI to use for registration
>     repository-name : The name to bind the repository to
> The problem is, that rmi-port is used to try to create the registry to make sure a registry is running on the local host. The rmi-uri is used to register the repository using the static Naming.bind method. If the rmi-uri is not configured, the URI is created from rmi-host, rmi-port and repository-name.
> This may now create a bunch of problems: If the rmi-port and rmi-uri configurations do not match, registration fails, if rmi-host does not resolve to an IP address to which the registry is bound, registration fails.
> I encounter this issue, when trying to register the repository to an RMI registry using default rmi-port configuration (rmi-host and rmi-uri not configured) when running the web app in Jetty.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Geschlossen: (JCR-291) jcr-server-webapp: RMI Registration unstable

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-291?page=all ]
     
Felix Meschberger closed JCR-291:
---------------------------------


Done.

> jcr-server-webapp: RMI Registration unstable
> --------------------------------------------
>
>          Key: JCR-291
>          URL: http://issues.apache.org/jira/browse/JCR-291
>      Project: Jackrabbit
>         Type: Improvement
>  Environment: SVN Rev. 355696
>     Reporter: Felix Meschberger
>     Assignee: Felix Meschberger
>     Priority: Minor
>      Fix For: 1.0.1
>  Attachments: RMIRegistry_fm_051211.diff
>
> Registration of the repository to a RMI registry in RepositoryStartupServlet.registerRMI uses web application parameters inconsistently and may not always succeed registering the repository.
> Today, the registerRMI uses these parameters for registration to RMI:
>     rmi-host : The name of the host on which the registry is running
>     rmi-port : The port on which the registry is running
>     rmi-uri : An RMI URI to use for registration
>     repository-name : The name to bind the repository to
> The problem is, that rmi-port is used to try to create the registry to make sure a registry is running on the local host. The rmi-uri is used to register the repository using the static Naming.bind method. If the rmi-uri is not configured, the URI is created from rmi-host, rmi-port and repository-name.
> This may now create a bunch of problems: If the rmi-port and rmi-uri configurations do not match, registration fails, if rmi-host does not resolve to an IP address to which the registry is bound, registration fails.
> I encounter this issue, when trying to register the repository to an RMI registry using default rmi-port configuration (rmi-host and rmi-uri not configured) when running the web app in Jetty.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Reopened: (JCR-291) jcr-server-webapp: RMI Registration unstable

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-291?page=all ]
     
Jukka Zitting reopened JCR-291:
-------------------------------


Reopened to change fix version to 1.0.

> jcr-server-webapp: RMI Registration unstable
> --------------------------------------------
>
>          Key: JCR-291
>          URL: http://issues.apache.org/jira/browse/JCR-291
>      Project: Jackrabbit
>         Type: Improvement
>  Environment: SVN Rev. 355696
>     Reporter: Felix Meschberger
>     Assignee: Felix Meschberger
>     Priority: Minor
>      Fix For: 1.0.1
>  Attachments: RMIRegistry_fm_051211.diff
>
> Registration of the repository to a RMI registry in RepositoryStartupServlet.registerRMI uses web application parameters inconsistently and may not always succeed registering the repository.
> Today, the registerRMI uses these parameters for registration to RMI:
>     rmi-host : The name of the host on which the registry is running
>     rmi-port : The port on which the registry is running
>     rmi-uri : An RMI URI to use for registration
>     repository-name : The name to bind the repository to
> The problem is, that rmi-port is used to try to create the registry to make sure a registry is running on the local host. The rmi-uri is used to register the repository using the static Naming.bind method. If the rmi-uri is not configured, the URI is created from rmi-host, rmi-port and repository-name.
> This may now create a bunch of problems: If the rmi-port and rmi-uri configurations do not match, registration fails, if rmi-host does not resolve to an IP address to which the registry is bound, registration fails.
> I encounter this issue, when trying to register the repository to an RMI registry using default rmi-port configuration (rmi-host and rmi-uri not configured) when running the web app in Jetty.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Aktualisiert: (JCR-291) jcr-server-webapp: RMI Registration unstable

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-291?page=all ]

Felix Meschberger updated JCR-291:
----------------------------------

    Attachment: RMIRegistry_fm_051211.diff

Attaching a patch to RepositoryStartupServlet relative to the contrib/jcr-server/webapp directory.

This patch fixes the issue as follows (also see the added class comment regarding RMI registration):

  - If neither rmi-uri, nor rmi-port, nor rmi-host is configured, RMI registration does not take place (as today)
  - If rmi-uri is configured, rmi-host and rmi-port are ignored. Repository-name is ignored if rmi-uri contains a name

If the host name - either from rmi-uri or rmi-host parameter - is empty or null, the local host is used.
If the port number is negative, zero or higher than 65535, the default port number 1099 is used.

After gathering the information, a Registry instance has to be retrieved. First LocalRegistry.createRegistry is called. If the host name is not empty or null a custom RMIServerSocketFactory is created which is enabled to create server sockets to a specific interface, otherwise the standard RMIServerSocketFactory is used, which simply creates a server socket binding to all interfaces on the local host.

If creating the registry fails - e.g. because host is a remote host or a registry is already active - LocalRegistry.getRegistry is called with the host and port.

Finally the registry retrieved above is used to bind the repository.

If there is no opposition or further enhancement, I will commit the fix sometime next week.

> jcr-server-webapp: RMI Registration unstable
> --------------------------------------------
>
>          Key: JCR-291
>          URL: http://issues.apache.org/jira/browse/JCR-291
>      Project: Jackrabbit
>         Type: Improvement
>  Environment: SVN Rev. 355696
>     Reporter: Felix Meschberger
>     Priority: Minor
>  Attachments: RMIRegistry_fm_051211.diff
>
> Registration of the repository to a RMI registry in RepositoryStartupServlet.registerRMI uses web application parameters inconsistently and may not always succeed registering the repository.
> Today, the registerRMI uses these parameters for registration to RMI:
>     rmi-host : The name of the host on which the registry is running
>     rmi-port : The port on which the registry is running
>     rmi-uri : An RMI URI to use for registration
>     repository-name : The name to bind the repository to
> The problem is, that rmi-port is used to try to create the registry to make sure a registry is running on the local host. The rmi-uri is used to register the repository using the static Naming.bind method. If the rmi-uri is not configured, the URI is created from rmi-host, rmi-port and repository-name.
> This may now create a bunch of problems: If the rmi-port and rmi-uri configurations do not match, registration fails, if rmi-host does not resolve to an IP address to which the registry is bound, registration fails.
> I encounter this issue, when trying to register the repository to an RMI registry using default rmi-port configuration (rmi-host and rmi-uri not configured) when running the web app in Jetty.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


RE: [jira] Erledigt: (JCR-291) jcr-server-webapp: RMI Registration unstable

Posted by Duke Fong <df...@idc-global.com>.
Felix.

Hello.  It is code that is copied form the /contrib/examples.  Here is the
class I am using as the RMI JCR Client.



FSImport
----------------------------------------------


package com.idc.util;

import org.apache.jackrabbit.core.jndi.RegistryHelper;
import sun.net.www.MimeTable;

import javax.jcr.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Calendar;
import java.util.Hashtable;

/**
 * The First Steps example class.
 */
public class FSImport {


    private static org.apache.log4j.Logger logger =
            org.apache.log4j.Logger.getLogger(FSImport.class);

    /**
     * Run the Filesystem Import example.
     *
     * @param args command line arguments
     */
    public static void main(String[] args) {
        try {
            Repository repository = getRepository();
            SimpleCredentials creds = new SimpleCredentials("username",
"password".toCharArray());
            Session session = repository.login(creds);
            Node root = session.getRootNode();

            if (args.length>0) {
                File startingpoint=new File(args[0]);
                importFolder (root.addNode(startingpoint.getName(),
"nt:folder"), startingpoint);
                session.save();
                dump(root.getNode(startingpoint.getName()));
            } else {
                System.err.println("Please specify a starting point for the
file system import into the repository.");
            }


        } catch (Exception e) {
            System.err.println(e);
        }
    }

    /**
     * Creates a Repository instance to be used by the example class.
     *
     * @return repository instance
     * @throws Exception on errors
     */
    private static Repository getRepository() throws Exception {
        String configFile = com.idc.RepositoryConst.configFile;
        String repHomeDir = com.idc.RepositoryConst.repHomeDir;

        Hashtable env = new Hashtable();
        env.put(Context.INITIAL_CONTEXT_FACTORY,
 
"org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory");
        env.put(Context.PROVIDER_URL, "localhost");
        InitialContext ctx = new InitialContext(env);

        RegistryHelper.registerRepository(ctx, "repo", configFile,
repHomeDir, true);
        return (Repository) ctx.lookup("repo");
    }

    /**
     * Imports a File.
     *
     * @param parentnode Parent Repository Node
     * @param file File to be imported
     * @throws RepositoryException on repository errors, IOException on io
errors
     */

    public static void importFile(Node parentnode, File file) throws
RepositoryException, IOException {

        MimeTable mt = MimeTable.getDefaultTable();
        String mimeType = mt.getContentTypeFor(file.getName());
        if (mimeType==null) mimeType="application/octet-stream";
        logger.debug("[FOUND CONTENT TYPE]:" + mimeType);

        Node fileNode = parentnode.addNode(file.getName(), "nt:file");
        Node resNode = fileNode.addNode("jcr:content", "nt:resource");
        resNode.setProperty("jcr:mimeType", mimeType);
        resNode.setProperty("jcr:encoding", "");
        resNode.setProperty("jcr:data", new FileInputStream(file));
        Calendar lastModified = Calendar.getInstance();
        lastModified.setTimeInMillis(file.lastModified());
        resNode.setProperty("jcr:lastModified", lastModified);
        logger.debug("[IMPORTING]: "+fileNode.getPath());
   }


    /**
     * Import a Folder.
     *
     * @param parentnode Parent Repository Node
     * @param directory Directory to be traversed
     * @throws RepositoryException on repository errors, IOException on io
errors
     */

    private static void importFolder(Node parentnode, File directory) throws
RepositoryException, IOException  {
        File[] direntries = directory.listFiles();
        System.out.println(parentnode.getPath());
        for (int i=0; i<direntries.length; i++) {
            File direntry = direntries[i];
            if (direntry.isDirectory()) {
                Node childnode =
parentnode.addNode(direntry.getName(),"nt:folder");
                importFolder(childnode, direntry);
            } else {
                importFile(parentnode, direntry);
            }
        }
    }

    /**
     * Dumps the contents of the given node to standard output.
     *
     * @param node the node to be dumped
     * @throws RepositoryException on repository errors
     */
    public static void dump(Node node) throws RepositoryException {
        System.out.println(node.getPath());

        PropertyIterator properties = node.getProperties();
        while (properties.hasNext()) {
            Property property = properties.nextProperty();
            System.out.print(property.getPath() + "=");
            if (property.getDefinition().isMultiple()) {
                Value[] values = property.getValues();
                for (int i = 0; i < values.length; i++) {
                    if (i > 0) {
                        System.out.println(",");
                    }
                    System.out.println(values[i].getString());
                }
            } else {
                if (property.getType()==PropertyType.BINARY) {
                    System.out.print("<binary>");
                }  else {
                    System.out.print(property.getString());
                }

            }
            System.out.println();
        }

        NodeIterator nodes = node.getNodes();
        while (nodes.hasNext()) {
            Node child = nodes.nextNode();
            dump(child);
        }
    }
}
---------------------------------------------- 


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 11:34 PM
To: jackrabbit-dev@incubator.apache.org
Subject: Re: [jira] Erledigt: (JCR-291) jcr-server-webapp: RMI Registration
unstable

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()).shutdo
>> w
>> 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.jav
> a:127)
>   
>> 	at
>>
>>     
> org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.jav
> a: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(DelegatingMethodAcces
>> s
>> 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.jav
> a: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(ObjectOutputSt
>> r
>> eam.ja
>> va:1676)
>> 	at
>> java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(Obj
>> e
>> 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.jav
> a:123)
>   
>> 	at
>>
>>     
> org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.jav
> a: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(DelegatingMethodAcces
>> s
>> 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(ObjectOutputSt
>> r
>> eam.ja
>> va:1676)
>> 	at
>> java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(Obj
>> e
>> 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
>>
>>   
>>     
>
>   


Re: [jira] Erledigt: (JCR-291) jcr-server-webapp: RMI Registration unstable

Posted by Felix Meschberger <Fe...@day.com>.
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
>>
>>   
>>     
>
>   


RE: [jira] Erledigt: (JCR-291) jcr-server-webapp: RMI Registration unstable

Posted by Duke Fong <df...@idc-global.com>.
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
>
>   


Re: [jira] Erledigt: (JCR-291) jcr-server-webapp: RMI Registration unstable

Posted by Felix Meschberger <Fe...@day.com>.
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()).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
> 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
>
>   


RE: [jira] Erledigt: (JCR-291) jcr-server-webapp: RMI Registration unstable

Posted by Duke Fong <df...@idc-global.com>.
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
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


Re: [jira] Erledigt: (JCR-291) jcr-server-webapp: RMI Registration unstable

Posted by Felix Meschberger <Fe...@day.com>.
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


RE: [jira] Erledigt: (JCR-291) jcr-server-webapp: RMI Registration unstable

Posted by Duke Fong <df...@idc-global.com>.
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.

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.

Regards,
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 (JIRA) [mailto:jira@apache.org] 
Sent: Monday, December 12, 2005 4:20 AM
To: jackrabbit-dev@incubator.apache.org
Subject: [jira] Erledigt: (JCR-291) jcr-server-webapp: RMI Registration
unstable

     [ http://issues.apache.org/jira/browse/JCR-291?page=all ]
     
Felix Meschberger resolved JCR-291:
-----------------------------------

    Fix Version: 1.0.1
     Resolution: Fixed

Commited proposed patch.

Fixed in Rev. 356251

> jcr-server-webapp: RMI Registration unstable
> --------------------------------------------
>
>          Key: JCR-291
>          URL: http://issues.apache.org/jira/browse/JCR-291
>      Project: Jackrabbit
>         Type: Improvement
>  Environment: SVN Rev. 355696
>     Reporter: Felix Meschberger
>     Assignee: Felix Meschberger
>     Priority: Minor
>      Fix For: 1.0.1
>  Attachments: RMIRegistry_fm_051211.diff
>
> Registration of the repository to a RMI registry in
RepositoryStartupServlet.registerRMI uses web application parameters
inconsistently and may not always succeed registering the repository.
> Today, the registerRMI uses these parameters for registration to RMI:
>     rmi-host : The name of the host on which the registry is running
>     rmi-port : The port on which the registry is running
>     rmi-uri : An RMI URI to use for registration
>     repository-name : The name to bind the repository to The problem 
> is, that rmi-port is used to try to create the registry to make sure a
registry is running on the local host. The rmi-uri is used to register the
repository using the static Naming.bind method. If the rmi-uri is not
configured, the URI is created from rmi-host, rmi-port and repository-name.
> This may now create a bunch of problems: If the rmi-port and rmi-uri
configurations do not match, registration fails, if rmi-host does not
resolve to an IP address to which the registry is bound, registration fails.
> I encounter this issue, when trying to register the repository to an RMI
registry using default rmi-port configuration (rmi-host and rmi-uri not
configured) when running the web app in Jetty.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Erledigt: (JCR-291) jcr-server-webapp: RMI Registration unstable

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-291?page=all ]
     
Felix Meschberger resolved JCR-291:
-----------------------------------

    Fix Version: 1.0.1
     Resolution: Fixed

Commited proposed patch.

Fixed in Rev. 356251

> jcr-server-webapp: RMI Registration unstable
> --------------------------------------------
>
>          Key: JCR-291
>          URL: http://issues.apache.org/jira/browse/JCR-291
>      Project: Jackrabbit
>         Type: Improvement
>  Environment: SVN Rev. 355696
>     Reporter: Felix Meschberger
>     Assignee: Felix Meschberger
>     Priority: Minor
>      Fix For: 1.0.1
>  Attachments: RMIRegistry_fm_051211.diff
>
> Registration of the repository to a RMI registry in RepositoryStartupServlet.registerRMI uses web application parameters inconsistently and may not always succeed registering the repository.
> Today, the registerRMI uses these parameters for registration to RMI:
>     rmi-host : The name of the host on which the registry is running
>     rmi-port : The port on which the registry is running
>     rmi-uri : An RMI URI to use for registration
>     repository-name : The name to bind the repository to
> The problem is, that rmi-port is used to try to create the registry to make sure a registry is running on the local host. The rmi-uri is used to register the repository using the static Naming.bind method. If the rmi-uri is not configured, the URI is created from rmi-host, rmi-port and repository-name.
> This may now create a bunch of problems: If the rmi-port and rmi-uri configurations do not match, registration fails, if rmi-host does not resolve to an IP address to which the registry is bound, registration fails.
> I encounter this issue, when trying to register the repository to an RMI registry using default rmi-port configuration (rmi-host and rmi-uri not configured) when running the web app in Jetty.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-291) jcr-server-webapp: RMI Registration unstable

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-291?page=comments#action_12360196 ] 

Tobias Bocanegra commented on JCR-291:
--------------------------------------

looks good. thanks.

> jcr-server-webapp: RMI Registration unstable
> --------------------------------------------
>
>          Key: JCR-291
>          URL: http://issues.apache.org/jira/browse/JCR-291
>      Project: Jackrabbit
>         Type: Improvement
>  Environment: SVN Rev. 355696
>     Reporter: Felix Meschberger
>     Priority: Minor
>  Attachments: RMIRegistry_fm_051211.diff
>
> Registration of the repository to a RMI registry in RepositoryStartupServlet.registerRMI uses web application parameters inconsistently and may not always succeed registering the repository.
> Today, the registerRMI uses these parameters for registration to RMI:
>     rmi-host : The name of the host on which the registry is running
>     rmi-port : The port on which the registry is running
>     rmi-uri : An RMI URI to use for registration
>     repository-name : The name to bind the repository to
> The problem is, that rmi-port is used to try to create the registry to make sure a registry is running on the local host. The rmi-uri is used to register the repository using the static Naming.bind method. If the rmi-uri is not configured, the URI is created from rmi-host, rmi-port and repository-name.
> This may now create a bunch of problems: If the rmi-port and rmi-uri configurations do not match, registration fails, if rmi-host does not resolve to an IP address to which the registry is bound, registration fails.
> I encounter this issue, when trying to register the repository to an RMI registry using default rmi-port configuration (rmi-host and rmi-uri not configured) when running the web app in Jetty.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira