Maven .war的部署在本地工作,但在使用Glassfish3的远程服务器上失败

Maven .war的部署在本地工作,但在使用Glassfish3的远程服务器上失败,maven,deployment,glassfish-3,war,java-7,Maven,Deployment,Glassfish 3,War,Java 7,我已经在这个web应用程序上工作了一年多,下面是到目前为止没有带来任何问题的配置: 使用Spring、EclipseLink和maven作为依赖项的JavaEE应用程序-PostgreSQL数据库 在本地,我在Eclipse中工作,集成了Glassfish3服务器和maven插件,并使用jdk1.7.0_03 在我的Windows服务器上,还安装了Glassfish3,以及jdk1.7.0_03和jenkins,用于处理svn和部署 在本地和远程服务器上,数据库是PostgreSQL9.1,数

我已经在这个web应用程序上工作了一年多,下面是到目前为止没有带来任何问题的配置:

  • 使用Spring、EclipseLink和maven作为依赖项的JavaEE应用程序-PostgreSQL数据库
  • 在本地,我在Eclipse中工作,集成了Glassfish3服务器和maven插件,并使用jdk1.7.0_03
  • 在我的Windows服务器上,还安装了Glassfish3,以及jdk1.7.0_03和jenkins,用于处理svn和部署
  • 在本地和远程服务器上,数据库是PostgreSQL9.1,数据库具有相同的名称、相同的URL以及相同的表和数据
  • 这两种GlassFish都设置了连接池和JDBC资源
现在我的问题是:虽然我的应用程序在本地运行得很好(从eclipse开始,或者也只是使用maven手动部署到glassfish中,用于构建war和glassfish部署管理界面),但从上个月开始就出现了,我不知道如何解决这个问题,当我试图在我的远程服务器上的glassfish上部署相同的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.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配置问题:但是在本地使用相同的maven配置是可行的,所以它一定是关于glassfish配置的

我甚至尝试切换到jdk1.6(这是一种痛苦,因为我不喜欢改变这种想法,因为我已经用jdk1.7开发了一年了)。。。它解决了部署问题(verifyError),但是,同样,当它在本地工作得非常好时,当我在服务器上运行应用程序时,当它到达以下行“CriteriaBuilder cb=em.getCriteriaBuilder();”时,一个函数崩溃了。。。 (在我的日志中找不到异常…)

您知道是什么导致两台glassfish服务器之间的行为差异吗? 我的两台glassfish服务器之间的配置差异是什么,这可以解释这个错误


我的想法(和希望)都快用完了,所以任何帮助都会很好

您是在“域管理服务器”或独立实例中部署应用程序

如果是,也在本地创建一个独立实例,并尝试在那里部署


应用程序不应该在生产环境中的“域管理服务器”中运行。有些框架在那里表现不同,因为“域管理服务器”默认使用不同的安全管理器IIRC。

我不确定我是否正确理解您的答案。。。在本地,我有一台glassfish服务器,它只有一个域——domain1,有两个端口:8080用于应用程序,4848用于管理。在我的远程服务器上,我安装了另一个glassfish,它有两个域:用于测试的域1(8080+4848)和用于生产的域2(8282+4949)。这就是你所说的“域管理服务器”吗?什么是独立实例?