AnsweredAssumed Answered

How to deal with ServiceRegistry

Question asked by robobot on Dec 14, 2009
Latest reply on Dec 16, 2009 by robobot
Hello,
i can't help myself. I dont have any glue how i can use the alfresco services. also i could not get a hint from similar topics :-(
when i try to run simple example i get the followig error:

package org.alfresco.sample.jcr;
import org.alfresco.service.ServiceRegistry;
public class SimpleExample
{

    public static void main(String[] args) throws Exception
    {
        ServiceRegistry registry = (ServiceRegistry )java.rmi.Naming.lookup("ServiceRegistry");
    }
   
}

Exception in thread "main" java.rmi.ConnectException: Connection refused to host: 192.168.20.103; nested exception is: 
   java.net.ConnectException: Connection refused: connect
   at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
   at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
   at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
   at sun.rmi.server.UnicastRef.newCall(Unknown Source)
   at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
   at java.rmi.Naming.lookup(Unknown Source)
   at org.alfresco.sample.jcr.SimpleExample.main(SimpleExample.java:23)
Caused by: java.net.ConnectException: Connection refused: connect
   at java.net.PlainSocketImpl.socketConnect(Native Method)
   at java.net.PlainSocketImpl.doConnect(Unknown Source)
   at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
   at java.net.PlainSocketImpl.connect(Unknown Source)
   at java.net.SocksSocketImpl.connect(Unknown Source)
   at java.net.Socket.connect(Unknown Source)
   at java.net.Socket.connect(Unknown Source)
   at java.net.Socket.<init>(Unknown Source)
   at java.net.Socket.<init>(Unknown Source)
   at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
   at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
   … 7 more

is there a step by step guide available ? i rember that i spent a lots of time in the past to get the spring services work :-/

please help, santa claus will thank you.
regards.

Outcomes