cancel
Showing results for 
Search instead for 
Did you mean: 

Forbidden

bakpatel
Champ in-the-making
Champ in-the-making
Hi,
I am calling local CMIS service at http://192.168.1.195:8080/alfresco/service/cmis/index.html
I am trying to call this as admin. In fact, I am running "Getting Started" example from OpenCMIS.

But I am getting following error, Any idea?
xception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException: Forbidden
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:430)
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:554)
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getObjectInternal(AbstractAtomPubService.java:778)
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getObject(ObjectServiceImpl.java:510)
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:393)
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:367)
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getRootFolder(SessionImpl.java:472)
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getRootFolder(SessionImpl.java:466)
   at org.apache.chemistry.opencmis.doc.GettingStarted.main(GettingStarted.java:128)

Thanks,
Bakul
5 REPLIES 5

jpotts
World-Class Innovator
World-Class Innovator
Please post your code. Otherwise, we can only guess based on your error message, which seems to indicate you are using the wrong username and password.

Also, if you are running this against Alfresco 4, please change your URL from:
http://192.168.1.195:8080/alfresco/service/cmis

to:
http://192.168.1.195:8080/alfresco/cmisatom

Jeff

bakpatel
Champ in-the-making
Champ in-the-making
Hi,
Here is the code that's executing:

SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
Map<String, String> parameter = new HashMap<String, String>();
parameter.put(SessionParameter.USER, "admin");
parameter.put(SessionParameter.PASSWORD, "admin");
parameter.put(SessionParameter.ATOMPUB_URL, "http://192.168.1.195:8080/alfresco/cmisatom/");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
List<Repository> repositories = new ArrayList<Repository>();
repositories = sessionFactory.getRepositories(parameter);
Repository repository = repositories.get(0);
parameter.put(SessionParameter.REPOSITORY_ID, repository.getId());
Session session = sessionFactory.createSession(parameter);
Folder root = session.getRootFolder();

The last line is giving problem.

One more thing I would like to add is, when I click on following URL, it gives 403 error.
I think this issue and the issue above have same root cause:

http://192.168.1.195:8080/alfresco/service/cmis/index.html

Thanks,
Bakul

jpotts
World-Class Innovator
World-Class Innovator
This code runs fine as-is against Alfresco 4.0.d Community with Alfresco WAR-only running in a Tomcat container.

Are you able to log in to Alfresco using admin/admin? I suspect a problem with your install and/or app server config.

Jeff

bakpatel
Champ in-the-making
Champ in-the-making
Hi Jeff,
Thanks for the reply, and yes, I think you right.
It seems to be some issue with Alfresco configuration.
I am able to login as admin/admin.

I am very new to Alfresco, and don't know how to set it up.

Thanks,
Bakul

bakpatel
Champ in-the-making
Champ in-the-making
Hi Jeff,
I reinstalled the server, and all worked fine.
Not sure what went wrong last time..

Thanks,
Bakul