cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected logout after a few clicks (Alfresco 2.0 Preview)

mruflin
Champ in-the-making
Champ in-the-making
I tried to install the Alfresco 2.0 Preview (zip version as well as bundled windows installer), but face a rather strange problem:

After clicking through a couple of pages (1 .. 4), I get directly redirected to the login page. Trying to relogin with admin:admin, I get a "Unable to login - unknown username/password." message.

Then, if I try to go back to the main url (http://localhost:8080/alfresco/), I get following exception:

net.sf.acegisecurity.AuthenticationCredentialsNotFoundException: A valid SecureContext was not provided in the RequestContext
at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.credentialsNotFound(AbstractSecurityInterceptor.java:477)
at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:355)
at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:77)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:41)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:211)
at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:157)
at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:61)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
at $Proxy14.getProperty(Unknown Source)
at org.alfresco.web.bean.repository.Preferences.getValue(Preferences.java:67)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:84)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:390)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:619)

I'm using the Jan 19. release, in the zip archive version with MySQL, in the  installer version HSQL.

I'm wondering if somebody else experienced this problem or could give me some hints how to fix it.

Thanks a lot,

Michael

Update: Similar behaviour with the linux alfresco 2.0 preview installer on a different machine, but far less often.
21 REPLIES 21

may
Champ in-the-making
Champ in-the-making
I've the same problem … did you solve it? my error code is:


ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/alfresco].[jsp]] Servlet.service() for servlet jsp threw exception
net.sf.acegisecurity.AuthenticationCredentialsNotFoundException: A valid SecureContext was not provided in the RequestContext
        at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.credentialsNotFound(AbstractSecurityInterceptor.java:477)
        at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:355)
        at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:77)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:41)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:211)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:157)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:61)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
        at $Proxy14.getProperty(Unknown Source)
        at org.alfresco.web.bean.repository.Preferences.getValue(Preferences.java:67)
        at org.apache.jsp.index_jsp._jspService(index_jsp.java:73)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)

mruflin
Champ in-the-making
Champ in-the-making
I also installed Alfresco 2.0 Preview on another computer, getting the exact same behaviour.

Easiest way to reproduce: Log in as admin:admin, go the to adminstration console and click there around a bit.

I also compiled Alfresco directly from the trunk - getting the same problems.

I'd happily help to track down this issue, but would need some guidance regarding where to look around…

anreasg
Champ in-the-making
Champ in-the-making
going back to :http://localhost:8080/alfresco/ i get:

java.lang.NullPointerException

Hide Details

java.lang.NullPointerException
at org.springframework.web.jsf.FacesContextUtils.getWebApplicationContext(FacesContextUtils.java:47)
at org.springframework.web.jsf.FacesContextUtils.getRequiredWebApplicationContext(FacesContextUtils.java:77)
at org.alfresco.web.bean.repository.Repository.getConfigurableService(Repository.java:433)
at org.alfresco.web.bean.repository.User.getUserPreferencesRef(User.java:176)
at org.alfresco.web.bean.repository.User.getPreferences(User.java:160)
at org.alfresco.web.bean.repository.PreferencesService.getPreferences(PreferencesService.java:61)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:73)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Return to application

sirclueless
Champ in-the-making
Champ in-the-making
I had the same problem. I installed alfresco in german language and if I tried to login with english language, I get the same problem.
I haven`t a solution for this problem, but if I log in with german language (the language I installed alfresco) I haven`t the problem and alfresco works without problems. Maybe that information can help you.?!?!

mruflin
Champ in-the-making
Champ in-the-making
Thanks for the hint! It worked - but only if I don't log in with "English" as language at all!

After a complete reinstallation, I first logged in with English and admin:admin, getting the same behaviour as always. Logging in with German as language afterwards didn't fix the problem.

After restarting Tomcat and logging in directly with German, it worked correctly.

For the alfresco developers: Before getting the system to work that way, I also tried the current sources (rev. 453) with English as language. I got the same problem as with the preview installer.

kevinr
Star Contributor
Star Contributor
Hi,

Thanks for spotting and investigating this. I have reproduced the issue this morning and i'm developing a fix now.
http://issues.alfresco.com/browse/AWC-1113

Thanks,

Kevin

kevinr
Star Contributor
Star Contributor
I have finished the fix, if you apply the following diff to your alfresco/index.jsp file it should solve the problem:

Index: projects/web-client/source/web/index.jsp
===================================================================
— projects/web-client/source/web/index.jsp    (revision 4992)
+++ projects/web-client/source/web/index.jsp    (working copy)
@@ -15,10 +15,12 @@
License.
–%>

+<%@ page import="javax.faces.context.FacesContext" %>
<%@ page import="org.springframework.web.context.support.WebApplicationContextUtils" %>
<%@ page import="org.alfresco.service.cmr.security.PermissionService" %>
<%@ page import="org.alfresco.config.ConfigService" %>
<%@ page import="org.alfresco.web.app.servlet.AuthenticationHelper" %>
+<%@ page import="org.alfresco.web.app.servlet.FacesHelper" %>
<%@ page import="org.alfresco.web.bean.NavigationBean" %>
<%@ page import="org.alfresco.web.bean.repository.User" %>
<%@ page import="org.alfresco.web.bean.repository.PreferencesService" %>
@@ -35,7 +37,9 @@
User user = (User)session.getAttribute(AuthenticationHelper.AUTHENTICATION_USER);
if (user != null && (user.getUserName().equals(PermissionService.GUEST_AUTHORITY) == false))
{
-   String preference = (String)PreferencesService.getPreferences(user).getValue("start-location");
+   // ensure construction of the FacesContext before attemping a service call
+   FacesContext fc = FacesHelper.getFacesContext(request, response, application);
+   String preference = (String)PreferencesService.getPreferences(fc).getValue("start-location");
    if (preference != null)
    {
       location = preference;

You will need to stop the server, delete the temporary files in \tomcat\work (to remove the existing compiled index.jsp file) and restart Alfresco.

Please let us know if this fixes the issue.

Thanks,

Kevin

mruflin
Champ in-the-making
Champ in-the-making
Hi Kevin,

I applied the diff onto the current trunk (revision 459), but the problem still exists.

The real problem must exist somewhere else - or is index.jsp also called when changing from one page to another within the webapplication? (e.g. when switching from Company Home to Preferences)?

Greetings,

Michael

kevinr
Star Contributor
Star Contributor
That's very strange - we have been unable to reproduce the issue any other way. The issues only occurs if the entry point is /alfresco (which effectively starts at index.jsp).

If you look at the error stack you posted it contains this line:
at org.apache.jsp.index_jsp._jspService(index_jsp.java:84)

Which suggest that is where the problem is on your system also. If you say it still occurs with the patch then I'm not sure how it can be happening if you end up with the same error stack…?

Thanks,

Kevin