0

I have been working on this web application for more than a year and here is the configuration which did not bring any problem until now:

  • Java EE application using Spring, EclipseLink and maven for dependencies - PostgreSQL database
  • Locally I work in Eclipse where my Glassfish3 server and maven plugin are integrated and I use jdk1.7.0_03
  • On my Windows server, Glassfish3 is also installed - also jdk1.7.0_03 and jenkins for dealing with svn and deployment
  • Locally and on the distant server, the database is PostgreSQL9.1 and the database has the same name, same URL and same tables and data
  • Both glassfishs also have connection pools and JDBC resources set up

Now my problem, which occurs since last month, and I cannot figure out how to solve, is: while my application runs just fine locally (from eclipse or also just manually deployed into glassfish using maven for building the war and glassfish administration interface for the deployment), I get an error when I try to deploy the same war on glassfish on my distant server... Here is the error I get:

[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

I first asked this question about it, thinking that I must have had a maven configuration problem or so: java.lang.VerifyError when deploying the new version of my Java EE web application but using the same maven configuration locally works so it must be about glassfish configuration!

I even tried to switch to jdk1.6 (which was a pain because I don't like the idea to change that since I have developed with jdk1.7 for a year now)... It solved the deployment problem (the verifyError) but, same way, while it was working perfectly fine locally, when I ran the application on the server, a function crashed when it reached this line "CriteriaBuilder cb = em.getCriteriaBuilder();"... (and no Exception could be found in my logs...)

Do you have any idea about what could cause this difference of behaviour between the 2 glassfish servers? What is the configuration difference between my 2 glassfish servers which would explain this error?

I'm running out of ideas (and hope) so any help would be great!

Community
  • 1
  • 1
Coralie
  • 107
  • 3
  • 17

1 Answers1

0

Are you deploying the app in the 'Domain Admin Server' or a standalone instance?

If yes, create a standalone instance locally as well and try deployment there.

Applications should not really be running in 'Domain Admin Server' in production. Some frameworks behave differently there because 'Domain Admin Server' uses a different security manager by default IIRC.

Bernhard Thalmayr
  • 2,674
  • 1
  • 11
  • 7
  • I'm not sure I understand your answer correctly... Locally I have one glassfish server which has only one domain - the domain1 - with 2 ports: 8080 for applications and 4848 for administration. On my distant server I have another installation of glassfish with 2 domains: domain1 (8080 + 4848) for the tests and domain2 (8282 + 4949) for the production. Is it what you call 'Domain Admin Server'? What is exactly a standalone instance? – Coralie Jul 26 '13 at 12:35