[ACE-5889] 6.1.0-EA3 - "java.lang.ClassNotFoundException: org.alfresco.repo.Client$ClientType" error when trying to download content from Share Created: 05-Nov-18  Updated: 18-Feb-19  Resolved: 19-Nov-18

Status: Closed
Project: Alfresco One Platform
Component/s: Share Application
Affects Version/s: 6.1
Fix Version/s: 6.1

Type: Bug Priority: Blocker
Reporter: Alex Strachan Assignee: Closed Issues
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Generic 6.1.0-EA3


Issue Links:
Dependency
Depended on by SHA-2250 Share 6.1 Release Closed
Duplicate
is duplicated by ALF-22044 Error downloading document via Share Closed
Problem/Incident
is caused by REPO-3647 Transforms: Sync Service event integr... Done
Bug Priority:
Category 1
Story Points: 3
Sprint: John Jenkins, Kabalevsky

 Description   

Problem
Firing up 6.1.0-EA3 (either via acs-deployment or locally via the distribution zip file) and trying to download any content via Share document library results in an internal error 500 with the following stack trace:

2018-11-05 12:57:16,236 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] Exception from executeScript: 10050063 Exception in Transaction. 
org.alfresco.error.AlfrescoRuntimeException: 10050063 Exception in Transaction. 
	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:536) 
	at org.alfresco.slingshot.web.scripts.SlingshotContentGet.execute(SlingshotContentGet.java:124) 
	at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:512) 
	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450) 
	at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:587) 
	at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:656) 
	at org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:428) 
	at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:308) 
	at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:399) 
	at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:210) 
	at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132) 
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) 
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) 
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) 
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) 
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) 
	at org.alfresco.web.app.servlet.ServletMetricsFilter.doFilter(ServletMetricsFilter.java:178) 
	at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:89) 
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) 
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) 
	at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:68) 
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) 
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) 
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) 
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) 
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) 
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) 
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) 
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) 
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) 
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) 
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) 
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) 
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) 
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) 
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) 
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) 
	at java.lang.Thread.run(Thread.java:748) 
Caused by: java.lang.NoClassDefFoundError: org/alfresco/repo/Client$ClientType 
	at org.alfresco.slingshot.web.scripts.SlingshotContentGet$1.execute(SlingshotContentGet.java:130) 
	at org.alfresco.slingshot.web.scripts.SlingshotContentGet$1.execute(SlingshotContentGet.java:125) 
	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450) 
	... 40 more 
Caused by: java.lang.ClassNotFoundException: org.alfresco.repo.Client$ClientType 
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291) 
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119) 
	... 43 more 

Steps to reproduce

  1. Start up Alfresco 6.1.0-EA3 from either acs-deployment or form a local install
  2. Login to Share as admin and find the sample project site
  3. In the document library of the site, try to click the download action for any content

Analysis
The area we're interested in (from the stack above) is:

SlingshotContentGet.java
@Override
                        public Void execute() throws Throwable
                        {
                            // post an activity - mirror the mechanism as if from the Share application
                            poster.postFileFolderActivity(ActivityPoster.DOWNLOADED, null, null,
                                    siteName, null, nodeRef, strFilename, "documentlibrary", Client.asType(ClientType.webclient), null);
                            return null;
                        }

We basically can't find that class due to the fact that from 6.1 EA2, we are not pulling in the 'alfresco-events' dependency (i.e. alfresco-events-1.2.12.jar) at all.

6.1.0-EA1

<dependency>
                <groupId>org.alfresco.services</groupId>
                <artifactId>alfresco-events</artifactId>
                <version>1.2.12</version>
            </dependency>
  • both the events and events-repo has been removed from the POM from 6.1.0-EA2 onwards.

SlingshotContentGet.java looks to be the only area of share effected (within share-services) however there appear to be a heap of places in other areas of code that would be affected. I'm guessing the fix would be to pull that dependency back in.


Generated at Thu Jul 09 10:13:54 BST 2020 using JIRA 7.6.3#76005-sha1:8a4e38d34af948780dbf52044e7aafb13a7cae58.