0

I am having issues deploying a project that was converted from ant to maven, on Glassfish 4. When I generate a war file with my build.xml, I can deploy it without any problems, but when I make the war file with Maven and try to deploy it, I get the following exception:

Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.ArrayIndexOutOfBoundsException: 48188. 

I would assume that there is some problem in the pom.xml file. I'll pastebin it here, but it is quite a big file (the project uses a lot of dependencies), so I'm not sure if it will be of much help. What could be causing that exception?

The pom.xml file: http://pastebin.com/aQS2inaQ

Att.

Chris Michaels

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
  • I think this will help u. [http://stackoverflow.com/questions/21039049/severe-containerbase-addchild-startorg-apache-catalina-lifecycleexception-fa](http://stackoverflow.com/questions/21039049/severe-containerbase-addchild-startorg-apache-catalina-lifecycleexception-fa) – Shalika Dec 08 '16 at 17:20
  • Sadly, none of those solutions applied to my problem. Att. Chris Michaels – O Superusuário Dec 08 '16 at 17:40
  • Your pom needs a lot of cleanup. The default scope for dependencies is `compile` so you are packaging tons of stuff which shouldn't be there, like all your test frameworks which should have `test` scope, plus all the JSRs which are provided with GlassFish and will conflict. (it would be a good idea to replace the individual JSR dependencies with just the Java EE 7 coordinates: ` javax javaee-api 7.0 provided ` – Mike Dec 09 '16 at 09:21
  • Could you also add the ***full*** error log from maven, rather than just that one line? – Mike Dec 09 '16 at 09:22
  • That line is the full error log, it's all the information glassfish gives – O Superusuário Dec 12 '16 at 17:31

2 Answers2

0
  • What is the jdk version of galssfish server ?
  • what is the jdk version of you use to build the application ?
  • Did you add maven dependencies to your project ?
  • After updating maven dependencies some times the Jre system library changes in the application automatically.so did u check the jre system library version in java build path after updaing maven dependencies ?
Shalika
  • 1,457
  • 2
  • 19
  • 38
0

Compare the contents of the 2 WARs created by Ant and Maven. The list of jar files in WEB-INF/lib should be similar. I guess that the maven version contains much more than the Ant version.

You should give provided scope to the dependencies that provide only API that is already available in GlassFish:

<dependency>
  <groupId>javax.el</groupId>
  <artifactId>el-api</artifactId>
  <version>1.1</version>
  <scope>provided</scope>
</dependency>

<dependency>
  <groupId>org.hibernate.javax.persistence</groupId>
  <artifactId>hibernate-jpa-2.0-api</artifactId>
  <version>1.0.1.Final</version>
  <scope>provided</scope>
</dependency>

<dependency>
  <groupId>org.glassfish</groupId>
  <artifactId>javax.ejb</artifactId>
  <version>3.1</version>
  <scope>provided</scope>
</dependency>

<dependency>
  <groupId>org.glassfish</groupId>
  <artifactId>javax.faces</artifactId>
  <version>2.1.7</version>
  <scope>provided</scope>
</dependency>

<dependency>
  <groupId>org.jboss.spec.javax.transaction</groupId>
  <artifactId>jboss-transaction-api_1.1_spec</artifactId>
  <version>1.0.0.Final</version>
  <scope>provided</scope>
</dependency>

<dependency>
  <groupId>com.sun.jersey</groupId>
  <artifactId>jersey-bundle</artifactId>
  <version>1.11</version>
  <scope>provided</scope>
</dependency>

Or just remove those dependencies and replace them with

<dependency> 
  <groupId>javax</groupId>
  <artifactId>javaee-api</artifactId>
  <version>7.0</version>
  <scope>provided</scope>
</dependency>
OndroMih
  • 7,280
  • 1
  • 26
  • 44
  • Hey, thank you, that actually helped. My particular issue was with one particular jar inside the war file, icu4j.jar. A verification in the mvn dependency tree showed me that the file came from jaxen 1.1.1. Using jaxen 1.1.6 instead removed that jar from the dependencies and solved the problem. – O Superusuário Dec 12 '16 at 21:04