15:52:42,031 WARN [EngineConfigurationFactoryFinder] Factory org.apache.axis.configuration.EngineConfigurationFactoryServlet Ignored: missing required method: public static EngineConfigurationFactory newFactory(Object).
15:52:42,031 WARN [EngineConfigurationFactoryFinder] Factory org.apache.axis.configuration.EngineConfigurationFactoryDefault Ignored: missing required method: public static EngineConfigurationFactory newFactory(Object).
15:52:43,515 INFO [STDOUT] Error starting session.
Caused by: org.alfresco.webservice.util.WebServiceException: Error starting session.
at org.alfresco.webservice.util.AuthenticationUtils.startSession(AuthenticationUtils.java:94)
Caused by: java.lang.ClassCastException: org.apache.axis.attachments.AttachmentsImpl
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.client.Call.invoke(Call.java:1828)
at org.alfresco.webservice.authentication.AuthenticationServiceSoapBindingStub.startSession(AuthenticationServiceSoapBindingStub.java:187)
at org.alfresco.webservice.util.AuthenticationUtils.startSession(AuthenticationUtils.java:79)
… 45 more
Caused by: java.lang.ClassCastException: org.apache.axis.attachments.AttachmentsImpl
at org.apache.axis.Message.setup(Message.java:352)
at org.apache.axis.Message.<init>(Message.java:246)
at org.apache.axis.client.Call.invoke(Call.java:2425)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
package org.consulteRepository;
import java.io.IOException;
import java.io.InputStream;
import java.rmi.RemoteException;
import java.util.LinkedList;
import java.util.List;
import org.alfresco.webservice.authentication.AuthenticationFault;
import org.alfresco.webservice.content.Content;
import org.alfresco.webservice.content.ContentServiceSoapBindingStub;
import org.alfresco.webservice.repository.QueryResult;
import org.alfresco.webservice.repository.RepositoryFault;
import org.alfresco.webservice.repository.RepositoryServiceSoapBindingStub;
import org.alfresco.webservice.types.Predicate;
import org.alfresco.webservice.types.Reference;
import org.alfresco.webservice.types.ResultSet;
import org.alfresco.webservice.types.ResultSetRow;
import org.alfresco.webservice.types.ResultSetRowNode;
import org.alfresco.webservice.types.Store;
import org.alfresco.webservice.util.Constants;
import org.alfresco.webservice.util.ContentUtils;
import org.alfresco.webservice.util.WebServiceFactory;
import org.apache.axis.AxisFault;
public class FilesExtractor
{
InputStream[] files;
public FilesExtractor()
{
}
public void setFiles(InputStream[] files)
{
this.files = files;
}
public InputStream[] getFiles()
{
return files;
}
public void extractFiles() throws AuthenticationFault, RemoteException
{
WebServiceFactory.setEndpointAddress("http://localhost:8080/alfresco/service");
//WebServiceFactory.setEndpointAddress("http://localhost:8080/alfresco/API");
WebServiceFactory.getAuthenticationService().startSession("admin", "admin");
//AuthenticationUtils.startSession("admin", "admin");
//AuthenticationUtils.getTicket();
Store storeRef = new Store(Constants.WORKSPACE_STORE, "SpacesStore");
Reference reference = new Reference(storeRef,null,"/app:company_home/cm:Ardia");
RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
QueryResult qr;
qr = repositoryService.queryChildren(reference);
ResultSet rs = qr.getResultSet();
ResultSetRow[] rows = rs.getRows();
List<Reference> r= new LinkedList<Reference>();
for (ResultSetRow row:rows)
{
ResultSetRowNode node = row.getNode();
r.add(new Reference(storeRef,(String)node.getId(),"/app:company_home/cm:Ardia/"));
}
Reference[] ref = new Reference[r.size()];
r.toArray(ref);
Predicate p = new Predicate(ref, storeRef, null);
ContentServiceSoapBindingStub contentService = WebServiceFactory.getContentService();
Content[] readResult = contentService.read(p, Constants.PROP_CONTENT);
files = new InputStream[readResult.length];
for (int i = 0; i<ref.length; i++)
{
files[i] = ContentUtils.getContentAsInputStream(readResult[i]);
}
setFiles(files);
}
}
Caused by: org.alfresco.webservice.util.WebServiceException: Error starting session.
je me dis : "tiens, il doit y avoir un problème avec l'authentification".WebServiceFactory.getAuthenticationService().startSession("admin", "admin");
plutôt que le traditionnel (et commenté) :AuthenticationUtils.startSession("admin", "admin");
// Start the session
AuthenticationResult result = WebServiceFactory.getAuthenticationService().startSession(username, password);
// Store the ticket for use later
authenticationDetails.set(new AuthenticationDetails(result.getUsername(), result.getTicket(), result.getSessionid()));
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.