cancel
Showing results for 
Search instead for 
Did you mean: 

AuthenticationUtils.startSession no longer working under 4.2d?

hheckel
Champ in-the-making
Champ in-the-making
Hello,

Trying to authenticate using AuthenticationUtils.startSession no longer works for me using Alfresco 4.2d CE, while it works like a charm for 4.2c

Code:

    WebServiceFactory.setEndpointAddress("http://some-server-ip-address:8080/alfresco/api);
    AuthenticationUtils.startSession("myusername","mypassword");



Stacktrace:

org.alfresco.webservice.util.WebServiceException: Error starting session.
   at org.alfresco.webservice.util.AuthenticationUtils.startSession(AuthenticationUtils.java:88)
   at com.domain.myapp.alfresco.AlfrescoConnector.connect(AlfrescoConnector.java:173)
   at com.domain.myapp.alfresco.AlfrescoConnectorTest.main(AlfrescoConnectorTest.java:14)
Caused by: (401)Unauthorized
   at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
   at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
   at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
   at org.apache.axis.client.Call.invoke(Call.java:2767)
   at org.apache.axis.client.Call.invoke(Call.java:2443)
   at org.apache.axis.client.Call.invoke(Call.java:2366)
   at org.apache.axis.client.Call.invoke(Call.java:1812)
   at org.alfresco.webservice.authentication.AuthenticationServiceSoapBindingStub.startSession(AuthenticationServiceSoapBindingStub.java:187)
   at org.alfresco.webservice.util.AuthenticationUtils.startSession(AuthenticationUtils.java:73)
   … 2 more


Any ideas?
4 REPLIES 4

kaynezhang
World-Class Innovator
World-Class Innovator
I installed alfresco from latest version of the source code ,I didn't get this problem.
If it is a bug,it may be already fixed in the latest version 4.2.e which can be downloaded from http://dev.alfresco.com/downloads/nightly/dist/.

FYI, after much reinstalling and testing I have found: (on windows 64bit)  

4.2.c  works fine.
4.2.d  I get JSON when going to /alfresco/api on chrome, but a 404 error when using AuthenticationUtils.startSession()  (That makes no sense to me)
4.2.e  neither works.  I just hang on chrome, and the same 404 error with AuthenticationUtils.startSession() 

I really don't want to revert all the way back to 4.2.c,  but it looks like I will have to.  Smiley Sad

cszamudio
Champ on-the-rise
Champ on-the-rise
Hi,

I'm seeing exactly the same problem when I've tried to upgrade from 4.2c to 4.2e (community). I wonder if you've discovered the source of the issue.  At first I thought the problem was based on privileges, but I've confirmed that the server is accessible from multiple points.  I even tried the latest 4.3a release, but still the same issue, when using WebServiceFactory.  It must be some configuration issue, but walking through the code doesn't reveal the source of the problem.

Carlos S. Zamudio

OK, yes, the endpoint address has been modified (WebServerFactory.java) to:

(line 67) private static final String DEFAULT_ENDPOINT_ADDRESS = "http://localhost:8080/alfresco/soapapi";

Nonetheless, migrating all my services to CMIS is the best approach long term.