DPascalBernard / maven-alfresco-archetypes

Automatically exported from code.google.com/p/maven-alfresco-archetypes
0 stars 0 forks source link

NoClassDefFoundError on alfresco:install #157

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Clone the js-console git repository from 
https://github.com/share-extras/js-console and go to javascript-console-repo 
folder
2. Edit the pom.xml file to use the 1.1.0 version of Alfresco Maven SDK and the 
4.2.e version of Alfresco
3. Execute mvn package alfresco:install 
-Dmaven.alfresco.warLocation="D:\git\js-console\alfresco.war"

What is the expected output? What do you see instead?
The project is compiled and packaged as amp and installed to the war file.

What I see?
java.lang.NoClassDefFoundError: 
de/schlichtherle/truezip/fs/FsSyncExceptionBuilder
        at de.schlichtherle.truezip.fs.FsManager.sync(FsManager.java:99)
        at de.schlichtherle.truezip.fs.FsSyncShutdownHook$Hook.run(FsSyncShutdownHook.java:93)
Caused by: java.lang.ClassNotFoundException: 
de.schlichtherle.truezip.fs.FsSyncExceptionBuilder
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
        ... 2 more

What version of the product are you using? On what operating system?
Running Windows 7 64, JDK 1.7.0_25, Maven 3.1.0 
Alfresco Maven SDK 1.1.0 and Alfresco 4.2.e

Please provide any additional information below.
I've tried to solve this by adding the dependency below
<dependency>
    <groupId>de.schlichtherle.truezip</groupId>
    <artifactId>truezip-kernel</artifactId>
    <version>7.7.4</version>
</dependency>
But that didn't help

Original issue reported on code.google.com by douglascrp@gmail.com on 19 Nov 2013 at 11:08

GoogleCodeExporter commented 8 years ago
I'm afraid I could not reproduce the problem.

I modified the pom like this:
$ git diff
diff --git a/javascript-console-repo/pom.xml b/javascript-console-repo/pom.xml
index 840f3bf..a3de5ee 100644
--- a/javascript-console-repo/pom.xml
+++ b/javascript-console-repo/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.alfresco.maven</groupId>
         <artifactId>alfresco-sdk-parent</artifactId>
-        <version>1.0.2</version>
+        <version>1.1.0</version>
     </parent>

     <groupId>org.sharextras</groupId>
@@ -37,7 +37,7 @@
     <properties>
         <!-- alfresco-sdk-parent POM references 4.2.c still -->
         <alfresco.groupId>org.alfresco</alfresco.groupId>
-        <alfresco.version>4.2.d</alfresco.version>
+        <alfresco.version>4.2.e</alfresco.version>

     </properties>

Then, I ran the command you write above and it looks fine.
Can you please try 2 things:

1) run the same maven command with the -X flag, redirecting the very verbose 
output.
Then, look for the first occurrence of alfresco-maven-plugin, and you will see 
its classpath. It should look like this:
[DEBUG] org.alfresco.maven.plugin:alfresco-maven-plugin:jar:1.1.1:
[...]
[DEBUG]    org.alfresco:alfresco-mmt:jar:4.2.e:compile
[DEBUG]       de.schlichtherle.truezip:truezip-file:jar:7.5.5:compile
[DEBUG]          de.schlichtherle.truezip:truezip-driver-file:jar:7.5.5:runtime
[DEBUG]          de.schlichtherle.truezip:truezip-kernel:jar:7.5.5:compile
[DEBUG]       de.schlichtherle.truezip:truezip-driver-zip:jar:7.5.5:compile
[DEBUG]          de.schlichtherle.truezip:truezip-swing:jar:7.5.5:compile
Make sure you have the truezip dependencies in it.

2) In your local Maven repository, delete or move the 
~/.m2/repository/de/schlichtherle folder, and run the command again.
It should re-download the truezip jars. Maybe there were corrupted somehow...

Keep us informed!

Original comment by samuel.l...@alfresco.com on 19 Nov 2013 at 11:26

GoogleCodeExporter commented 8 years ago
Please, ignore my issue report.
I finally could figure out the problem.
I was running those commands in a windows virtual drive mounted with subst 
command.
I moved the project to my C drive, and it worked.

And I could remove that dependency.

I noticed that problem also happens when I try to install a amp manually using 
the alfresco-mmt.jar.
If I do that in this virtual drive, I got some IO exceptions, so, please, when 
you see a virtual drive, just run... lol

Thank you.

Original comment by douglascrp@gmail.com on 19 Nov 2013 at 11:54

GoogleCodeExporter commented 8 years ago
OK, thanks for telling us.
You seem to encounter the Alfresco issue 
https://issues.alfresco.com/jira/browse/MNT-9966, which is still being 
investigated.

FWIW, "real" virtual drives seem to work fine: 
http://technet.microsoft.com/en-us/magazine/ee872416.aspx

Original comment by samuel.l...@alfresco.com on 19 Nov 2013 at 1:07