cancel
Showing results for 
Search instead for 
Did you mean: 

FileFolderService resolveNamePath strange Exception

konda
Champ in-the-making
Champ in-the-making
Hi all,

I have a really strange trouble in a Web Script using the FileFolderService object. In particular I have a strange stack trace

<blockcode>The Web Script /alfresco/service/androidservices/downloadOfferte has responded with a status of 500 - Internal Error.

500 Description:   An error inside the HTTP server which prevented it from fulfilling the request.

Message:   No authentication provider for net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken
   
Exception:   net.sf.acegisecurity.providers.ProviderNotFoundException - No authentication provider for net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken
   
   net.sf.acegisecurity.providers.ProviderManager.doAuthentication(ProviderManager.java:169)
   net.sf.acegisecurity.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:49)
   net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:376)
   net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:77)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:147)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   org.alfresco.repo.model.filefolder.FilenameFilteringInterceptor.invoke(FilenameFilteringInterceptor.java:275)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   com.sun.proxy.$Proxy69.resolveNamePath(Unknown Source)
   com.olivetti.android.webscripts.DownloadOfferteWebScript.execute(DownloadOfferteWebScript.java:63)
   org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:400)
   org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)
   org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:462)
   org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:500)
   org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:316)
   org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:372)
   org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
   org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465)
   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   java.lang.Thread.run(Thread.java:662)
     </blockcode>

In this block of code

try {
         documentLibraryInfo = fileFolderService.resolveNamePath(companyHome, pathList );
      } catch (FileNotFoundException e) {
         throw new WebScriptException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Errore nel recupero del path: " + e.getMessage());
      }


I invoke the web script using http://localhost:8080/alfresco/service/androidservices/downloadOfferte?alf_ticket=TICKET_2bb76baddfd....

The strange thing is that the first time I invoke this web script it works, but the second time I get this exception.

Why?
3 REPLIES 3

konda
Champ in-the-making
Champ in-the-making
Wow, I didn't know! I removed the line <java>logger.debug(fileFolderService)</java> and now it's working!

I hope this will be helpful to someone.

konda
Champ in-the-making
Champ in-the-making
Wow, I didn't know! I removed the line <java>logger.debug(fileFolderService)</java> and now it's working!

I hope this will be helpful to someone.

derek
Star Contributor
Star Contributor
Thanks
Yes, that debug would have done
fileFolderService.toString()
.  That service is protected by an interceptor that specifically ensures that all calls through to the implementation have the correct permissions applied.  It could not resolve the toString method.