Я пытаюсь получить доступ к веб-службе, которая взаимодействует с Alfresco через CMIS. Я открываю эту ссылку: http://localhost:8080/Changes/ChangesPDF?filePath=/Documentos/examplepdf.pdf&ticket=TICKET_1dd4951f5d97c72232db40bdc8dceeb7be70aaed
Когда я запускаю Alfresco, я могу получить доступ к веб-сервису без проблем, но когда я закрываю Alfresco, он дает мне несанкционированный вход в веб-сервис, и даже если я вошел в систему, он продолжает давать мне несанкционированный доступ.
Код для получения сессии:
public Session getSession(
String connectionName, String token) {
Session session = connections.get(connectionName);
if (session == null) {
logger.info("Not connected, creating new connection to" +
" Alfresco with the connection id (" + connectionName +
")");
// No connection to Alfresco available, create a new one
SessionFactory sessionFactory =
SessionFactoryImpl.newInstance();
Map<String, String> parameters = new HashMap<>();
parameters.put(SessionParameter.USER, "");
parameters.put(SessionParameter.PASSWORD, token);
parameters.put(SessionParameter.ATOMPUB_URL,
"http://localhost:8080/alfresco/api/-default-/cmis/versions/1.1/atom");
parameters.put(SessionParameter.BINDING_TYPE,
BindingType.ATOMPUB.value());
parameters.put(SessionParameter.COMPRESSION, "true");
parameters.put(SessionParameter.CACHE_TTL_OBJECTS, "0");
// If there is only one repository exposed (e.g. Alfresco),
// these lines will help detect it and its ID
List<Repository> repositories =
sessionFactory.getRepositories(parameters);
Repository alfrescoRepository = null;
if (repositories != null && repositories.size() > 0) {
logger.info("Found (" + repositories.size() +
") Alfresco repositories");
alfrescoRepository = repositories.get(0);
logger.info("Info about the first Alfresco repo [ID=" +
alfrescoRepository.getId() + "][name=" +
alfrescoRepository.getName() + "][CMIS ver supported=" +
alfrescoRepository.getCmisVersionSupported() + "]");
} else {
throw new CmisConnectionException(
"Could not connect to the Alfresco Server, " +
"no repository found!");
}
// Create a new session with the Alfresco repository
session = alfrescoRepository.createSession();
// Save connection for reuse
connections.put(connectionName, session);
} else {
logger.info("Already connected to Alfresco with the " +
"connection id (" + connectionName + ")");
}
return session;
}
Ошибка ниже:
Ошибка обработки запроса; вложенным исключением является org.apache.chemistry.opencmis.commons.exceptions .CmisUnauthorizedException: Unauthorized
И введите сюда:
"Already connected to Alfresco with the " +
"connection id (" + connectionName + ")"7
Как закрыть старое соединение с Alfresco?
Exception: CmisUnauthorizedException Unauthorized The provide credentials are invalid. Check your credentials.
, но мои учетные данные верны. Я не знаю, если это предположение, что я должен сделать на рабочем месте CMIS. @TahirMalik - person PRVS   schedule 25.02.2016http://localhost:8080/alfresco/api/-default-/cmis/versions/1.1/atom
я могу установить связь. - person PRVS   schedule 25.02.2016Exception: CmisConnectionException Cannot access WSDL: http://localhost:8080/Changes/ChangesPDF?filePath=/Teste/latexexemplo.pdf&ticket=TICKET_9df294d47c4613812cd0d80202be909d6ea4ae39 Check the URL, the binding, and the credentials.
- person PRVS   schedule 25.02.2016