java.lang.VerifyError when deploying the new version of my Java EE web application
04:37 24 Jun 2013

I modified some code in my current web project to add Spring transaction management. Everything works just fine when I deploy it in Eclipse or even when I call a "Maven clean" and a "Maven install" in my workspace. However when my continuous integration server (jenkins) tries to redeploy it on my distant server I get a java.lang.VerifyError and it fails:

maven-glassfish-plugin:2.1:deploy (default-cli) @ myApp --- [INFO] asadmin --host localhost --port 4848 --user admin --passwordfile C:\Windows\TEMP\mgfp2047875868831547735.tmp --interactive=false --echo=true --terse=true deploy --name myApp --force=false --precompilejsp=false --verify=false --enabled=true --generatermistubs=false --availabilityenabled=false --keepreposdir=false --keepfailedstubs=false --logReportedErrors=true --upload=false --help=false C:\.jenkins\workspace\First_deploy\target\myApp-0.0.1.war
[ERROR] com.sun.enterprise.admin.cli.CommandException: remote failure: Exception while loading the app : java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'analysisDAO': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory': Post-processing of the FactoryBean's object failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.methodSecurityMetadataSourceAdvisor': Cannot resolve reference to bean 'org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource#0' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource#0': Cannot create inner bean '(inner bean)' of type [org.springframework.security.access.prepost.PrePostAnnotationSecurityMetadataSource] while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot create inner bean '(inner bean)' of type [org.springframework.security.access.expression.method.ExpressionBasedAnnotationAttributeFactory] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'expressionHandler' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'expressionHandler' defined in ServletContext resource [/WEB-INF/spring/security-config.xml]: Cannot resolve reference to bean 'projectPermissionEvaluator' while setting bean property 'permissionEvaluator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'projectPermissionEvaluator': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public fr.services.interfaces.IProjectService fr.services.security.ProjectPermissionEvaluator.projectService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'projectService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public fr.services.interfaces.IProjectRightsService fr.services.impl.ProjectService.projectRightService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'projectRightService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public fr.dao.IDAOFactory fr.services.impl.ProjectRightService.daoFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myAppDAOFactory': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'agriculturalToolDao' defined in ServletContext resource [/WEB-INF/spring/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.VerifyError: Expecting a stackmap frame at branch target 43 in method fr.model.application.Projet.equals(Ljava/lang/Object;)Z at offset 4

I use a jdk1.7 (I checked on my server and it's still the right JDK which is in the environment variables), maven and Glassfish. Here is my pom.xml:


    4.0.0
    means
    means
    0.0.1
    war
    
        
            mavenplugin-server
            
                
                    environment
                    server
                
            
            
                C:\MEANS\Glassfish\glassfish
                4848
                8080
                8443
            
        
        
            mavenplugin-server-production
            
                
                    environment
                    server-production
                
            
            
                C:\MEANS\Glassfish\glassfish
                4949
                8282
                8553
            
        
        
            mavenplugin-local
            
                true
            
            
                C:\MEANS\Glassfish\glassfish
                4848
                8080
                8443
            
        
    
    
        3.0.5.RELEASE
        2.4.0
    
    
        
            EclipseLink Repo
            http://download.eclipse.org/rt/eclipselink/maven.repo
        
        
            com.springsource.repository.bundles.release
            EBR Spring Release Repository
            http:// repository.springsource.com/maven/bundles/release
        
        
            com.springsource.repository.bundles.external
            EBR External Release Repository
            http:// repository.springsource.com/maven/bundles/external
        
    
    
        src
        build2
        src/test
        
            
                org.apache.maven.plugins
                maven-war-plugin
                2.1
                
                    ${basedir}\WebContent\WEB-INF\web.xml
                    ${basedir}\WebContent\*
                    
                        
                            ${basedir}/WebContent
                            **/*.java
                        
                    
                    
                        
                            ${basedir}\src\fr
                            WEB-INF\classes\fr
                            
                                **/*.java
                            
                        
                        
                            ${basedir}\build2\fr
                            WEB-INF\classes\fr
                        
                        
                            ${basedir}/WebContent/WEB-INF/
                            WEB-INF/
                            
                                dispatcher-servlet.xml
                            
                            
                                log4j.properties
                            
                        
                        
                            ${basedir}/WebContent/WEB-INF/
                            WEB-INF/
                            
                                dispatcher-servlet.xml
                            
                        
                        
                            ${basedir}/WebContent/WEB-INF/
                            WEB-INF/classes/
                            
                                log4j.properties
                            
                        
                        
                            ${basedir}/src/META-INF
                            WEB-INF/classes/META-INF/
                            
                                persistence.xml
                            
                        
                        
                            ${basedir}/WebContent/
                            
                        
                    

                
            
            
                maven-surefire-plugin
                2.1
                 
                    -XX:-UseSplitVerifier
                
            
            
                maven-compiler-plugin
                2.3.2
                
                    1.7
                    1.7
                
            

            
                org.glassfish.maven.plugin
                maven-glassfish-plugin
                2.1
                
                    admin
                    true
                    means2012!
                    ${glassfish.home}
                    
                        
                            ${project.artifactId}
                            ${project.build.directory}/${project.build.finalName}.war
                        
                    
                    
                        ${project.artifactId}
                        ${glassfish.adminPort}
                        ${glassfish.httpPort}
                        ${glassfish.httpsPort}
                    
                
            

        
    
    
        
            log4j
            log4j
            1.2.15
            compile
              
                
                  javax.mail
                  mail
                
                
                  javax.jms
                  jms
                
                
                  com.sun.jdmk
                  jmxtools
                
                
                  com.sun.jmx
                  jmxri
                
              
  
  
        
            org.aspectj
            aspectjrt
            1.6.11
        
 
        
            org.aspectj
            aspectjweaver
            1.6.11
        
        
        
        
            org.eclipse.persistence
            eclipselink
            ${eclipselink.version}
            compile
        
        
            org.eclipse.persistence
            org.eclipse.persistence.core
            ${eclipselink.version}
            compile
        
        
            org.eclipse.persistence
            org.eclipse.persistence.jpa
            ${eclipselink.version}
            compile
        

        
            org.eclipse.persistence
            org.eclipse.persistence.jpa.modelgen
            ${eclipselink.version}
            compile
        
        
            org.eclipse.persistence
            org.eclipse.persistence.moxy
            ${eclipselink.version}
            compile
        
        
            org.eclipse.persistence
            org.eclipse.persistence.sdo
            ${eclipselink.version}
            compile
        
        
            org.eclipse.persistence
            org.eclipse.persistence.oracle
            ${eclipselink.version}
            compile
        
        
            org.springframework
            spring-orm
            3.1.2.RELEASE
        
        
            org.springframework
            spring-aop
            3.1.2.RELEASE
        
        
        
            org.springframework
            spring-beans
            3.1.2.RELEASE
        
        
            org.springframework
            spring-context
            3.1.2.RELEASE
        
        
            org.springframework
            spring-context-support
            3.1.2.RELEASE
        
        
            org.springframework
            spring-core
            3.1.2.RELEASE
        
        
            org.springframework
            spring-expression
            3.1.2.RELEASE
        
        
            org.springframework
            spring-jdbc
            3.1.2.RELEASE
        
        
            org.springframework
            spring-jms
            3.1.2.RELEASE
        
        
            org.springframework
            spring-tx
            3.1.2.RELEASE
        
        
            org.springframework
            spring-web
            3.1.2.RELEASE
        
        
            org.springframework
            spring-webmvc
            3.1.2.RELEASE
        
        
            commons-logging
            commons-logging
            1.1.1
        
        
            jstl
            jstl
            1.2
        
        
            javax.validation
            validation-api
            1.1.0.Alpha1
        
        
            org.glassfish
            maven-glassfish-plugin
            1.0-alpha-4
            maven-plugin
        
        
            com.google.code.gson
            gson
            2.2.2
        
        
            org.springframework.security
            spring-security-core
            3.1.3.RELEASE
        
        
            org.springframework.security
            spring-security-aspects
            3.1.3.RELEASE
        
        
            org.springframework.security
            spring-security-config
            3.1.3.RELEASE
        
        
            org.springframework.security
            spring-security-web
            3.1.3.RELEASE
        
        
            org.springframework.security
            spring-security-taglibs
            3.1.3.RELEASE
        
        
            org.springframework
            spring-test
            3.2.0.RELEASE
        
        
            net.sf.opencsv
            opencsv
            2.3
        
        
            org.apache.commons
            commons-io
            1.3.2
        
        
            commons-fileupload
            commons-fileupload
            1.3
        
        
            joda-time
            joda-time
            2.2
        
    

I tried to add the maven-surefire-plugin as indicated in this question: How do I get unit test to run in java 7: java.lang.VerifyError: Expecting a stackmap frame at branch target but without success. As I'm not a Maven expert, it's extremely difficult to find out what is wrong in my configuration.

java spring maven java-7 maven-glassfish-plugin