Project doesn't compile after migration on Vaadin 7.4

Hello,

I updated my project Vaadin version from 7.3.10 to 7.4.0 and after that I cannot compile project:

[INFO]
[ERROR]
Unexpected internal compiler error
[INFO]
java.lang.IncompatibleClassChangeError: class com.google.gwt.dev.javac.BytecodeSignatureMaker$CompileDependencyVisitor has interface org.objectweb.asm.ClassVisitor as super class
[INFO]
at java.lang.ClassLoader.defineClass1(Native Method)
[INFO]
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
[INFO]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[INFO]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
[INFO]
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
[INFO]
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
[INFO]
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[INFO]
at java.security.AccessController.doPrivileged(Native Method)
[INFO]
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[INFO]
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
[INFO]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
[INFO]
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
[INFO]
at com.google.gwt.dev.javac.BytecodeSignatureMaker.visitCompileDependenciesInBytecode(BytecodeSignatureMaker.java:227)
[INFO]
at com.google.gwt.dev.javac.BytecodeSignatureMaker.getCompileDependencySignature(BytecodeSignatureMaker.java:209)
[INFO]
at com.google.gwt.dev.javac.CompiledClass.getSignatureHash(CompiledClass.java:166)
[INFO]
at com.google.gwt.dev.javac.Dependencies$Ref.(Dependencies.java:42)
[INFO]
at com.google.gwt.dev.javac.Dependencies$Ref.(Dependencies.java:37)
[INFO]
at com.google.gwt.dev.javac.Dependencies.resolve(Dependencies.java:114)
[INFO]
at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:366)
[INFO]
at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:580)
[INFO]
at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:513)
[INFO]
at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:499)
[INFO]
at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:668)
[INFO]
at com.google.gwt.dev.Precompile.precompile(Precompile.java:255)
[INFO]
at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)
[INFO]
at com.google.gwt.dev.Precompile.precompile(Precompile.java:145)
[INFO]
at com.google.gwt.dev.Compiler.run(Compiler.java:206)
[INFO]
at com.google.gwt.dev.Compiler.run(Compiler.java:158)
[INFO]
at com.google.gwt.dev.Compiler$1.run(Compiler.java:120)
[INFO]
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
[INFO]
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
[INFO]
at com.google.gwt.dev.Compiler.main(Compiler.java:127)

Please help to resolve the problem.

Check your classpath if you have another version than 5.0.3 of the (org.ow2.asm) asm libraries included.

Artur,
Yes I have asm 3.1 in classpath.
I use hibernate-entitymanager 3.6.10.Final. It depends from cglib 2.2 witch use asm 3.1.

± org.hibernate:hibernate-entitymanager:jar:3.6.10.Final:compile
[INFO]
| - cglib:cglib:jar:2.2:compile
[INFO]
| - asm:asm:jar:3.1:compile
[INFO]
- org.unitils:unitils-dbmaintainer:jar:3.4.2:test
[INFO]
- org.hibernate:hibernate:jar:3.2.5.ga:test
[INFO]
± asm:asm-attrs:jar:1.5.3:test
[INFO]
- (asm:asm:jar:1.5.3:test - omitted for conflict with 3.1)

What can I do to resolve the problem?

I had the same problem with Apache tika-1.7.jar, which also includes an older version of asm.

I can work around the issue by

  • taking the compiler command line from the GWT compiler verbose debug output (“Executing compiler with command line:”), and
  • remove tika-app-1.7.jar from the [very long]
    -classpath parameter
  • cd into my project directory
  • call the gwt compiler from the commandline by pasting the modified compiler command line

However, this is not pretty. I’d prefer to use the Vaadin Eclipse plugin for widget set compilation.

Maybe a solution could be if the Vaadin Eclipse plugin would order the jars in the classpath of the compiler command line more intelligently (i.e. asm-5.0.3.jar before other jars)?

Also, the above ‘solution’ successfully compiled the widgetset, but it does not get deployed. I assume that the Vaadin Eclipse plugin does something else after compiling.

So here’s an equally ugly workaround, that not only helps me to avoid the gwt compiler error, but also automagically integrated the newly compiled widgetset into the application:

  • compile widgetset (with error) via eclipse plugin
  • rename the offending jar in file system (in my case the tika jar) to anything else (because the classpath seems to be cached in the plugin, this is sufficient)
  • compile widgetset again via plugin (this time without error)
  • rename the offending jar back to its original name

I hope there’s a better way… good luck.

I using Java 8 and Spring 4.1.5 in my current project. Spring using asm 3.3.1 (group id and artifact id asm).

My solution is to add following dependency into my pom.xml

org.ow2.asm asm 5.0.3 compile

I confirm that this solution works if you add it before the dependency which relies on a old version of asm (in my case org.apache.cxf:cxf-rt-frontend-jaxws:2.7.12).

Another solution would be to add an exclusion on the dependency which depends on an old version of ASM.
For example, for com.group:offending-dependency:x.y which depends on ASM 3.3.1 or less, you would have to add the exclusions block for widgetset compilation to succeed:

<dependency> <groupId>com.group</groupId> <artifactId>offending-dependency</artifactId> <version>x.y</version> <exclusions> <exclusion> <artifactId>asm</artifactId> <groupId>asm</groupId> </exclusion> </exclusions> </dependency> Special thanks to one of my colleagues for suggesting this approach!

These are great solutions! Unfortunately I do use neither Maven nor Ivy.

The source code of the class path building can be found here:

http://dev.vaadin.com/svn/integration/eclipse/plugins/com.vaadin.integration.eclipse/src/com/vaadin/integration/eclipse/util/VaadinPluginUtil.java

in method getProjectBaseClasspath (line 765).

Looking at the source code makes me believe that this problem won’t be visible for projects using Ivy, as the comment says:

// first add all dependencies from Ivy configuration // widgetset-compile So if these dependencies are correctly definied, asm is among them.

Similar logic should be implemented for all project configurations, i.e. also for projects not using Ivy. Unfortunately I currently have not the time to open a ticket for this.

But at least, looking at the code, I found a less intrusive workaround:

[line 817]

// might be a Vaadin JAR directly in the project
if (path.lastSegment().startsWith("vaadin-")) { 
  otherLocations.add(getRawLocation(project, path));
}

So for now, I have renamed my asm*.jars to vaadin-asm*, which prioritizes them in the class path. Widgetset compiling works. I just have to remember to rename the jars each time I update vaadin by hand…

For me, provided scope worked best, inserted just before hibernate dependencies.

<dependency>
     <groupId>org.ow2.asm</groupId>
     <artifactId>asm</artifactId>
     <version>5.0.3</version>
     <scope>provided</scope>
</dependency>  

Change vaadin-client-compiler jar dependancy to vaadin-client-compiled

Check for dependancies with old asm jar file by executing maven dependancy tree command

mvn dependency:tree

and exclude it as follows

asm asm

what’s the difference between vaadin-client-compiler and vaadin-client-compiled ??

https://vaadin.com/book/-/page/getting-started.libraries.html

this worked for me, thank you :slight_smile:

I had an old asm on the classpath, I just excuded it and it works fine now.

    <dependency>
        <groupId>com.company</groupId>
        <artifactId>my-asm-dependent-dep</artifactId>
        <version>0.2.0</version>
        <exclusions>
            <exclusion>
                <artifactId>asm</artifactId>
                <groupId>asm</groupId>
            </exclusion>
        </exclusions>
    </dependency>

Hello there,

None of the above solution is working for me or may be I’m missing or not properly understanding the solution. Here’s my dependency tree —

<dependencies>
          <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.35</version>
        </dependency>
        
          <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>eclipselink</artifactId>
            <version>2.6.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.reveregroup.gwt</groupId>
            <artifactId>gwt-image-loader</artifactId>
            <version>1.1.1</version>
        </dependency>
         
        <dependency>
            <groupId>com.vaadin.addon</groupId>
            <artifactId>jpacontainer</artifactId>
            <version>3.2.0</version>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-server</artifactId>
            <version>${vaadin.version}</version>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client-compiled</artifactId>
            <version>${vaadin.version}</version>
        </dependency>
       <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.9.4</version>
       </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client-compiler</artifactId>
            <version>${vaadin.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>servlet-api-2.5</artifactId>
                    <groupId>org.mortbay.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>ant</artifactId>
                    <groupId>ant</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>ant-launcher</artifactId>
                    <groupId>ant</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client</artifactId>
            <version>${vaadin.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-themes</artifactId>
            <version>${vaadin.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>javax.persistence</artifactId>
            <version>2.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.vaadin.addons</groupId>
            <artifactId>imagestrip</artifactId>
            <version>3.0</version>
        </dependency>
        <dependency>
            <groupId>11</groupId>
            <artifactId>12</artifactId>
            <version>1</version>
            <type>jar</type>
        </dependency>

        <dependency>
            <groupId>commons-net</groupId>
            <artifactId>commons-net</artifactId>
            <version>3.3</version>
        </dependency>
        
           <dependency>
            <groupId>org.vaadin.addon</groupId>
            <artifactId>confirmdialog</artifactId>
            <version>2.1.1</version>
        </dependency>
        
        <dependency>
           <groupId>org.vaadin.addons</groupId>
           <artifactId>wizards-for-vaadin</artifactId>
           <version>1.1.0</version>
        </dependency>    

        <dependency> 
            <groupId>org.vaadin.addons</groupId>
            <artifactId>vaadin-sliderpanel</artifactId>
            <version>1.2.0</version>
        </dependency>
        
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itextpdf</artifactId>
            <version>5.5.6</version>
        </dependency>

        <dependency>
                <groupId>org.apache.xmlgraphics</groupId>
                <artifactId>fop</artifactId>
                <version>1.1</version>
            <exclusions>
                <exclusion>
                    <artifactId>avalon-framework-api</artifactId>
                    <groupId>org.apache.avalon.framework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>avalon-framework-impl</artifactId>
                    <groupId>org.apache.avalon.framework</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        
        <dependency>
           <groupId>de.steinwedel.vaadin.addon</groupId>
           <artifactId>messagebox</artifactId>
           <version>2.0.6</version>
        </dependency>
        <dependency>
           <groupId>org.vaadin.addons</groupId>
           <artifactId>buttongroup</artifactId>
           <version>2.3</version>
            <type>jar</type>
        </dependency>

        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>1.5.2</version>
        </dependency>
        

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>javax.mail</artifactId>
            <version>1.5.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-launcher</artifactId>
            <version>1.9.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <version>2.6.0</version>
        </dependency>
        
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-shared-deps</artifactId>
            <version>1.0.3</version>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client-compiler-deps</artifactId>
            <version>1.2.0</version>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.1.0.Final</version>
        </dependency>
        <dependency>
              <groupId>org.apache.poi</groupId>
              <artifactId>poi</artifactId>
              <version>3.12</version>
            <type>jar</type>
        </dependency>
        
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>3.12</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-scratchpad</artifactId>
            <version>3.12</version>
        </dependency>
        <dependency>
          <groupId>net.coobird</groupId>
          <artifactId>thumbnailator</artifactId>
          <version>[0.4, 0.5)</version>
        </dependency>

        <dependency>
            <groupId>org.vaadin.addons</groupId>
            <artifactId>dcharts-widget</artifactId>
            <version>1.7.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.vaadin.addons</groupId>
            <artifactId>animator</artifactId>
            <version>2.0.0</version>
            <scope>compile</scope>
        </dependency>
        
        <dependency>
            <groupId>org.vaadin.addons</groupId>
            <artifactId>dom</artifactId>
            <version>0.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.vaadin.addons</groupId>
            <artifactId>ckeditor-wrapper-for-vaadin</artifactId>
            <version>7.9.6</version>
            <type>jar</type>
        </dependency>
        <dependency>
           <groupId>org.vaadin.addons</groupId>
           <artifactId>stepper</artifactId>
           <version>2.2.2</version>
        </dependency>
        <dependency>
           <groupId>org.vaadin.addon</groupId>
           <artifactId>tableexport-for-vaadin</artifactId>
           <version>1.5.1.5</version>
        </dependency>
        <dependency>
           <groupId>org.vaadin.addons</groupId>
           <artifactId>popupbutton</artifactId>
           <version>2.6.0</version>
        </dependency>
<!--added by ahmedRaaj for using jpa meta model-->
        <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-jpamodelgen</artifactId>
        <version>1.3.0.Final</version>
        </dependency>
        
        <dependency>
        <groupId>at.downdrown.vaadinaddons</groupId>
        <artifactId>highchartsapi</artifactId>
        <version>2.2.1</version>
        </dependency>
    </dependencies>

I’m wanting to migrate to vaddin 7.5.x but only getting the same error which have been discussed here.
Can anyone help pls???

Does anyone found a solution of this problem while switching to vaddin 7.5.x , I’m facing the same problem when I try to update from 7.3.x to 7.4.x Or 7.5.x , Only 7.3.10 builds correctly but all latest versions of vaadin gives the same build error mentioned at top of this post :frowning:

Nazmul, (and possibly Aminul), if you use Maven, the best solution for you is probably the one of
Frank Waßewitz
above. Make sure that asm 5.0.3 is above any other dependency that includes an older version of
asm
.

[code]
My solution is to add following dependency into my pom.xml

org.ow2.asm asm 5.0.3 compile [/code](or the exclusion-solution as described by Valentin Descamps, but for that you have to know which dependencies include an old version of asm).

If you manage your jar files by hand like me, rename all
asm*.jars
to
vaadin-asm*.jar
, so they get added to the classpath first.

If you use Ivy, I assume you should not see this problem, so using Ivy is probably also a solution.

Thanks for the reply.

I’m using maven and I’ve tried of
Frank Waßewitz’s
solution and add that dependency snippet mentioned by him at the very beginning of the dependencies tree but cant get the rid of the error. Am I wrong here? Is the exclution-solution is the only solution??

If you have exactly the error message that started this thread, we can at least be reasonably sure that the cause for the error is an older version of asm in your classpath, before the vaadin asm files. And the solution to this error is to somehow correct the order of the jars.

You can check the current order of the jars in the console when you compile the widget set (I assume you use the Vaadin plugin in Eclipse). The second line in the output is the call to the widget set compiler, with the complete classpath in it. At least one of the jars before the vaadin asm jars must contain an older asm version.

You can copy this line from the console, change the order of the jars by hand and paste the result into a shell and see if it works.

But of course it would be better if you change it persistently. I have no idea why changing the dependendy file does not change the order of the jar files in your case (maybe you have more than one dependendy files, and change the wrong one?).