cancel
Showing results for 
Search instead for 
Did you mean: 

irregular error with RepositoryService

tim-erwin
Champ in-the-making
Champ in-the-making
Hi,

I have Alfresco (2.9, but was the same with 2.1) instances running on tomcats on 4 machines as well as 1 virtual machine (xen). Operating systems are Windows XP and debian linux. My application is also running in the tomcats and connects to Alfresco. So I make connections from machine A to B, B to A, A to A, … a lot possibilities. Believe it or not: the following error depends on the connection.

java.lang.NullPointerException
   org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
   org.apache.axis.client.AxisClient.invoke(AxisClient.java:216)
   org.apache.axis.client.Call.invokeEngine(Call.java:2784)
   org.apache.axis.client.Call.invoke(Call.java:2767)
   org.apache.axis.client.Call.invoke(Call.java:2443)
   org.apache.axis.client.Call.invoke(Call.java:2366)
   org.apache.axis.client.Call.invoke(Call.java:1812)
   org.alfresco.webservice.repository.RepositoryServiceSoapBindingStub.get(RepositoryServiceSoapBindingStub.java:1078)
   de.mycompany.RepositoryBrowser.listDirectory(RepositoryBrowser.java:37)
   de.mycompany.webclient.List.doGet(List.java:50)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
The last line within my application's realm is:
Node[] selfs = null;
selfs = repositoryService.get(new Predicate(refs, Filesystem.STORE, null));
refs contains 1 valid (!) reference, Filesystem.STORE the standard store. Just performing that call over and over again by browsing through the repository, not changing the latter.

On my personal computer (WinXP) connecting to any machine e.g. that error occurs if I don't send any request to Alfresco for 20 secs. However, after the error occurred there may be a big time span until the next request which than works fine again without re-login or similar (until I wait 20 secs again…). For other connections no error occurs at all. For others every now and then. It seems it works better if the two applications don't reside on one physical machine.

Any hints on what I could have done wrong, how to search/get more precise information is much appreciated.

Regards,
Tim


—-

Another interesting scenario: Alfresco on machine X, my application on the virtual machine on X -> every other request gives that error, 100% regular. Klick, error, refresh, works, refresh/klick, error, refresh, works…
1 REPLY 1

tim-erwin
Champ in-the-making
Champ in-the-making
Oooooookeyyyy,

got it. After months…

As my setup is x users (with x sessions) connect to 1 application which connects (with 1 session) to alfresco, I couldn't use the standard way of session handling as in AuthenticationUtils. I really wonder how a ThreadLocal variable for authenticationDetails can help at all. Since it is stored "in a thread" of a pool of which the threads are assigned to users rather randomly it's not for sure the respective user is getting it back, is it?

Anyways, we don't have the authenticationDetails available which causes the CookieHandler to fail. Thus, I just removed it from the WS_SECURITY_INFO. Now, everything works fine. Is that an issue regarding session management? Or is it really just one session I have between my application an alfresco?

I thought such a setup (server talks to server) is a rather common setup. However, it seems the API is not really prepared for that.

Regards,
Tim