cancel
Showing results for 
Search instead for 
Did you mean: 

problem in connecting Public Alfresco CMIS Server

raghu
Champ in-the-making
Champ in-the-making
Hi I'm new to Alfresco, I'm trying to connect to alfresco public server via my java code.Here is the code

 Map<String, String> parameter = new HashMap<String, String>();
       parameter.put(SessionParameter.USER, "admin");
       parameter.put(SessionParameter.PASSWORD,"admin");
      
       //specify connection settings
       parameter.put(SessionParameter.ATOMPUB_URL, "http://cmis.alfresco.com/");
        parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
       
        //set alfresco object factory
        parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
       
       
        //create a session
        SessionFactory factory = SessionFactoryImpl.newInstance();
           List<Repository> repositories = factory.getRepositories(parameter);
           for(Repository r: repositories) {
               System.out.println("Id: " + r.getId());
               System.out.println("Name: " + r.getName());
               System.out.println("Description: " + r.getDescription());
           }
           System.out.println();
           Session session = repositories.get(0).createSession();


But I'm getting the following exception

Exception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Cannot access http://cmis.alfresco.com/: Connection refused: connect

Can someone tell me what is the mistake I'm doing??

Regards,
Raghu
6 REPLIES 6

bisana
Champ on-the-rise
Champ on-the-rise
From the server did you redirect the ports

raghu
Champ in-the-making
Champ in-the-making
From the server did you redirect the ports

Hi bisana ,

        I'm not using any web server it's a standalone code..

bisana
Champ on-the-rise
Champ on-the-rise
Hi  raghu
You need to setup in the server the firewall rules to forward requests on TCP ports 139/445 to TCP 1139/1445 and UDP ports 137/138 to UDP 1137/1138.
I have setup a CIFS server, and I am using windows XP using network neighborhood I am able to access the folder, I am not using web interface to access it
from the url http://wiki.alfresco.com/wiki/File_Server_Configuration
echo 1 > /proc/sys/net/ipv4/ip_forward
modprobe iptable_nat
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -A PREROUTING -p tcp –dport 445 -j REDIRECT –to-ports 1445
iptables -t nat -A PREROUTING -p tcp –dport 139 -j REDIRECT –to-ports 1139
iptables -t nat -A PREROUTING -p udp –dport 137 -j REDIRECT –to-ports 1137
iptables -t nat -A PREROUTING -p udp –dport 138 -j REDIRECT –to-ports 1138

raghu
Champ in-the-making
Champ in-the-making
Hi bisana,

      Thanks for info, I'll check firewall rules.

Regards,
Raghu

n3k
Champ in-the-making
Champ in-the-making
Any news? I have exactly the sane problem.

gravitonian
Star Collaborator
Star Collaborator
Hi,

The URL to use is http://cmis.alfresco.com/cmisatom.

For example, here is how to check which CMIS version that is supported:


martin@gravitonian:~$ curl -u admin:admin http://cmis.alfresco.com/cmisatom | xmlstarlet sel -T -t -m '//cmis:cmisVersionSupported' -c . -n
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 28557    0 28557    0     0   311k      0 –:–:– –:–:– –:–:–  313k
1.0

Also, looks like you are mixing CMIS and CIFS, two different things….
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.