我已经在这个 Web 应用程序上工作了一年多,这里的配置直到现在都没有带来任何问题:
- Java EE 应用程序使用 Spring、EclipseLink 和 maven 进行依赖 - PostgreSQL 数据库
- 在本地,我在 Eclipse 中工作,其中集成了 Glassfish3 服务器和 maven 插件,并且我使用 jdk1.7.0_03
- 在我的 Windows 服务器上,还安装了 Glassfish3 - 还安装了 jdk1.7.0_03 和 jenkins,用于处理 svn 和部署
- 在本地和远程服务器上,数据库是PostgreSQL9.1,并且数据库具有相同的名称、相同的URL、相同的表和数据
- 两个 glassfishs 还设置了连接池和 JDBC 资源
现在我的问题,自上个月以来出现,我不知道如何解决,是:虽然我的应用程序在本地运行得很好(从 eclipse 或者也只是使用 maven 手动部署到 glassfish 来构建战争和 glassfish 管理界面部署),当我尝试在我的远程服务器上的 glassfish 上部署相同的战争时出现错误......这是我得到的错误:
[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.inra.means.services.interfaces.IProjectService fr.inra.means.services.security.ProjectPermissionEvaluator.projectService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'projectService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao' 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.inra.means.model.application.Projet.equals(Ljava/lang/Object;)Z at offset 4
我首先问了这个问题,认为我一定有一个 maven 配置问题左右:java.lang.VerifyError when deploying the new version of my Java EE web application but using the same maven configuration local works so it must be about玻璃鱼配置!
我什至尝试切换到 jdk1.6(这很痛苦,因为我不喜欢改变它的想法,因为我已经使用 jdk1.7 开发了一年)......它解决了部署问题(verifyError)但是,同样地,虽然它在本地工作得非常好,但当我在服务器上运行应用程序时,一个函数在到达“CriteriaBuilder cb = em.getCriteriaBuilder();”这一行时崩溃了......(并且没有异常可能是在我的日志中找到...)
您是否知道什么可能导致 2 个 glassfish 服务器之间的这种行为差异?我的 2 个 glassfish 服务器之间的配置差异是什么,可以解释这个错误?
我的想法(和希望)已经用完了,所以任何帮助都会很棒!