Alfresco / alfresco-sdk

The Alfresco In-Process SDK is based on Apache Maven, includes support for rapid and standard development, testing, packaging, versioning and release of your Alfresco integration and extension projects
Apache License 2.0
185 stars 113 forks source link

Activiating the Share javascript debugger produces thousands of FileNotFoundException #489

Closed billerby closed 3 years ago

billerby commented 6 years ago

I'm submitting a ... (check one with "x")

[ x] bug report => search github for a similar issue or PR before submitting
[ ] feature request

Current Behavior

Activating the ScriptDebugger for Share either by setting the log4j.properties key to on like this: log4j.logger.org.springframework.extensions.webscripts.ScriptDebugger=on or activating it through clicking the button at http://localhost:8765/share/service/index results in a loop of errors that makes tha application hang forever.

bapps/alfresco-mellanarkiv-share/WEB-INF/lib/lesscss-engine-1.5.1.jar!/META-INF/less.js (No such file or directory) Failed to load source from file:/home/erib/projekt/alfresco-mellanarkiv/target/tomcat/webapps/alfresco-mellanarkiv-share/WEB-INF/lib/lesscss-engine-1.5.1.jar!/META-INF/less.js: java.io.FileNotFoundException: /home/erib/projekt/alfresco-mellanarkiv/target/tomcat/webapps/alfresco-mellanarkiv-share/WEB-INF/lib/lesscss-engine-1.5.1.jar!/META-INF/less.js (No such file or directory) Failed to load source from file:/home/erib/projekt/alfresco-mellanarkiv/target/tomcat/webapps/alfresco-mellanarkiv-share/WEB-INF/lib/lesscss-engine-1.5.1.jar!/META-INF/less.js: java.io.FileNotFoundException: /home/erib/projekt/alfresco-mellanarkiv/target/tomcat/webapps/alfresco-mellanarkiv-share/WEB-INF/lib/lesscss-engine-1.5.1.jar!/META-INF/less.js (No such file or directory) Failed to load source from file:/home/erib/projekt/alfresco-mellanarkiv/target/tomcat/webapps/alfresco-mellanarkiv-share/WEB-INF/lib/lesscss-engine-1.5.1.jar!/META-INF/less.js: java.io.FileNotFoundException: /home/erib/projekt/alfresco-mellanarkiv/target/tomcat/webapps/alfresco-mellanarkiv-share/WEB-INF/lib/lesscss-engine-1.5.1.jar!/META-INF/less.js (No such file or directory)

Possible Solution

found a possible duplicate of this in jira that should be solved (but just concerning activation via log4j) https://issues.alfresco.com/jira/browse/MNT-16129

Steps to Reproduce (for bugs)

  1. Change client-debug to true in share-config-custom.xml (src/test/resources/share)
  2. Set log4j.logger.org.springframework.extensions.webscripts.ScriptDebugger=on in the log4j.properties for share. (src/test/resources/share)
  3. ./run.sh
  4. Try to login to Alfresco
  5. Watch the log (and the lag)

Context

I am desperatly trying to debug the share-header.get.js to try to add some stuff in the site-configuration menu.

Your Environment

tom-vandepoele commented 6 years ago

Add this to the main pom.xml in the alfresco-maven-plugin configuration:

<shareModules>
...
<!-- Fix for share javascript console bug -->
   <moduleDependency>
      <groupId>org.alfresco.3rdparty.com.asual.lesscss</groupId>
      <artifactId>lesscss-engine</artifactId>
      <version>1.5.0-patched</version>
   </moduleDependency>
</shareModules>

The "lesscss-engine" jar that is included by default is missing certain files which cause the problems. This patched jar has those missing files. (They should really make a patch of the latest version again and include that, or just have a separate jar with the missing files)

pbodnar commented 4 years ago

@tom-vandepoele, thank you a lot for the tip! It looks like replacing the jar (lesscss-engine-1.5.1.jar in my case) inside share.war with the "-patched" version seems to fix the problem.

The "lesscss-engine" jar that is included by default is missing certain files which cause the problems. This patched jar has those missing files. (They should really make a patch of the latest version again and include that, or just have a separate jar with the missing files)

I'm not quite sure about this - I compared the 2 jars and there is no extra file in either of them. But there are differing class files, so maybe the trick is hidden in them...?